@xpla/xpla-react 1.7.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +47 -0
  3. package/src/amino/amino.ts +1 -0
  4. package/src/binary.ts +534 -0
  5. package/src/cosmos/app/runtime/v1alpha1/module.ts +423 -0
  6. package/src/cosmos/app/runtime/v2/module.ts +589 -0
  7. package/src/cosmos/app/v1alpha1/config.ts +422 -0
  8. package/src/cosmos/app/v1alpha1/module.ts +461 -0
  9. package/src/cosmos/app/v1alpha1/query.rpc.func.ts +14 -0
  10. package/src/cosmos/app/v1alpha1/query.ts +177 -0
  11. package/src/cosmos/auth/module/v1/module.ts +253 -0
  12. package/src/cosmos/auth/v1beta1/accounts.ts +226 -0
  13. package/src/cosmos/auth/v1beta1/auth.ts +550 -0
  14. package/src/cosmos/auth/v1beta1/genesis.ts +119 -0
  15. package/src/cosmos/auth/v1beta1/query.rpc.func.ts +113 -0
  16. package/src/cosmos/auth/v1beta1/query.ts +2034 -0
  17. package/src/cosmos/auth/v1beta1/tx.registry.ts +29 -0
  18. package/src/cosmos/auth/v1beta1/tx.rpc.func.ts +13 -0
  19. package/src/cosmos/auth/v1beta1/tx.ts +219 -0
  20. package/src/cosmos/authz/module/v1/module.ts +80 -0
  21. package/src/cosmos/authz/v1beta1/authz.ts +481 -0
  22. package/src/cosmos/authz/v1beta1/event.ts +259 -0
  23. package/src/cosmos/authz/v1beta1/genesis.ts +100 -0
  24. package/src/cosmos/authz/v1beta1/query.rpc.func.ts +36 -0
  25. package/src/cosmos/authz/v1beta1/query.ts +707 -0
  26. package/src/cosmos/authz/v1beta1/tx.registry.ts +65 -0
  27. package/src/cosmos/authz/v1beta1/tx.rpc.func.ts +31 -0
  28. package/src/cosmos/authz/v1beta1/tx.ts +647 -0
  29. package/src/cosmos/autocli/v1/options.ts +1145 -0
  30. package/src/cosmos/autocli/v1/query.rpc.func.ts +14 -0
  31. package/src/cosmos/autocli/v1/query.ts +288 -0
  32. package/src/cosmos/bank/module/v1/module.ts +153 -0
  33. package/src/cosmos/bank/v1beta1/authz.ts +138 -0
  34. package/src/cosmos/bank/v1beta1/bank.ts +974 -0
  35. package/src/cosmos/bank/v1beta1/genesis.ts +307 -0
  36. package/src/cosmos/bank/v1beta1/query.rpc.func.ts +146 -0
  37. package/src/cosmos/bank/v1beta1/query.ts +3027 -0
  38. package/src/cosmos/bank/v1beta1/tx.registry.ts +83 -0
  39. package/src/cosmos/bank/v1beta1/tx.rpc.func.ts +40 -0
  40. package/src/cosmos/bank/v1beta1/tx.ts +861 -0
  41. package/src/cosmos/base/abci/v1beta1/abci.ts +1698 -0
  42. package/src/cosmos/base/grpc/v2/service.rpc.func.ts +25 -0
  43. package/src/cosmos/base/grpc/v2/service.ts +473 -0
  44. package/src/cosmos/base/node/v1beta1/query.rpc.func.ts +25 -0
  45. package/src/cosmos/base/node/v1beta1/query.ts +454 -0
  46. package/src/cosmos/base/query/v1beta1/pagination.ts +361 -0
  47. package/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts +25 -0
  48. package/src/cosmos/base/reflection/v1beta1/reflection.ts +382 -0
  49. package/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts +69 -0
  50. package/src/cosmos/base/reflection/v2alpha1/reflection.ts +2727 -0
  51. package/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts +80 -0
  52. package/src/cosmos/base/tendermint/v1beta1/query.ts +2302 -0
  53. package/src/cosmos/base/tendermint/v1beta1/types.ts +455 -0
  54. package/src/cosmos/base/v1beta1/coin.ts +439 -0
  55. package/src/cosmos/circuit/module/v1/module.ts +99 -0
  56. package/src/cosmos/circuit/v1/query.rpc.func.ts +36 -0
  57. package/src/cosmos/circuit/v1/query.ts +574 -0
  58. package/src/cosmos/circuit/v1/tx.registry.ts +65 -0
  59. package/src/cosmos/circuit/v1/tx.rpc.func.ts +31 -0
  60. package/src/cosmos/circuit/v1/tx.ts +676 -0
  61. package/src/cosmos/circuit/v1/types.ts +413 -0
  62. package/src/cosmos/consensus/module/v1/module.ts +99 -0
  63. package/src/cosmos/consensus/v1/query.rpc.func.ts +14 -0
  64. package/src/cosmos/consensus/v1/query.ts +185 -0
  65. package/src/cosmos/consensus/v1/tx.registry.ts +29 -0
  66. package/src/cosmos/consensus/v1/tx.rpc.func.ts +13 -0
  67. package/src/cosmos/consensus/v1/tx.ts +255 -0
  68. package/src/cosmos/crisis/module/v1/module.ts +115 -0
  69. package/src/cosmos/crisis/v1beta1/genesis.ts +106 -0
  70. package/src/cosmos/crisis/v1beta1/tx.registry.ts +47 -0
  71. package/src/cosmos/crisis/v1beta1/tx.rpc.func.ts +22 -0
  72. package/src/cosmos/crisis/v1beta1/tx.ts +416 -0
  73. package/src/cosmos/crypto/ed25519/keys.ts +209 -0
  74. package/src/cosmos/crypto/hd/v1/hd.ts +169 -0
  75. package/src/cosmos/crypto/keyring/v1/record.ts +529 -0
  76. package/src/cosmos/crypto/multisig/keys.ts +122 -0
  77. package/src/cosmos/crypto/multisig/v1beta1/multisig.ts +225 -0
  78. package/src/cosmos/crypto/secp256k1/keys.ts +203 -0
  79. package/src/cosmos/crypto/secp256r1/keys.ts +201 -0
  80. package/src/cosmos/distribution/module/v1/module.ts +113 -0
  81. package/src/cosmos/distribution/v1beta1/distribution.ts +1494 -0
  82. package/src/cosmos/distribution/v1beta1/genesis.ts +1129 -0
  83. package/src/cosmos/distribution/v1beta1/query.rpc.func.ts +113 -0
  84. package/src/cosmos/distribution/v1beta1/query.ts +2126 -0
  85. package/src/cosmos/distribution/v1beta1/tx.registry.ts +137 -0
  86. package/src/cosmos/distribution/v1beta1/tx.rpc.func.ts +67 -0
  87. package/src/cosmos/distribution/v1beta1/tx.ts +1478 -0
  88. package/src/cosmos/evidence/module/v1/module.ts +80 -0
  89. package/src/cosmos/evidence/v1beta1/evidence.ts +154 -0
  90. package/src/cosmos/evidence/v1beta1/genesis.ts +102 -0
  91. package/src/cosmos/evidence/v1beta1/query.rpc.func.ts +25 -0
  92. package/src/cosmos/evidence/v1beta1/query.ts +451 -0
  93. package/src/cosmos/evidence/v1beta1/tx.registry.ts +29 -0
  94. package/src/cosmos/evidence/v1beta1/tx.rpc.func.ts +13 -0
  95. package/src/cosmos/evidence/v1beta1/tx.ts +221 -0
  96. package/src/cosmos/feegrant/module/v1/module.ts +80 -0
  97. package/src/cosmos/feegrant/v1beta1/feegrant.ts +573 -0
  98. package/src/cosmos/feegrant/v1beta1/genesis.ts +100 -0
  99. package/src/cosmos/feegrant/v1beta1/query.rpc.func.ts +36 -0
  100. package/src/cosmos/feegrant/v1beta1/query.ts +677 -0
  101. package/src/cosmos/feegrant/v1beta1/tx.registry.ts +65 -0
  102. package/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts +31 -0
  103. package/src/cosmos/feegrant/v1beta1/tx.ts +597 -0
  104. package/src/cosmos/genutil/module/v1/module.ts +80 -0
  105. package/src/cosmos/genutil/v1beta1/genesis.ts +101 -0
  106. package/src/cosmos/gov/module/v1/module.ts +121 -0
  107. package/src/cosmos/gov/v1/genesis.ts +280 -0
  108. package/src/cosmos/gov/v1/gov.ts +1843 -0
  109. package/src/cosmos/gov/v1/query.rpc.func.ts +102 -0
  110. package/src/cosmos/gov/v1/query.ts +1970 -0
  111. package/src/cosmos/gov/v1/tx.registry.ts +137 -0
  112. package/src/cosmos/gov/v1/tx.rpc.func.ts +67 -0
  113. package/src/cosmos/gov/v1/tx.ts +1657 -0
  114. package/src/cosmos/gov/v1beta1/genesis.ts +202 -0
  115. package/src/cosmos/gov/v1beta1/gov.ts +1425 -0
  116. package/src/cosmos/gov/v1beta1/query.rpc.func.ts +91 -0
  117. package/src/cosmos/gov/v1beta1/query.ts +1749 -0
  118. package/src/cosmos/gov/v1beta1/tx.registry.ts +83 -0
  119. package/src/cosmos/gov/v1beta1/tx.rpc.func.ts +40 -0
  120. package/src/cosmos/gov/v1beta1/tx.ts +881 -0
  121. package/src/cosmos/group/module/v1/module.ts +128 -0
  122. package/src/cosmos/group/v1/events.ts +1044 -0
  123. package/src/cosmos/group/v1/genesis.ts +240 -0
  124. package/src/cosmos/group/v1/query.rpc.func.ts +157 -0
  125. package/src/cosmos/group/v1/query.ts +3015 -0
  126. package/src/cosmos/group/v1/tx.registry.ts +263 -0
  127. package/src/cosmos/group/v1/tx.rpc.func.ts +130 -0
  128. package/src/cosmos/group/v1/tx.ts +3207 -0
  129. package/src/cosmos/group/v1/types.ts +2081 -0
  130. package/src/cosmos/ics23/v1/proofs.ts +2060 -0
  131. package/src/cosmos/mint/module/v1/module.ts +113 -0
  132. package/src/cosmos/mint/v1beta1/genesis.ts +116 -0
  133. package/src/cosmos/mint/v1beta1/mint.ts +291 -0
  134. package/src/cosmos/mint/v1beta1/query.rpc.func.ts +36 -0
  135. package/src/cosmos/mint/v1beta1/query.ts +541 -0
  136. package/src/cosmos/mint/v1beta1/tx.registry.ts +29 -0
  137. package/src/cosmos/mint/v1beta1/tx.rpc.func.ts +13 -0
  138. package/src/cosmos/mint/v1beta1/tx.ts +219 -0
  139. package/src/cosmos/msg/textual/v1/textual.ts +1 -0
  140. package/src/cosmos/msg/v1/msg.ts +1 -0
  141. package/src/cosmos/nft/module/v1/module.ts +80 -0
  142. package/src/cosmos/nft/v1beta1/event.ts +403 -0
  143. package/src/cosmos/nft/v1beta1/genesis.ts +234 -0
  144. package/src/cosmos/nft/v1beta1/nft.ts +356 -0
  145. package/src/cosmos/nft/v1beta1/query.rpc.func.ts +80 -0
  146. package/src/cosmos/nft/v1beta1/query.ts +1465 -0
  147. package/src/cosmos/nft/v1beta1/tx.registry.ts +29 -0
  148. package/src/cosmos/nft/v1beta1/tx.rpc.func.ts +13 -0
  149. package/src/cosmos/nft/v1beta1/tx.ts +224 -0
  150. package/src/cosmos/orm/module/v1alpha1/module.ts +88 -0
  151. package/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts +25 -0
  152. package/src/cosmos/orm/query/v1alpha1/query.ts +993 -0
  153. package/src/cosmos/orm/v1/orm.ts +589 -0
  154. package/src/cosmos/orm/v1alpha1/schema.ts +325 -0
  155. package/src/cosmos/params/module/v1/module.ts +80 -0
  156. package/src/cosmos/params/v1beta1/params.ts +255 -0
  157. package/src/cosmos/params/v1beta1/query.rpc.func.ts +25 -0
  158. package/src/cosmos/params/v1beta1/query.ts +525 -0
  159. package/src/cosmos/query/v1/query.ts +1 -0
  160. package/src/cosmos/reflection/v1/reflection.rpc.func.ts +14 -0
  161. package/src/cosmos/reflection/v1/reflection.ts +179 -0
  162. package/src/cosmos/slashing/module/v1/module.ts +99 -0
  163. package/src/cosmos/slashing/v1beta1/genesis.ts +492 -0
  164. package/src/cosmos/slashing/v1beta1/query.rpc.func.ts +36 -0
  165. package/src/cosmos/slashing/v1beta1/query.ts +598 -0
  166. package/src/cosmos/slashing/v1beta1/slashing.ts +357 -0
  167. package/src/cosmos/slashing/v1beta1/tx.registry.ts +47 -0
  168. package/src/cosmos/slashing/v1beta1/tx.rpc.func.ts +22 -0
  169. package/src/cosmos/slashing/v1beta1/tx.ts +390 -0
  170. package/src/cosmos/staking/module/v1/module.ts +157 -0
  171. package/src/cosmos/staking/v1beta1/authz.ts +323 -0
  172. package/src/cosmos/staking/v1beta1/genesis.ts +346 -0
  173. package/src/cosmos/staking/v1beta1/query.rpc.func.ts +157 -0
  174. package/src/cosmos/staking/v1beta1/query.ts +3073 -0
  175. package/src/cosmos/staking/v1beta1/staking.ts +3005 -0
  176. package/src/cosmos/staking/v1beta1/tx.registry.ts +137 -0
  177. package/src/cosmos/staking/v1beta1/tx.rpc.func.ts +67 -0
  178. package/src/cosmos/staking/v1beta1/tx.ts +1638 -0
  179. package/src/cosmos/store/internal/kv/v1beta1/kv.ts +207 -0
  180. package/src/cosmos/store/snapshots/v1/snapshot.ts +863 -0
  181. package/src/cosmos/store/snapshots/v2/snapshot.ts +823 -0
  182. package/src/cosmos/store/streaming/abci/grpc.ts +393 -0
  183. package/src/cosmos/store/v1beta1/commit_info.ts +362 -0
  184. package/src/cosmos/store/v1beta1/listening.ts +286 -0
  185. package/src/cosmos/streaming/v1/grpc.ts +985 -0
  186. package/src/cosmos/tx/config/v1/config.ts +127 -0
  187. package/src/cosmos/tx/signing/v1beta1/signing.ts +688 -0
  188. package/src/cosmos/tx/v1beta1/service.rpc.func.ts +102 -0
  189. package/src/cosmos/tx/v1beta1/service.ts +2294 -0
  190. package/src/cosmos/tx/v1beta1/tx.ts +2029 -0
  191. package/src/cosmos/upgrade/module/v1/module.ts +99 -0
  192. package/src/cosmos/upgrade/v1beta1/query.rpc.func.ts +58 -0
  193. package/src/cosmos/upgrade/v1beta1/query.ts +1016 -0
  194. package/src/cosmos/upgrade/v1beta1/tx.registry.ts +47 -0
  195. package/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts +22 -0
  196. package/src/cosmos/upgrade/v1beta1/tx.ts +398 -0
  197. package/src/cosmos/upgrade/v1beta1/upgrade.ts +591 -0
  198. package/src/cosmos/validate/module/v1/module.ts +80 -0
  199. package/src/cosmos/vesting/module/v1/module.ts +80 -0
  200. package/src/cosmos/vesting/v1beta1/tx.registry.ts +65 -0
  201. package/src/cosmos/vesting/v1beta1/tx.rpc.func.ts +31 -0
  202. package/src/cosmos/vesting/v1beta1/tx.ts +698 -0
  203. package/src/cosmos/vesting/v1beta1/vesting.ts +735 -0
  204. package/src/cosmos_proto/cosmos.ts +341 -0
  205. package/src/cosmwasm/wasm/v1/authz.ts +1231 -0
  206. package/src/cosmwasm/wasm/v1/genesis.ts +532 -0
  207. package/src/cosmwasm/wasm/v1/ibc.ts +355 -0
  208. package/src/cosmwasm/wasm/v1/proposal_legacy.ts +2432 -0
  209. package/src/cosmwasm/wasm/v1/query.rpc.func.ts +124 -0
  210. package/src/cosmwasm/wasm/v1/query.ts +2560 -0
  211. package/src/cosmwasm/wasm/v1/tx.registry.ts +317 -0
  212. package/src/cosmwasm/wasm/v1/tx.rpc.func.ts +157 -0
  213. package/src/cosmwasm/wasm/v1/tx.ts +4191 -0
  214. package/src/cosmwasm/wasm/v1/types.ts +1120 -0
  215. package/src/ethermint/crypto/v1/ethsecp256k1/keys.ts +193 -0
  216. package/src/ethermint/evm/v1/events.ts +485 -0
  217. package/src/ethermint/evm/v1/evm.ts +1590 -0
  218. package/src/ethermint/evm/v1/genesis.ts +240 -0
  219. package/src/ethermint/evm/v1/query.rpc.func.ts +136 -0
  220. package/src/ethermint/evm/v1/query.ts +2535 -0
  221. package/src/ethermint/evm/v1/tx.registry.ts +47 -0
  222. package/src/ethermint/evm/v1/tx.rpc.func.ts +22 -0
  223. package/src/ethermint/evm/v1/tx.ts +1333 -0
  224. package/src/ethermint/feemarket/v1/events.ts +195 -0
  225. package/src/ethermint/feemarket/v1/feemarket.ts +213 -0
  226. package/src/ethermint/feemarket/v1/genesis.ts +114 -0
  227. package/src/ethermint/feemarket/v1/query.rpc.func.ts +36 -0
  228. package/src/ethermint/feemarket/v1/query.ts +487 -0
  229. package/src/ethermint/feemarket/v1/tx.registry.ts +29 -0
  230. package/src/ethermint/feemarket/v1/tx.rpc.func.ts +13 -0
  231. package/src/ethermint/feemarket/v1/tx.ts +197 -0
  232. package/src/ethermint/types/v1/account.ts +114 -0
  233. package/src/ethermint/types/v1/dynamic_fee.ts +91 -0
  234. package/src/ethermint/types/v1/indexer.ts +205 -0
  235. package/src/ethermint/types/v1/web3.ts +147 -0
  236. package/src/extern.ts +38 -0
  237. package/src/gogoproto/gogo.ts +1 -0
  238. package/src/google/api/annotations.ts +1 -0
  239. package/src/google/api/http.ts +1069 -0
  240. package/src/google/protobuf/any.ts +331 -0
  241. package/src/google/protobuf/descriptor.ts +7177 -0
  242. package/src/google/protobuf/duration.ts +225 -0
  243. package/src/google/protobuf/timestamp.ts +281 -0
  244. package/src/helper-func-types.ts +191 -0
  245. package/src/helpers.ts +259 -0
  246. package/src/ibc/applications/fee/v1/ack.ts +131 -0
  247. package/src/ibc/applications/fee/v1/fee.ts +481 -0
  248. package/src/ibc/applications/fee/v1/genesis.ts +661 -0
  249. package/src/ibc/applications/fee/v1/metadata.ts +121 -0
  250. package/src/ibc/applications/fee/v1/query.rpc.func.ts +113 -0
  251. package/src/ibc/applications/fee/v1/query.ts +2134 -0
  252. package/src/ibc/applications/fee/v1/tx.registry.ts +83 -0
  253. package/src/ibc/applications/fee/v1/tx.rpc.func.ts +40 -0
  254. package/src/ibc/applications/fee/v1/tx.ts +889 -0
  255. package/src/ibc/applications/interchain_accounts/controller/v1/controller.ts +105 -0
  256. package/src/ibc/applications/interchain_accounts/controller/v1/query.rpc.func.ts +25 -0
  257. package/src/ibc/applications/interchain_accounts/controller/v1/query.ts +379 -0
  258. package/src/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts +65 -0
  259. package/src/ibc/applications/interchain_accounts/controller/v1/tx.rpc.func.ts +31 -0
  260. package/src/ibc/applications/interchain_accounts/controller/v1/tx.ts +685 -0
  261. package/src/ibc/applications/interchain_accounts/genesis/v1/genesis.ts +661 -0
  262. package/src/ibc/applications/interchain_accounts/host/v1/host.ts +253 -0
  263. package/src/ibc/applications/interchain_accounts/host/v1/query.rpc.func.ts +14 -0
  264. package/src/ibc/applications/interchain_accounts/host/v1/query.ts +177 -0
  265. package/src/ibc/applications/interchain_accounts/host/v1/tx.registry.ts +47 -0
  266. package/src/ibc/applications/interchain_accounts/host/v1/tx.rpc.func.ts +22 -0
  267. package/src/ibc/applications/interchain_accounts/host/v1/tx.ts +429 -0
  268. package/src/ibc/applications/interchain_accounts/v1/account.ts +112 -0
  269. package/src/ibc/applications/interchain_accounts/v1/metadata.ts +191 -0
  270. package/src/ibc/applications/interchain_accounts/v1/packet.ts +259 -0
  271. package/src/ibc/applications/transfer/v1/authz.ts +280 -0
  272. package/src/ibc/applications/transfer/v1/genesis.ts +153 -0
  273. package/src/ibc/applications/transfer/v1/query.rpc.func.ts +69 -0
  274. package/src/ibc/applications/transfer/v1/query.ts +1205 -0
  275. package/src/ibc/applications/transfer/v1/transfer.ts +261 -0
  276. package/src/ibc/applications/transfer/v1/tx.registry.ts +47 -0
  277. package/src/ibc/applications/transfer/v1/tx.rpc.func.ts +22 -0
  278. package/src/ibc/applications/transfer/v1/tx.ts +532 -0
  279. package/src/ibc/applications/transfer/v2/packet.ts +171 -0
  280. package/src/ibc/core/channel/v1/channel.ts +1510 -0
  281. package/src/ibc/core/channel/v1/genesis.ts +354 -0
  282. package/src/ibc/core/channel/v1/query.rpc.func.ts +190 -0
  283. package/src/ibc/core/channel/v1/query.ts +4354 -0
  284. package/src/ibc/core/channel/v1/tx.registry.ts +353 -0
  285. package/src/ibc/core/channel/v1/tx.rpc.func.ts +175 -0
  286. package/src/ibc/core/channel/v1/tx.ts +4866 -0
  287. package/src/ibc/core/channel/v1/upgrade.ts +388 -0
  288. package/src/ibc/core/client/v1/client.ts +927 -0
  289. package/src/ibc/core/client/v1/genesis.ts +426 -0
  290. package/src/ibc/core/client/v1/query.rpc.func.ts +113 -0
  291. package/src/ibc/core/client/v1/query.ts +2280 -0
  292. package/src/ibc/core/client/v1/tx.registry.ts +137 -0
  293. package/src/ibc/core/client/v1/tx.rpc.func.ts +67 -0
  294. package/src/ibc/core/client/v1/tx.ts +1543 -0
  295. package/src/ibc/core/commitment/v1/commitment.ts +418 -0
  296. package/src/ibc/core/connection/v1/connection.ts +1010 -0
  297. package/src/ibc/core/connection/v1/genesis.ts +146 -0
  298. package/src/ibc/core/connection/v1/query.rpc.func.ts +69 -0
  299. package/src/ibc/core/connection/v1/query.ts +1408 -0
  300. package/src/ibc/core/connection/v1/tx.registry.ts +101 -0
  301. package/src/ibc/core/connection/v1/tx.rpc.func.ts +49 -0
  302. package/src/ibc/core/connection/v1/tx.ts +1365 -0
  303. package/src/ibc/core/types/v1/genesis.ts +137 -0
  304. package/src/ibc/lightclients/localhost/v2/localhost.ts +100 -0
  305. package/src/ibc/lightclients/solomachine/v2/solomachine.ts +2103 -0
  306. package/src/ibc/lightclients/solomachine/v3/solomachine.ts +1070 -0
  307. package/src/ibc/lightclients/tendermint/v1/tendermint.ts +838 -0
  308. package/src/ibc/lightclients/wasm/v1/genesis.ts +197 -0
  309. package/src/ibc/lightclients/wasm/v1/query.rpc.func.ts +25 -0
  310. package/src/ibc/lightclients/wasm/v1/query.ts +404 -0
  311. package/src/ibc/lightclients/wasm/v1/tx.registry.ts +65 -0
  312. package/src/ibc/lightclients/wasm/v1/tx.rpc.func.ts +31 -0
  313. package/src/ibc/lightclients/wasm/v1/tx.ts +621 -0
  314. package/src/ibc/lightclients/wasm/v1/wasm.ts +438 -0
  315. package/src/react-query.ts +185 -0
  316. package/src/registry.ts +218 -0
  317. package/src/tendermint/abci/types.ts +6283 -0
  318. package/src/tendermint/crypto/keys.ts +103 -0
  319. package/src/tendermint/crypto/proof.ts +555 -0
  320. package/src/tendermint/p2p/types.ts +507 -0
  321. package/src/tendermint/types/block.ts +131 -0
  322. package/src/tendermint/types/evidence.ts +476 -0
  323. package/src/tendermint/types/params.ts +814 -0
  324. package/src/tendermint/types/types.ts +2157 -0
  325. package/src/tendermint/types/validator.ts +389 -0
  326. package/src/tendermint/version/types.ts +219 -0
  327. package/src/types.ts +155 -0
  328. package/src/utf8.ts +148 -0
  329. package/src/varint.ts +488 -0
  330. package/src/xpla/reward/v1beta1/genesis.ts +92 -0
  331. package/src/xpla/reward/v1beta1/query.rpc.func.ts +25 -0
  332. package/src/xpla/reward/v1beta1/query.ts +333 -0
  333. package/src/xpla/reward/v1beta1/reward.ts +153 -0
  334. package/src/xpla/reward/v1beta1/tx.registry.ts +47 -0
  335. package/src/xpla/reward/v1beta1/tx.rpc.func.ts +22 -0
  336. package/src/xpla/reward/v1beta1/tx.ts +391 -0
  337. package/src/xpla/volunteer/v1beta1/genesis.ts +92 -0
  338. package/src/xpla/volunteer/v1beta1/proposal.ts +649 -0
  339. package/src/xpla/volunteer/v1beta1/query.rpc.func.ts +14 -0
  340. package/src/xpla/volunteer/v1beta1/query.ts +160 -0
  341. package/src/xpla/volunteer/v1beta1/tx.registry.ts +47 -0
  342. package/src/xpla/volunteer/v1beta1/tx.rpc.func.ts +22 -0
  343. package/src/xpla/volunteer/v1beta1/tx.ts +448 -0
  344. package/src/xpla/volunteer/v1beta1/volunteervalidator.ts +107 -0
  345. package/tsconfig.esm.json +10 -0
  346. package/tsconfig.json +10 -0
@@ -0,0 +1,3005 @@
1
+ import { Header, HeaderAmino } from "../../../tendermint/types/types";
2
+ import { Timestamp } from "../../../google/protobuf/timestamp";
3
+ import { Any, AnyProtoMsg, AnyAmino } from "../../../google/protobuf/any";
4
+ import { Duration, DurationAmino } from "../../../google/protobuf/duration";
5
+ import { Coin, CoinAmino } from "../../base/v1beta1/coin";
6
+ import { ValidatorUpdate, ValidatorUpdateAmino } from "../../../tendermint/abci/types";
7
+ import { BinaryReader, BinaryWriter } from "../../../binary";
8
+ import { DeepPartial, toTimestamp, fromTimestamp, isSet } from "../../../helpers";
9
+ import { GlobalDecoderRegistry } from "../../../registry";
10
+ import { encodePubkey, decodePubkey } from "@cosmjs/proto-signing";
11
+ /** BondStatus is the status of a validator. */
12
+ export enum BondStatus {
13
+ /** BOND_STATUS_UNSPECIFIED - UNSPECIFIED defines an invalid validator status. */
14
+ BOND_STATUS_UNSPECIFIED = 0,
15
+ /** BOND_STATUS_UNBONDED - UNBONDED defines a validator that is not bonded. */
16
+ BOND_STATUS_UNBONDED = 1,
17
+ /** BOND_STATUS_UNBONDING - UNBONDING defines a validator that is unbonding. */
18
+ BOND_STATUS_UNBONDING = 2,
19
+ /** BOND_STATUS_BONDED - BONDED defines a validator that is bonded. */
20
+ BOND_STATUS_BONDED = 3,
21
+ UNRECOGNIZED = -1,
22
+ }
23
+ export const BondStatusAmino = BondStatus;
24
+ export function bondStatusFromJSON(object: any): BondStatus {
25
+ switch (object) {
26
+ case 0:
27
+ case "BOND_STATUS_UNSPECIFIED":
28
+ return BondStatus.BOND_STATUS_UNSPECIFIED;
29
+ case 1:
30
+ case "BOND_STATUS_UNBONDED":
31
+ return BondStatus.BOND_STATUS_UNBONDED;
32
+ case 2:
33
+ case "BOND_STATUS_UNBONDING":
34
+ return BondStatus.BOND_STATUS_UNBONDING;
35
+ case 3:
36
+ case "BOND_STATUS_BONDED":
37
+ return BondStatus.BOND_STATUS_BONDED;
38
+ case -1:
39
+ case "UNRECOGNIZED":
40
+ default:
41
+ return BondStatus.UNRECOGNIZED;
42
+ }
43
+ }
44
+ export function bondStatusToJSON(object: BondStatus): string {
45
+ switch (object) {
46
+ case BondStatus.BOND_STATUS_UNSPECIFIED:
47
+ return "BOND_STATUS_UNSPECIFIED";
48
+ case BondStatus.BOND_STATUS_UNBONDED:
49
+ return "BOND_STATUS_UNBONDED";
50
+ case BondStatus.BOND_STATUS_UNBONDING:
51
+ return "BOND_STATUS_UNBONDING";
52
+ case BondStatus.BOND_STATUS_BONDED:
53
+ return "BOND_STATUS_BONDED";
54
+ case BondStatus.UNRECOGNIZED:
55
+ default:
56
+ return "UNRECOGNIZED";
57
+ }
58
+ }
59
+ /** Infraction indicates the infraction a validator commited. */
60
+ export enum Infraction {
61
+ /** INFRACTION_UNSPECIFIED - UNSPECIFIED defines an empty infraction. */
62
+ INFRACTION_UNSPECIFIED = 0,
63
+ /** INFRACTION_DOUBLE_SIGN - DOUBLE_SIGN defines a validator that double-signs a block. */
64
+ INFRACTION_DOUBLE_SIGN = 1,
65
+ /** INFRACTION_DOWNTIME - DOWNTIME defines a validator that missed signing too many blocks. */
66
+ INFRACTION_DOWNTIME = 2,
67
+ UNRECOGNIZED = -1,
68
+ }
69
+ export const InfractionAmino = Infraction;
70
+ export function infractionFromJSON(object: any): Infraction {
71
+ switch (object) {
72
+ case 0:
73
+ case "INFRACTION_UNSPECIFIED":
74
+ return Infraction.INFRACTION_UNSPECIFIED;
75
+ case 1:
76
+ case "INFRACTION_DOUBLE_SIGN":
77
+ return Infraction.INFRACTION_DOUBLE_SIGN;
78
+ case 2:
79
+ case "INFRACTION_DOWNTIME":
80
+ return Infraction.INFRACTION_DOWNTIME;
81
+ case -1:
82
+ case "UNRECOGNIZED":
83
+ default:
84
+ return Infraction.UNRECOGNIZED;
85
+ }
86
+ }
87
+ export function infractionToJSON(object: Infraction): string {
88
+ switch (object) {
89
+ case Infraction.INFRACTION_UNSPECIFIED:
90
+ return "INFRACTION_UNSPECIFIED";
91
+ case Infraction.INFRACTION_DOUBLE_SIGN:
92
+ return "INFRACTION_DOUBLE_SIGN";
93
+ case Infraction.INFRACTION_DOWNTIME:
94
+ return "INFRACTION_DOWNTIME";
95
+ case Infraction.UNRECOGNIZED:
96
+ default:
97
+ return "UNRECOGNIZED";
98
+ }
99
+ }
100
+ /**
101
+ * HistoricalInfo contains header and validator information for a given block.
102
+ * It is stored as part of staking module's state, which persists the `n` most
103
+ * recent HistoricalInfo
104
+ * (`n` is set by the staking module's `historical_entries` parameter).
105
+ */
106
+ export interface HistoricalInfo {
107
+ header: Header;
108
+ valset: Validator[];
109
+ }
110
+ export interface HistoricalInfoProtoMsg {
111
+ typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo";
112
+ value: Uint8Array;
113
+ }
114
+ /**
115
+ * HistoricalInfo contains header and validator information for a given block.
116
+ * It is stored as part of staking module's state, which persists the `n` most
117
+ * recent HistoricalInfo
118
+ * (`n` is set by the staking module's `historical_entries` parameter).
119
+ */
120
+ export interface HistoricalInfoAmino {
121
+ header: HeaderAmino;
122
+ valset: ValidatorAmino[];
123
+ }
124
+ export interface HistoricalInfoAminoMsg {
125
+ type: "cosmos-sdk/HistoricalInfo";
126
+ value: HistoricalInfoAmino;
127
+ }
128
+ /**
129
+ * CommissionRates defines the initial commission rates to be used for creating
130
+ * a validator.
131
+ */
132
+ export interface CommissionRates {
133
+ /** rate is the commission rate charged to delegators, as a fraction. */
134
+ rate: string;
135
+ /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */
136
+ maxRate: string;
137
+ /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */
138
+ maxChangeRate: string;
139
+ }
140
+ export interface CommissionRatesProtoMsg {
141
+ typeUrl: "/cosmos.staking.v1beta1.CommissionRates";
142
+ value: Uint8Array;
143
+ }
144
+ /**
145
+ * CommissionRates defines the initial commission rates to be used for creating
146
+ * a validator.
147
+ */
148
+ export interface CommissionRatesAmino {
149
+ /** rate is the commission rate charged to delegators, as a fraction. */
150
+ rate: string;
151
+ /** max_rate defines the maximum commission rate which validator can ever charge, as a fraction. */
152
+ max_rate: string;
153
+ /** max_change_rate defines the maximum daily increase of the validator commission, as a fraction. */
154
+ max_change_rate: string;
155
+ }
156
+ export interface CommissionRatesAminoMsg {
157
+ type: "cosmos-sdk/CommissionRates";
158
+ value: CommissionRatesAmino;
159
+ }
160
+ /** Commission defines commission parameters for a given validator. */
161
+ export interface Commission {
162
+ /** commission_rates defines the initial commission rates to be used for creating a validator. */
163
+ commissionRates: CommissionRates;
164
+ /** update_time is the last time the commission rate was changed. */
165
+ updateTime: Date;
166
+ }
167
+ export interface CommissionProtoMsg {
168
+ typeUrl: "/cosmos.staking.v1beta1.Commission";
169
+ value: Uint8Array;
170
+ }
171
+ /** Commission defines commission parameters for a given validator. */
172
+ export interface CommissionAmino {
173
+ /** commission_rates defines the initial commission rates to be used for creating a validator. */
174
+ commission_rates: CommissionRatesAmino;
175
+ /** update_time is the last time the commission rate was changed. */
176
+ update_time: string;
177
+ }
178
+ export interface CommissionAminoMsg {
179
+ type: "cosmos-sdk/Commission";
180
+ value: CommissionAmino;
181
+ }
182
+ /** Description defines a validator description. */
183
+ export interface Description {
184
+ /** moniker defines a human-readable name for the validator. */
185
+ moniker: string;
186
+ /** identity defines an optional identity signature (ex. UPort or Keybase). */
187
+ identity: string;
188
+ /** website defines an optional website link. */
189
+ website: string;
190
+ /** security_contact defines an optional email for security contact. */
191
+ securityContact: string;
192
+ /** details define other optional details. */
193
+ details: string;
194
+ }
195
+ export interface DescriptionProtoMsg {
196
+ typeUrl: "/cosmos.staking.v1beta1.Description";
197
+ value: Uint8Array;
198
+ }
199
+ /** Description defines a validator description. */
200
+ export interface DescriptionAmino {
201
+ /** moniker defines a human-readable name for the validator. */
202
+ moniker: string;
203
+ /** identity defines an optional identity signature (ex. UPort or Keybase). */
204
+ identity: string;
205
+ /** website defines an optional website link. */
206
+ website: string;
207
+ /** security_contact defines an optional email for security contact. */
208
+ security_contact: string;
209
+ /** details define other optional details. */
210
+ details: string;
211
+ }
212
+ export interface DescriptionAminoMsg {
213
+ type: "cosmos-sdk/Description";
214
+ value: DescriptionAmino;
215
+ }
216
+ /**
217
+ * Validator defines a validator, together with the total amount of the
218
+ * Validator's bond shares and their exchange rate to coins. Slashing results in
219
+ * a decrease in the exchange rate, allowing correct calculation of future
220
+ * undelegations without iterating over delegators. When coins are delegated to
221
+ * this validator, the validator is credited with a delegation whose number of
222
+ * bond shares is based on the amount of coins delegated divided by the current
223
+ * exchange rate. Voting power can be calculated as total bonded shares
224
+ * multiplied by exchange rate.
225
+ */
226
+ export interface Validator {
227
+ /** operator_address defines the address of the validator's operator; bech encoded in JSON. */
228
+ operatorAddress: string;
229
+ /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */
230
+ consensusPubkey?: Any | undefined;
231
+ /** jailed defined whether the validator has been jailed from bonded status or not. */
232
+ jailed: boolean;
233
+ /** status is the validator status (bonded/unbonding/unbonded). */
234
+ status: BondStatus;
235
+ /** tokens define the delegated tokens (incl. self-delegation). */
236
+ tokens: string;
237
+ /** delegator_shares defines total shares issued to a validator's delegators. */
238
+ delegatorShares: string;
239
+ /** description defines the description terms for the validator. */
240
+ description: Description;
241
+ /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */
242
+ unbondingHeight: bigint;
243
+ /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */
244
+ unbondingTime: Date;
245
+ /** commission defines the commission parameters. */
246
+ commission: Commission;
247
+ /**
248
+ * min_self_delegation is the validator's self declared minimum self delegation.
249
+ *
250
+ * Since: cosmos-sdk 0.46
251
+ */
252
+ minSelfDelegation: string;
253
+ /** strictly positive if this validator's unbonding has been stopped by external modules */
254
+ unbondingOnHoldRefCount: bigint;
255
+ /** list of unbonding ids, each uniquely identifing an unbonding of this validator */
256
+ unbondingIds: bigint[];
257
+ }
258
+ export interface ValidatorProtoMsg {
259
+ typeUrl: "/cosmos.staking.v1beta1.Validator";
260
+ value: Uint8Array;
261
+ }
262
+ export type ValidatorEncoded = Omit<Validator, "consensusPubkey"> & {
263
+ /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */consensusPubkey?: AnyProtoMsg | undefined;
264
+ };
265
+ /**
266
+ * Validator defines a validator, together with the total amount of the
267
+ * Validator's bond shares and their exchange rate to coins. Slashing results in
268
+ * a decrease in the exchange rate, allowing correct calculation of future
269
+ * undelegations without iterating over delegators. When coins are delegated to
270
+ * this validator, the validator is credited with a delegation whose number of
271
+ * bond shares is based on the amount of coins delegated divided by the current
272
+ * exchange rate. Voting power can be calculated as total bonded shares
273
+ * multiplied by exchange rate.
274
+ */
275
+ export interface ValidatorAmino {
276
+ /** operator_address defines the address of the validator's operator; bech encoded in JSON. */
277
+ operator_address: string;
278
+ /** consensus_pubkey is the consensus public key of the validator, as a Protobuf Any. */
279
+ consensus_pubkey?: AnyAmino;
280
+ /** jailed defined whether the validator has been jailed from bonded status or not. */
281
+ jailed: boolean;
282
+ /** status is the validator status (bonded/unbonding/unbonded). */
283
+ status: BondStatus;
284
+ /** tokens define the delegated tokens (incl. self-delegation). */
285
+ tokens: string;
286
+ /** delegator_shares defines total shares issued to a validator's delegators. */
287
+ delegator_shares: string;
288
+ /** description defines the description terms for the validator. */
289
+ description: DescriptionAmino;
290
+ /** unbonding_height defines, if unbonding, the height at which this validator has begun unbonding. */
291
+ unbonding_height: string;
292
+ /** unbonding_time defines, if unbonding, the min time for the validator to complete unbonding. */
293
+ unbonding_time: string;
294
+ /** commission defines the commission parameters. */
295
+ commission: CommissionAmino;
296
+ /**
297
+ * min_self_delegation is the validator's self declared minimum self delegation.
298
+ *
299
+ * Since: cosmos-sdk 0.46
300
+ */
301
+ min_self_delegation: string;
302
+ /** strictly positive if this validator's unbonding has been stopped by external modules */
303
+ unbonding_on_hold_ref_count: string;
304
+ /** list of unbonding ids, each uniquely identifing an unbonding of this validator */
305
+ unbonding_ids: string[];
306
+ }
307
+ export interface ValidatorAminoMsg {
308
+ type: "cosmos-sdk/Validator";
309
+ value: ValidatorAmino;
310
+ }
311
+ /** ValAddresses defines a repeated set of validator addresses. */
312
+ export interface ValAddresses {
313
+ addresses: string[];
314
+ }
315
+ export interface ValAddressesProtoMsg {
316
+ typeUrl: "/cosmos.staking.v1beta1.ValAddresses";
317
+ value: Uint8Array;
318
+ }
319
+ /** ValAddresses defines a repeated set of validator addresses. */
320
+ export interface ValAddressesAmino {
321
+ addresses: string[];
322
+ }
323
+ export interface ValAddressesAminoMsg {
324
+ type: "cosmos-sdk/ValAddresses";
325
+ value: ValAddressesAmino;
326
+ }
327
+ /**
328
+ * DVPair is struct that just has a delegator-validator pair with no other data.
329
+ * It is intended to be used as a marshalable pointer. For example, a DVPair can
330
+ * be used to construct the key to getting an UnbondingDelegation from state.
331
+ */
332
+ export interface DVPair {
333
+ delegatorAddress: string;
334
+ validatorAddress: string;
335
+ }
336
+ export interface DVPairProtoMsg {
337
+ typeUrl: "/cosmos.staking.v1beta1.DVPair";
338
+ value: Uint8Array;
339
+ }
340
+ /**
341
+ * DVPair is struct that just has a delegator-validator pair with no other data.
342
+ * It is intended to be used as a marshalable pointer. For example, a DVPair can
343
+ * be used to construct the key to getting an UnbondingDelegation from state.
344
+ */
345
+ export interface DVPairAmino {
346
+ delegator_address: string;
347
+ validator_address: string;
348
+ }
349
+ export interface DVPairAminoMsg {
350
+ type: "cosmos-sdk/DVPair";
351
+ value: DVPairAmino;
352
+ }
353
+ /** DVPairs defines an array of DVPair objects. */
354
+ export interface DVPairs {
355
+ pairs: DVPair[];
356
+ }
357
+ export interface DVPairsProtoMsg {
358
+ typeUrl: "/cosmos.staking.v1beta1.DVPairs";
359
+ value: Uint8Array;
360
+ }
361
+ /** DVPairs defines an array of DVPair objects. */
362
+ export interface DVPairsAmino {
363
+ pairs: DVPairAmino[];
364
+ }
365
+ export interface DVPairsAminoMsg {
366
+ type: "cosmos-sdk/DVPairs";
367
+ value: DVPairsAmino;
368
+ }
369
+ /**
370
+ * DVVTriplet is struct that just has a delegator-validator-validator triplet
371
+ * with no other data. It is intended to be used as a marshalable pointer. For
372
+ * example, a DVVTriplet can be used to construct the key to getting a
373
+ * Redelegation from state.
374
+ */
375
+ export interface DVVTriplet {
376
+ delegatorAddress: string;
377
+ validatorSrcAddress: string;
378
+ validatorDstAddress: string;
379
+ }
380
+ export interface DVVTripletProtoMsg {
381
+ typeUrl: "/cosmos.staking.v1beta1.DVVTriplet";
382
+ value: Uint8Array;
383
+ }
384
+ /**
385
+ * DVVTriplet is struct that just has a delegator-validator-validator triplet
386
+ * with no other data. It is intended to be used as a marshalable pointer. For
387
+ * example, a DVVTriplet can be used to construct the key to getting a
388
+ * Redelegation from state.
389
+ */
390
+ export interface DVVTripletAmino {
391
+ delegator_address: string;
392
+ validator_src_address: string;
393
+ validator_dst_address: string;
394
+ }
395
+ export interface DVVTripletAminoMsg {
396
+ type: "cosmos-sdk/DVVTriplet";
397
+ value: DVVTripletAmino;
398
+ }
399
+ /** DVVTriplets defines an array of DVVTriplet objects. */
400
+ export interface DVVTriplets {
401
+ triplets: DVVTriplet[];
402
+ }
403
+ export interface DVVTripletsProtoMsg {
404
+ typeUrl: "/cosmos.staking.v1beta1.DVVTriplets";
405
+ value: Uint8Array;
406
+ }
407
+ /** DVVTriplets defines an array of DVVTriplet objects. */
408
+ export interface DVVTripletsAmino {
409
+ triplets: DVVTripletAmino[];
410
+ }
411
+ export interface DVVTripletsAminoMsg {
412
+ type: "cosmos-sdk/DVVTriplets";
413
+ value: DVVTripletsAmino;
414
+ }
415
+ /**
416
+ * Delegation represents the bond with tokens held by an account. It is
417
+ * owned by one delegator, and is associated with the voting power of one
418
+ * validator.
419
+ */
420
+ export interface Delegation {
421
+ /** delegator_address is the encoded address of the delegator. */
422
+ delegatorAddress: string;
423
+ /** validator_address is the encoded address of the validator. */
424
+ validatorAddress: string;
425
+ /** shares define the delegation shares received. */
426
+ shares: string;
427
+ }
428
+ export interface DelegationProtoMsg {
429
+ typeUrl: "/cosmos.staking.v1beta1.Delegation";
430
+ value: Uint8Array;
431
+ }
432
+ /**
433
+ * Delegation represents the bond with tokens held by an account. It is
434
+ * owned by one delegator, and is associated with the voting power of one
435
+ * validator.
436
+ */
437
+ export interface DelegationAmino {
438
+ /** delegator_address is the encoded address of the delegator. */
439
+ delegator_address: string;
440
+ /** validator_address is the encoded address of the validator. */
441
+ validator_address: string;
442
+ /** shares define the delegation shares received. */
443
+ shares: string;
444
+ }
445
+ export interface DelegationAminoMsg {
446
+ type: "cosmos-sdk/Delegation";
447
+ value: DelegationAmino;
448
+ }
449
+ /**
450
+ * UnbondingDelegation stores all of a single delegator's unbonding bonds
451
+ * for a single validator in an time-ordered list.
452
+ */
453
+ export interface UnbondingDelegation {
454
+ /** delegator_address is the encoded address of the delegator. */
455
+ delegatorAddress: string;
456
+ /** validator_address is the encoded address of the validator. */
457
+ validatorAddress: string;
458
+ /** entries are the unbonding delegation entries. */
459
+ entries: UnbondingDelegationEntry[];
460
+ }
461
+ export interface UnbondingDelegationProtoMsg {
462
+ typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation";
463
+ value: Uint8Array;
464
+ }
465
+ /**
466
+ * UnbondingDelegation stores all of a single delegator's unbonding bonds
467
+ * for a single validator in an time-ordered list.
468
+ */
469
+ export interface UnbondingDelegationAmino {
470
+ /** delegator_address is the encoded address of the delegator. */
471
+ delegator_address: string;
472
+ /** validator_address is the encoded address of the validator. */
473
+ validator_address: string;
474
+ /** entries are the unbonding delegation entries. */
475
+ entries: UnbondingDelegationEntryAmino[];
476
+ }
477
+ export interface UnbondingDelegationAminoMsg {
478
+ type: "cosmos-sdk/UnbondingDelegation";
479
+ value: UnbondingDelegationAmino;
480
+ }
481
+ /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */
482
+ export interface UnbondingDelegationEntry {
483
+ /** creation_height is the height which the unbonding took place. */
484
+ creationHeight: bigint;
485
+ /** completion_time is the unix time for unbonding completion. */
486
+ completionTime: Date;
487
+ /** initial_balance defines the tokens initially scheduled to receive at completion. */
488
+ initialBalance: string;
489
+ /** balance defines the tokens to receive at completion. */
490
+ balance: string;
491
+ /** Incrementing id that uniquely identifies this entry */
492
+ unbondingId: bigint;
493
+ /** Strictly positive if this entry's unbonding has been stopped by external modules */
494
+ unbondingOnHoldRefCount: bigint;
495
+ }
496
+ export interface UnbondingDelegationEntryProtoMsg {
497
+ typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry";
498
+ value: Uint8Array;
499
+ }
500
+ /** UnbondingDelegationEntry defines an unbonding object with relevant metadata. */
501
+ export interface UnbondingDelegationEntryAmino {
502
+ /** creation_height is the height which the unbonding took place. */
503
+ creation_height: string;
504
+ /** completion_time is the unix time for unbonding completion. */
505
+ completion_time: string;
506
+ /** initial_balance defines the tokens initially scheduled to receive at completion. */
507
+ initial_balance: string;
508
+ /** balance defines the tokens to receive at completion. */
509
+ balance: string;
510
+ /** Incrementing id that uniquely identifies this entry */
511
+ unbonding_id: string;
512
+ /** Strictly positive if this entry's unbonding has been stopped by external modules */
513
+ unbonding_on_hold_ref_count: string;
514
+ }
515
+ export interface UnbondingDelegationEntryAminoMsg {
516
+ type: "cosmos-sdk/UnbondingDelegationEntry";
517
+ value: UnbondingDelegationEntryAmino;
518
+ }
519
+ /** RedelegationEntry defines a redelegation object with relevant metadata. */
520
+ export interface RedelegationEntry {
521
+ /** creation_height defines the height which the redelegation took place. */
522
+ creationHeight: bigint;
523
+ /** completion_time defines the unix time for redelegation completion. */
524
+ completionTime: Date;
525
+ /** initial_balance defines the initial balance when redelegation started. */
526
+ initialBalance: string;
527
+ /** shares_dst is the amount of destination-validator shares created by redelegation. */
528
+ sharesDst: string;
529
+ /** Incrementing id that uniquely identifies this entry */
530
+ unbondingId: bigint;
531
+ /** Strictly positive if this entry's unbonding has been stopped by external modules */
532
+ unbondingOnHoldRefCount: bigint;
533
+ }
534
+ export interface RedelegationEntryProtoMsg {
535
+ typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry";
536
+ value: Uint8Array;
537
+ }
538
+ /** RedelegationEntry defines a redelegation object with relevant metadata. */
539
+ export interface RedelegationEntryAmino {
540
+ /** creation_height defines the height which the redelegation took place. */
541
+ creation_height: string;
542
+ /** completion_time defines the unix time for redelegation completion. */
543
+ completion_time: string;
544
+ /** initial_balance defines the initial balance when redelegation started. */
545
+ initial_balance: string;
546
+ /** shares_dst is the amount of destination-validator shares created by redelegation. */
547
+ shares_dst: string;
548
+ /** Incrementing id that uniquely identifies this entry */
549
+ unbonding_id: string;
550
+ /** Strictly positive if this entry's unbonding has been stopped by external modules */
551
+ unbonding_on_hold_ref_count: string;
552
+ }
553
+ export interface RedelegationEntryAminoMsg {
554
+ type: "cosmos-sdk/RedelegationEntry";
555
+ value: RedelegationEntryAmino;
556
+ }
557
+ /**
558
+ * Redelegation contains the list of a particular delegator's redelegating bonds
559
+ * from a particular source validator to a particular destination validator.
560
+ */
561
+ export interface Redelegation {
562
+ /** delegator_address is the bech32-encoded address of the delegator. */
563
+ delegatorAddress: string;
564
+ /** validator_src_address is the validator redelegation source operator address. */
565
+ validatorSrcAddress: string;
566
+ /** validator_dst_address is the validator redelegation destination operator address. */
567
+ validatorDstAddress: string;
568
+ /** entries are the redelegation entries. */
569
+ entries: RedelegationEntry[];
570
+ }
571
+ export interface RedelegationProtoMsg {
572
+ typeUrl: "/cosmos.staking.v1beta1.Redelegation";
573
+ value: Uint8Array;
574
+ }
575
+ /**
576
+ * Redelegation contains the list of a particular delegator's redelegating bonds
577
+ * from a particular source validator to a particular destination validator.
578
+ */
579
+ export interface RedelegationAmino {
580
+ /** delegator_address is the bech32-encoded address of the delegator. */
581
+ delegator_address: string;
582
+ /** validator_src_address is the validator redelegation source operator address. */
583
+ validator_src_address: string;
584
+ /** validator_dst_address is the validator redelegation destination operator address. */
585
+ validator_dst_address: string;
586
+ /** entries are the redelegation entries. */
587
+ entries: RedelegationEntryAmino[];
588
+ }
589
+ export interface RedelegationAminoMsg {
590
+ type: "cosmos-sdk/Redelegation";
591
+ value: RedelegationAmino;
592
+ }
593
+ /** Params defines the parameters for the x/staking module. */
594
+ export interface Params {
595
+ /** unbonding_time is the time duration of unbonding. */
596
+ unbondingTime: Duration;
597
+ /** max_validators is the maximum number of validators. */
598
+ maxValidators: number;
599
+ /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */
600
+ maxEntries: number;
601
+ /** historical_entries is the number of historical entries to persist. */
602
+ historicalEntries: number;
603
+ /** bond_denom defines the bondable coin denomination. */
604
+ bondDenom: string;
605
+ /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */
606
+ minCommissionRate: string;
607
+ }
608
+ export interface ParamsProtoMsg {
609
+ typeUrl: "/cosmos.staking.v1beta1.Params";
610
+ value: Uint8Array;
611
+ }
612
+ /** Params defines the parameters for the x/staking module. */
613
+ export interface ParamsAmino {
614
+ /** unbonding_time is the time duration of unbonding. */
615
+ unbonding_time: DurationAmino;
616
+ /** max_validators is the maximum number of validators. */
617
+ max_validators: number;
618
+ /** max_entries is the max entries for either unbonding delegation or redelegation (per pair/trio). */
619
+ max_entries: number;
620
+ /** historical_entries is the number of historical entries to persist. */
621
+ historical_entries: number;
622
+ /** bond_denom defines the bondable coin denomination. */
623
+ bond_denom: string;
624
+ /** min_commission_rate is the chain-wide minimum commission rate that a validator can charge their delegators */
625
+ min_commission_rate: string;
626
+ }
627
+ export interface ParamsAminoMsg {
628
+ type: "cosmos-sdk/x/staking/Params";
629
+ value: ParamsAmino;
630
+ }
631
+ /**
632
+ * DelegationResponse is equivalent to Delegation except that it contains a
633
+ * balance in addition to shares which is more suitable for client responses.
634
+ */
635
+ export interface DelegationResponse {
636
+ delegation: Delegation;
637
+ balance: Coin;
638
+ }
639
+ export interface DelegationResponseProtoMsg {
640
+ typeUrl: "/cosmos.staking.v1beta1.DelegationResponse";
641
+ value: Uint8Array;
642
+ }
643
+ /**
644
+ * DelegationResponse is equivalent to Delegation except that it contains a
645
+ * balance in addition to shares which is more suitable for client responses.
646
+ */
647
+ export interface DelegationResponseAmino {
648
+ delegation: DelegationAmino;
649
+ balance: CoinAmino;
650
+ }
651
+ export interface DelegationResponseAminoMsg {
652
+ type: "cosmos-sdk/DelegationResponse";
653
+ value: DelegationResponseAmino;
654
+ }
655
+ /**
656
+ * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it
657
+ * contains a balance in addition to shares which is more suitable for client
658
+ * responses.
659
+ */
660
+ export interface RedelegationEntryResponse {
661
+ redelegationEntry: RedelegationEntry;
662
+ balance: string;
663
+ }
664
+ export interface RedelegationEntryResponseProtoMsg {
665
+ typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse";
666
+ value: Uint8Array;
667
+ }
668
+ /**
669
+ * RedelegationEntryResponse is equivalent to a RedelegationEntry except that it
670
+ * contains a balance in addition to shares which is more suitable for client
671
+ * responses.
672
+ */
673
+ export interface RedelegationEntryResponseAmino {
674
+ redelegation_entry: RedelegationEntryAmino;
675
+ balance: string;
676
+ }
677
+ export interface RedelegationEntryResponseAminoMsg {
678
+ type: "cosmos-sdk/RedelegationEntryResponse";
679
+ value: RedelegationEntryResponseAmino;
680
+ }
681
+ /**
682
+ * RedelegationResponse is equivalent to a Redelegation except that its entries
683
+ * contain a balance in addition to shares which is more suitable for client
684
+ * responses.
685
+ */
686
+ export interface RedelegationResponse {
687
+ redelegation: Redelegation;
688
+ entries: RedelegationEntryResponse[];
689
+ }
690
+ export interface RedelegationResponseProtoMsg {
691
+ typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse";
692
+ value: Uint8Array;
693
+ }
694
+ /**
695
+ * RedelegationResponse is equivalent to a Redelegation except that its entries
696
+ * contain a balance in addition to shares which is more suitable for client
697
+ * responses.
698
+ */
699
+ export interface RedelegationResponseAmino {
700
+ redelegation: RedelegationAmino;
701
+ entries: RedelegationEntryResponseAmino[];
702
+ }
703
+ export interface RedelegationResponseAminoMsg {
704
+ type: "cosmos-sdk/RedelegationResponse";
705
+ value: RedelegationResponseAmino;
706
+ }
707
+ /**
708
+ * Pool is used for tracking bonded and not-bonded token supply of the bond
709
+ * denomination.
710
+ */
711
+ export interface Pool {
712
+ notBondedTokens: string;
713
+ bondedTokens: string;
714
+ }
715
+ export interface PoolProtoMsg {
716
+ typeUrl: "/cosmos.staking.v1beta1.Pool";
717
+ value: Uint8Array;
718
+ }
719
+ /**
720
+ * Pool is used for tracking bonded and not-bonded token supply of the bond
721
+ * denomination.
722
+ */
723
+ export interface PoolAmino {
724
+ not_bonded_tokens: string;
725
+ bonded_tokens: string;
726
+ }
727
+ export interface PoolAminoMsg {
728
+ type: "cosmos-sdk/Pool";
729
+ value: PoolAmino;
730
+ }
731
+ /**
732
+ * ValidatorUpdates defines an array of abci.ValidatorUpdate objects.
733
+ * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence
734
+ */
735
+ export interface ValidatorUpdates {
736
+ updates: ValidatorUpdate[];
737
+ }
738
+ export interface ValidatorUpdatesProtoMsg {
739
+ typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates";
740
+ value: Uint8Array;
741
+ }
742
+ /**
743
+ * ValidatorUpdates defines an array of abci.ValidatorUpdate objects.
744
+ * TODO: explore moving this to proto/cosmos/base to separate modules from tendermint dependence
745
+ */
746
+ export interface ValidatorUpdatesAmino {
747
+ updates: ValidatorUpdateAmino[];
748
+ }
749
+ export interface ValidatorUpdatesAminoMsg {
750
+ type: "cosmos-sdk/ValidatorUpdates";
751
+ value: ValidatorUpdatesAmino;
752
+ }
753
+ function createBaseHistoricalInfo(): HistoricalInfo {
754
+ return {
755
+ header: Header.fromPartial({}),
756
+ valset: []
757
+ };
758
+ }
759
+ export const HistoricalInfo = {
760
+ typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo",
761
+ aminoType: "cosmos-sdk/HistoricalInfo",
762
+ is(o: any): o is HistoricalInfo {
763
+ return o && (o.$typeUrl === HistoricalInfo.typeUrl || Header.is(o.header) && Array.isArray(o.valset) && (!o.valset.length || Validator.is(o.valset[0])));
764
+ },
765
+ isAmino(o: any): o is HistoricalInfoAmino {
766
+ return o && (o.$typeUrl === HistoricalInfo.typeUrl || Header.isAmino(o.header) && Array.isArray(o.valset) && (!o.valset.length || Validator.isAmino(o.valset[0])));
767
+ },
768
+ encode(message: HistoricalInfo, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
769
+ if (message.header !== undefined) {
770
+ Header.encode(message.header, writer.uint32(10).fork()).ldelim();
771
+ }
772
+ for (const v of message.valset) {
773
+ Validator.encode(v!, writer.uint32(18).fork()).ldelim();
774
+ }
775
+ return writer;
776
+ },
777
+ decode(input: BinaryReader | Uint8Array, length?: number): HistoricalInfo {
778
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
779
+ let end = length === undefined ? reader.len : reader.pos + length;
780
+ const message = createBaseHistoricalInfo();
781
+ while (reader.pos < end) {
782
+ const tag = reader.uint32();
783
+ switch (tag >>> 3) {
784
+ case 1:
785
+ message.header = Header.decode(reader, reader.uint32());
786
+ break;
787
+ case 2:
788
+ message.valset.push(Validator.decode(reader, reader.uint32()));
789
+ break;
790
+ default:
791
+ reader.skipType(tag & 7);
792
+ break;
793
+ }
794
+ }
795
+ return message;
796
+ },
797
+ fromPartial(object: DeepPartial<HistoricalInfo>): HistoricalInfo {
798
+ const message = createBaseHistoricalInfo();
799
+ message.header = object.header !== undefined && object.header !== null ? Header.fromPartial(object.header) : undefined;
800
+ message.valset = object.valset?.map(e => Validator.fromPartial(e)) || [];
801
+ return message;
802
+ },
803
+ fromAmino(object: HistoricalInfoAmino): HistoricalInfo {
804
+ const message = createBaseHistoricalInfo();
805
+ if (object.header !== undefined && object.header !== null) {
806
+ message.header = Header.fromAmino(object.header);
807
+ }
808
+ message.valset = object.valset?.map(e => Validator.fromAmino(e)) || [];
809
+ return message;
810
+ },
811
+ toAmino(message: HistoricalInfo): HistoricalInfoAmino {
812
+ const obj: any = {};
813
+ obj.header = message.header ? Header.toAmino(message.header) : Header.toAmino(Header.fromPartial({}));
814
+ if (message.valset) {
815
+ obj.valset = message.valset.map(e => e ? Validator.toAmino(e) : undefined);
816
+ } else {
817
+ obj.valset = message.valset;
818
+ }
819
+ return obj;
820
+ },
821
+ fromAminoMsg(object: HistoricalInfoAminoMsg): HistoricalInfo {
822
+ return HistoricalInfo.fromAmino(object.value);
823
+ },
824
+ toAminoMsg(message: HistoricalInfo): HistoricalInfoAminoMsg {
825
+ return {
826
+ type: "cosmos-sdk/HistoricalInfo",
827
+ value: HistoricalInfo.toAmino(message)
828
+ };
829
+ },
830
+ fromProtoMsg(message: HistoricalInfoProtoMsg): HistoricalInfo {
831
+ return HistoricalInfo.decode(message.value);
832
+ },
833
+ toProto(message: HistoricalInfo): Uint8Array {
834
+ return HistoricalInfo.encode(message).finish();
835
+ },
836
+ toProtoMsg(message: HistoricalInfo): HistoricalInfoProtoMsg {
837
+ return {
838
+ typeUrl: "/cosmos.staking.v1beta1.HistoricalInfo",
839
+ value: HistoricalInfo.encode(message).finish()
840
+ };
841
+ }
842
+ };
843
+ GlobalDecoderRegistry.register(HistoricalInfo.typeUrl, HistoricalInfo);
844
+ GlobalDecoderRegistry.registerAminoProtoMapping(HistoricalInfo.aminoType, HistoricalInfo.typeUrl);
845
+ function createBaseCommissionRates(): CommissionRates {
846
+ return {
847
+ rate: "",
848
+ maxRate: "",
849
+ maxChangeRate: ""
850
+ };
851
+ }
852
+ export const CommissionRates = {
853
+ typeUrl: "/cosmos.staking.v1beta1.CommissionRates",
854
+ aminoType: "cosmos-sdk/CommissionRates",
855
+ is(o: any): o is CommissionRates {
856
+ return o && (o.$typeUrl === CommissionRates.typeUrl || typeof o.rate === "string" && typeof o.maxRate === "string" && typeof o.maxChangeRate === "string");
857
+ },
858
+ isAmino(o: any): o is CommissionRatesAmino {
859
+ return o && (o.$typeUrl === CommissionRates.typeUrl || typeof o.rate === "string" && typeof o.max_rate === "string" && typeof o.max_change_rate === "string");
860
+ },
861
+ encode(message: CommissionRates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
862
+ if (message.rate !== "") {
863
+ writer.uint32(10).string(message.rate);
864
+ }
865
+ if (message.maxRate !== "") {
866
+ writer.uint32(18).string(message.maxRate);
867
+ }
868
+ if (message.maxChangeRate !== "") {
869
+ writer.uint32(26).string(message.maxChangeRate);
870
+ }
871
+ return writer;
872
+ },
873
+ decode(input: BinaryReader | Uint8Array, length?: number): CommissionRates {
874
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
875
+ let end = length === undefined ? reader.len : reader.pos + length;
876
+ const message = createBaseCommissionRates();
877
+ while (reader.pos < end) {
878
+ const tag = reader.uint32();
879
+ switch (tag >>> 3) {
880
+ case 1:
881
+ message.rate = reader.string();
882
+ break;
883
+ case 2:
884
+ message.maxRate = reader.string();
885
+ break;
886
+ case 3:
887
+ message.maxChangeRate = reader.string();
888
+ break;
889
+ default:
890
+ reader.skipType(tag & 7);
891
+ break;
892
+ }
893
+ }
894
+ return message;
895
+ },
896
+ fromPartial(object: DeepPartial<CommissionRates>): CommissionRates {
897
+ const message = createBaseCommissionRates();
898
+ message.rate = object.rate ?? "";
899
+ message.maxRate = object.maxRate ?? "";
900
+ message.maxChangeRate = object.maxChangeRate ?? "";
901
+ return message;
902
+ },
903
+ fromAmino(object: CommissionRatesAmino): CommissionRates {
904
+ const message = createBaseCommissionRates();
905
+ if (object.rate !== undefined && object.rate !== null) {
906
+ message.rate = object.rate;
907
+ }
908
+ if (object.max_rate !== undefined && object.max_rate !== null) {
909
+ message.maxRate = object.max_rate;
910
+ }
911
+ if (object.max_change_rate !== undefined && object.max_change_rate !== null) {
912
+ message.maxChangeRate = object.max_change_rate;
913
+ }
914
+ return message;
915
+ },
916
+ toAmino(message: CommissionRates): CommissionRatesAmino {
917
+ const obj: any = {};
918
+ obj.rate = message.rate ?? "";
919
+ obj.max_rate = message.maxRate ?? "";
920
+ obj.max_change_rate = message.maxChangeRate ?? "";
921
+ return obj;
922
+ },
923
+ fromAminoMsg(object: CommissionRatesAminoMsg): CommissionRates {
924
+ return CommissionRates.fromAmino(object.value);
925
+ },
926
+ toAminoMsg(message: CommissionRates): CommissionRatesAminoMsg {
927
+ return {
928
+ type: "cosmos-sdk/CommissionRates",
929
+ value: CommissionRates.toAmino(message)
930
+ };
931
+ },
932
+ fromProtoMsg(message: CommissionRatesProtoMsg): CommissionRates {
933
+ return CommissionRates.decode(message.value);
934
+ },
935
+ toProto(message: CommissionRates): Uint8Array {
936
+ return CommissionRates.encode(message).finish();
937
+ },
938
+ toProtoMsg(message: CommissionRates): CommissionRatesProtoMsg {
939
+ return {
940
+ typeUrl: "/cosmos.staking.v1beta1.CommissionRates",
941
+ value: CommissionRates.encode(message).finish()
942
+ };
943
+ }
944
+ };
945
+ GlobalDecoderRegistry.register(CommissionRates.typeUrl, CommissionRates);
946
+ GlobalDecoderRegistry.registerAminoProtoMapping(CommissionRates.aminoType, CommissionRates.typeUrl);
947
+ function createBaseCommission(): Commission {
948
+ return {
949
+ commissionRates: CommissionRates.fromPartial({}),
950
+ updateTime: new Date()
951
+ };
952
+ }
953
+ export const Commission = {
954
+ typeUrl: "/cosmos.staking.v1beta1.Commission",
955
+ aminoType: "cosmos-sdk/Commission",
956
+ is(o: any): o is Commission {
957
+ return o && (o.$typeUrl === Commission.typeUrl || CommissionRates.is(o.commissionRates) && Timestamp.is(o.updateTime));
958
+ },
959
+ isAmino(o: any): o is CommissionAmino {
960
+ return o && (o.$typeUrl === Commission.typeUrl || CommissionRates.isAmino(o.commission_rates) && Timestamp.isAmino(o.update_time));
961
+ },
962
+ encode(message: Commission, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
963
+ if (message.commissionRates !== undefined) {
964
+ CommissionRates.encode(message.commissionRates, writer.uint32(10).fork()).ldelim();
965
+ }
966
+ if (message.updateTime !== undefined) {
967
+ Timestamp.encode(toTimestamp(message.updateTime), writer.uint32(18).fork()).ldelim();
968
+ }
969
+ return writer;
970
+ },
971
+ decode(input: BinaryReader | Uint8Array, length?: number): Commission {
972
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
973
+ let end = length === undefined ? reader.len : reader.pos + length;
974
+ const message = createBaseCommission();
975
+ while (reader.pos < end) {
976
+ const tag = reader.uint32();
977
+ switch (tag >>> 3) {
978
+ case 1:
979
+ message.commissionRates = CommissionRates.decode(reader, reader.uint32());
980
+ break;
981
+ case 2:
982
+ message.updateTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
983
+ break;
984
+ default:
985
+ reader.skipType(tag & 7);
986
+ break;
987
+ }
988
+ }
989
+ return message;
990
+ },
991
+ fromPartial(object: DeepPartial<Commission>): Commission {
992
+ const message = createBaseCommission();
993
+ message.commissionRates = object.commissionRates !== undefined && object.commissionRates !== null ? CommissionRates.fromPartial(object.commissionRates) : undefined;
994
+ message.updateTime = object.updateTime ?? undefined;
995
+ return message;
996
+ },
997
+ fromAmino(object: CommissionAmino): Commission {
998
+ const message = createBaseCommission();
999
+ if (object.commission_rates !== undefined && object.commission_rates !== null) {
1000
+ message.commissionRates = CommissionRates.fromAmino(object.commission_rates);
1001
+ }
1002
+ if (object.update_time !== undefined && object.update_time !== null) {
1003
+ message.updateTime = fromTimestamp(Timestamp.fromAmino(object.update_time));
1004
+ }
1005
+ return message;
1006
+ },
1007
+ toAmino(message: Commission): CommissionAmino {
1008
+ const obj: any = {};
1009
+ obj.commission_rates = message.commissionRates ? CommissionRates.toAmino(message.commissionRates) : CommissionRates.toAmino(CommissionRates.fromPartial({}));
1010
+ obj.update_time = message.updateTime ? Timestamp.toAmino(toTimestamp(message.updateTime)) : new Date();
1011
+ return obj;
1012
+ },
1013
+ fromAminoMsg(object: CommissionAminoMsg): Commission {
1014
+ return Commission.fromAmino(object.value);
1015
+ },
1016
+ toAminoMsg(message: Commission): CommissionAminoMsg {
1017
+ return {
1018
+ type: "cosmos-sdk/Commission",
1019
+ value: Commission.toAmino(message)
1020
+ };
1021
+ },
1022
+ fromProtoMsg(message: CommissionProtoMsg): Commission {
1023
+ return Commission.decode(message.value);
1024
+ },
1025
+ toProto(message: Commission): Uint8Array {
1026
+ return Commission.encode(message).finish();
1027
+ },
1028
+ toProtoMsg(message: Commission): CommissionProtoMsg {
1029
+ return {
1030
+ typeUrl: "/cosmos.staking.v1beta1.Commission",
1031
+ value: Commission.encode(message).finish()
1032
+ };
1033
+ }
1034
+ };
1035
+ GlobalDecoderRegistry.register(Commission.typeUrl, Commission);
1036
+ GlobalDecoderRegistry.registerAminoProtoMapping(Commission.aminoType, Commission.typeUrl);
1037
+ function createBaseDescription(): Description {
1038
+ return {
1039
+ moniker: "",
1040
+ identity: "",
1041
+ website: "",
1042
+ securityContact: "",
1043
+ details: ""
1044
+ };
1045
+ }
1046
+ export const Description = {
1047
+ typeUrl: "/cosmos.staking.v1beta1.Description",
1048
+ aminoType: "cosmos-sdk/Description",
1049
+ is(o: any): o is Description {
1050
+ return o && (o.$typeUrl === Description.typeUrl || typeof o.moniker === "string" && typeof o.identity === "string" && typeof o.website === "string" && typeof o.securityContact === "string" && typeof o.details === "string");
1051
+ },
1052
+ isAmino(o: any): o is DescriptionAmino {
1053
+ return o && (o.$typeUrl === Description.typeUrl || typeof o.moniker === "string" && typeof o.identity === "string" && typeof o.website === "string" && typeof o.security_contact === "string" && typeof o.details === "string");
1054
+ },
1055
+ encode(message: Description, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
1056
+ if (message.moniker !== "") {
1057
+ writer.uint32(10).string(message.moniker);
1058
+ }
1059
+ if (message.identity !== "") {
1060
+ writer.uint32(18).string(message.identity);
1061
+ }
1062
+ if (message.website !== "") {
1063
+ writer.uint32(26).string(message.website);
1064
+ }
1065
+ if (message.securityContact !== "") {
1066
+ writer.uint32(34).string(message.securityContact);
1067
+ }
1068
+ if (message.details !== "") {
1069
+ writer.uint32(42).string(message.details);
1070
+ }
1071
+ return writer;
1072
+ },
1073
+ decode(input: BinaryReader | Uint8Array, length?: number): Description {
1074
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1075
+ let end = length === undefined ? reader.len : reader.pos + length;
1076
+ const message = createBaseDescription();
1077
+ while (reader.pos < end) {
1078
+ const tag = reader.uint32();
1079
+ switch (tag >>> 3) {
1080
+ case 1:
1081
+ message.moniker = reader.string();
1082
+ break;
1083
+ case 2:
1084
+ message.identity = reader.string();
1085
+ break;
1086
+ case 3:
1087
+ message.website = reader.string();
1088
+ break;
1089
+ case 4:
1090
+ message.securityContact = reader.string();
1091
+ break;
1092
+ case 5:
1093
+ message.details = reader.string();
1094
+ break;
1095
+ default:
1096
+ reader.skipType(tag & 7);
1097
+ break;
1098
+ }
1099
+ }
1100
+ return message;
1101
+ },
1102
+ fromPartial(object: DeepPartial<Description>): Description {
1103
+ const message = createBaseDescription();
1104
+ message.moniker = object.moniker ?? "";
1105
+ message.identity = object.identity ?? "";
1106
+ message.website = object.website ?? "";
1107
+ message.securityContact = object.securityContact ?? "";
1108
+ message.details = object.details ?? "";
1109
+ return message;
1110
+ },
1111
+ fromAmino(object: DescriptionAmino): Description {
1112
+ const message = createBaseDescription();
1113
+ if (object.moniker !== undefined && object.moniker !== null) {
1114
+ message.moniker = object.moniker;
1115
+ }
1116
+ if (object.identity !== undefined && object.identity !== null) {
1117
+ message.identity = object.identity;
1118
+ }
1119
+ if (object.website !== undefined && object.website !== null) {
1120
+ message.website = object.website;
1121
+ }
1122
+ if (object.security_contact !== undefined && object.security_contact !== null) {
1123
+ message.securityContact = object.security_contact;
1124
+ }
1125
+ if (object.details !== undefined && object.details !== null) {
1126
+ message.details = object.details;
1127
+ }
1128
+ return message;
1129
+ },
1130
+ toAmino(message: Description): DescriptionAmino {
1131
+ const obj: any = {};
1132
+ obj.moniker = message.moniker === "" ? undefined : message.moniker;
1133
+ obj.identity = message.identity === "" ? undefined : message.identity;
1134
+ obj.website = message.website === "" ? undefined : message.website;
1135
+ obj.security_contact = message.securityContact === "" ? undefined : message.securityContact;
1136
+ obj.details = message.details === "" ? undefined : message.details;
1137
+ return obj;
1138
+ },
1139
+ fromAminoMsg(object: DescriptionAminoMsg): Description {
1140
+ return Description.fromAmino(object.value);
1141
+ },
1142
+ toAminoMsg(message: Description): DescriptionAminoMsg {
1143
+ return {
1144
+ type: "cosmos-sdk/Description",
1145
+ value: Description.toAmino(message)
1146
+ };
1147
+ },
1148
+ fromProtoMsg(message: DescriptionProtoMsg): Description {
1149
+ return Description.decode(message.value);
1150
+ },
1151
+ toProto(message: Description): Uint8Array {
1152
+ return Description.encode(message).finish();
1153
+ },
1154
+ toProtoMsg(message: Description): DescriptionProtoMsg {
1155
+ return {
1156
+ typeUrl: "/cosmos.staking.v1beta1.Description",
1157
+ value: Description.encode(message).finish()
1158
+ };
1159
+ }
1160
+ };
1161
+ GlobalDecoderRegistry.register(Description.typeUrl, Description);
1162
+ GlobalDecoderRegistry.registerAminoProtoMapping(Description.aminoType, Description.typeUrl);
1163
+ function createBaseValidator(): Validator {
1164
+ return {
1165
+ operatorAddress: "",
1166
+ consensusPubkey: undefined,
1167
+ jailed: false,
1168
+ status: 0,
1169
+ tokens: "",
1170
+ delegatorShares: "",
1171
+ description: Description.fromPartial({}),
1172
+ unbondingHeight: BigInt(0),
1173
+ unbondingTime: new Date(),
1174
+ commission: Commission.fromPartial({}),
1175
+ minSelfDelegation: "",
1176
+ unbondingOnHoldRefCount: BigInt(0),
1177
+ unbondingIds: []
1178
+ };
1179
+ }
1180
+ export const Validator = {
1181
+ typeUrl: "/cosmos.staking.v1beta1.Validator",
1182
+ aminoType: "cosmos-sdk/Validator",
1183
+ is(o: any): o is Validator {
1184
+ return o && (o.$typeUrl === Validator.typeUrl || typeof o.operatorAddress === "string" && typeof o.jailed === "boolean" && isSet(o.status) && typeof o.tokens === "string" && typeof o.delegatorShares === "string" && Description.is(o.description) && typeof o.unbondingHeight === "bigint" && Timestamp.is(o.unbondingTime) && Commission.is(o.commission) && typeof o.minSelfDelegation === "string" && typeof o.unbondingOnHoldRefCount === "bigint" && Array.isArray(o.unbondingIds) && (!o.unbondingIds.length || typeof o.unbondingIds[0] === "bigint"));
1185
+ },
1186
+ isAmino(o: any): o is ValidatorAmino {
1187
+ return o && (o.$typeUrl === Validator.typeUrl || typeof o.operator_address === "string" && typeof o.jailed === "boolean" && isSet(o.status) && typeof o.tokens === "string" && typeof o.delegator_shares === "string" && Description.isAmino(o.description) && typeof o.unbonding_height === "bigint" && Timestamp.isAmino(o.unbonding_time) && Commission.isAmino(o.commission) && typeof o.min_self_delegation === "string" && typeof o.unbonding_on_hold_ref_count === "bigint" && Array.isArray(o.unbonding_ids) && (!o.unbonding_ids.length || typeof o.unbonding_ids[0] === "bigint"));
1188
+ },
1189
+ encode(message: Validator, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
1190
+ if (message.operatorAddress !== "") {
1191
+ writer.uint32(10).string(message.operatorAddress);
1192
+ }
1193
+ if (message.consensusPubkey !== undefined) {
1194
+ Any.encode(GlobalDecoderRegistry.wrapAny(message.consensusPubkey), writer.uint32(18).fork()).ldelim();
1195
+ }
1196
+ if (message.jailed === true) {
1197
+ writer.uint32(24).bool(message.jailed);
1198
+ }
1199
+ if (message.status !== 0) {
1200
+ writer.uint32(32).int32(message.status);
1201
+ }
1202
+ if (message.tokens !== "") {
1203
+ writer.uint32(42).string(message.tokens);
1204
+ }
1205
+ if (message.delegatorShares !== "") {
1206
+ writer.uint32(50).string(message.delegatorShares);
1207
+ }
1208
+ if (message.description !== undefined) {
1209
+ Description.encode(message.description, writer.uint32(58).fork()).ldelim();
1210
+ }
1211
+ if (message.unbondingHeight !== BigInt(0)) {
1212
+ writer.uint32(64).int64(message.unbondingHeight);
1213
+ }
1214
+ if (message.unbondingTime !== undefined) {
1215
+ Timestamp.encode(toTimestamp(message.unbondingTime), writer.uint32(74).fork()).ldelim();
1216
+ }
1217
+ if (message.commission !== undefined) {
1218
+ Commission.encode(message.commission, writer.uint32(82).fork()).ldelim();
1219
+ }
1220
+ if (message.minSelfDelegation !== "") {
1221
+ writer.uint32(90).string(message.minSelfDelegation);
1222
+ }
1223
+ if (message.unbondingOnHoldRefCount !== BigInt(0)) {
1224
+ writer.uint32(96).int64(message.unbondingOnHoldRefCount);
1225
+ }
1226
+ writer.uint32(106).fork();
1227
+ for (const v of message.unbondingIds) {
1228
+ writer.uint64(v);
1229
+ }
1230
+ writer.ldelim();
1231
+ return writer;
1232
+ },
1233
+ decode(input: BinaryReader | Uint8Array, length?: number): Validator {
1234
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1235
+ let end = length === undefined ? reader.len : reader.pos + length;
1236
+ const message = createBaseValidator();
1237
+ while (reader.pos < end) {
1238
+ const tag = reader.uint32();
1239
+ switch (tag >>> 3) {
1240
+ case 1:
1241
+ message.operatorAddress = reader.string();
1242
+ break;
1243
+ case 2:
1244
+ message.consensusPubkey = GlobalDecoderRegistry.unwrapAny(reader);
1245
+ break;
1246
+ case 3:
1247
+ message.jailed = reader.bool();
1248
+ break;
1249
+ case 4:
1250
+ message.status = reader.int32() as any;
1251
+ break;
1252
+ case 5:
1253
+ message.tokens = reader.string();
1254
+ break;
1255
+ case 6:
1256
+ message.delegatorShares = reader.string();
1257
+ break;
1258
+ case 7:
1259
+ message.description = Description.decode(reader, reader.uint32());
1260
+ break;
1261
+ case 8:
1262
+ message.unbondingHeight = reader.int64();
1263
+ break;
1264
+ case 9:
1265
+ message.unbondingTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1266
+ break;
1267
+ case 10:
1268
+ message.commission = Commission.decode(reader, reader.uint32());
1269
+ break;
1270
+ case 11:
1271
+ message.minSelfDelegation = reader.string();
1272
+ break;
1273
+ case 12:
1274
+ message.unbondingOnHoldRefCount = reader.int64();
1275
+ break;
1276
+ case 13:
1277
+ if ((tag & 7) === 2) {
1278
+ const end2 = reader.uint32() + reader.pos;
1279
+ while (reader.pos < end2) {
1280
+ message.unbondingIds.push(reader.uint64());
1281
+ }
1282
+ } else {
1283
+ message.unbondingIds.push(reader.uint64());
1284
+ }
1285
+ break;
1286
+ default:
1287
+ reader.skipType(tag & 7);
1288
+ break;
1289
+ }
1290
+ }
1291
+ return message;
1292
+ },
1293
+ fromPartial(object: DeepPartial<Validator>): Validator {
1294
+ const message = createBaseValidator();
1295
+ message.operatorAddress = object.operatorAddress ?? "";
1296
+ message.consensusPubkey = object.consensusPubkey !== undefined && object.consensusPubkey !== null ? GlobalDecoderRegistry.fromPartial(object.consensusPubkey) : undefined;
1297
+ message.jailed = object.jailed ?? false;
1298
+ message.status = object.status ?? 0;
1299
+ message.tokens = object.tokens ?? "";
1300
+ message.delegatorShares = object.delegatorShares ?? "";
1301
+ message.description = object.description !== undefined && object.description !== null ? Description.fromPartial(object.description) : undefined;
1302
+ message.unbondingHeight = object.unbondingHeight !== undefined && object.unbondingHeight !== null ? BigInt(object.unbondingHeight.toString()) : BigInt(0);
1303
+ message.unbondingTime = object.unbondingTime ?? undefined;
1304
+ message.commission = object.commission !== undefined && object.commission !== null ? Commission.fromPartial(object.commission) : undefined;
1305
+ message.minSelfDelegation = object.minSelfDelegation ?? "";
1306
+ message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0);
1307
+ message.unbondingIds = object.unbondingIds?.map(e => BigInt(e.toString())) || [];
1308
+ return message;
1309
+ },
1310
+ fromAmino(object: ValidatorAmino): Validator {
1311
+ const message = createBaseValidator();
1312
+ if (object.operator_address !== undefined && object.operator_address !== null) {
1313
+ message.operatorAddress = object.operator_address;
1314
+ }
1315
+ if (object.consensus_pubkey !== undefined && object.consensus_pubkey !== null) {
1316
+ message.consensusPubkey = encodePubkey(object.consensus_pubkey);
1317
+ }
1318
+ if (object.jailed !== undefined && object.jailed !== null) {
1319
+ message.jailed = object.jailed;
1320
+ }
1321
+ if (object.status !== undefined && object.status !== null) {
1322
+ message.status = object.status;
1323
+ }
1324
+ if (object.tokens !== undefined && object.tokens !== null) {
1325
+ message.tokens = object.tokens;
1326
+ }
1327
+ if (object.delegator_shares !== undefined && object.delegator_shares !== null) {
1328
+ message.delegatorShares = object.delegator_shares;
1329
+ }
1330
+ if (object.description !== undefined && object.description !== null) {
1331
+ message.description = Description.fromAmino(object.description);
1332
+ }
1333
+ if (object.unbonding_height !== undefined && object.unbonding_height !== null) {
1334
+ message.unbondingHeight = BigInt(object.unbonding_height);
1335
+ }
1336
+ if (object.unbonding_time !== undefined && object.unbonding_time !== null) {
1337
+ message.unbondingTime = fromTimestamp(Timestamp.fromAmino(object.unbonding_time));
1338
+ }
1339
+ if (object.commission !== undefined && object.commission !== null) {
1340
+ message.commission = Commission.fromAmino(object.commission);
1341
+ }
1342
+ if (object.min_self_delegation !== undefined && object.min_self_delegation !== null) {
1343
+ message.minSelfDelegation = object.min_self_delegation;
1344
+ }
1345
+ if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) {
1346
+ message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count);
1347
+ }
1348
+ message.unbondingIds = object.unbonding_ids?.map(e => BigInt(e)) || [];
1349
+ return message;
1350
+ },
1351
+ toAmino(message: Validator): ValidatorAmino {
1352
+ const obj: any = {};
1353
+ obj.operator_address = message.operatorAddress === "" ? undefined : message.operatorAddress;
1354
+ obj.consensus_pubkey = message.consensusPubkey ? decodePubkey(message.consensusPubkey) : undefined;
1355
+ obj.jailed = message.jailed === false ? undefined : message.jailed;
1356
+ obj.status = message.status === 0 ? undefined : message.status;
1357
+ obj.tokens = message.tokens === "" ? undefined : message.tokens;
1358
+ obj.delegator_shares = message.delegatorShares === "" ? undefined : message.delegatorShares;
1359
+ obj.description = message.description ? Description.toAmino(message.description) : Description.toAmino(Description.fromPartial({}));
1360
+ obj.unbonding_height = message.unbondingHeight !== BigInt(0) ? message.unbondingHeight?.toString() : undefined;
1361
+ obj.unbonding_time = message.unbondingTime ? Timestamp.toAmino(toTimestamp(message.unbondingTime)) : new Date();
1362
+ obj.commission = message.commission ? Commission.toAmino(message.commission) : Commission.toAmino(Commission.fromPartial({}));
1363
+ obj.min_self_delegation = message.minSelfDelegation === "" ? undefined : message.minSelfDelegation;
1364
+ obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount !== BigInt(0) ? message.unbondingOnHoldRefCount?.toString() : undefined;
1365
+ if (message.unbondingIds) {
1366
+ obj.unbonding_ids = message.unbondingIds.map(e => e.toString());
1367
+ } else {
1368
+ obj.unbonding_ids = message.unbondingIds;
1369
+ }
1370
+ return obj;
1371
+ },
1372
+ fromAminoMsg(object: ValidatorAminoMsg): Validator {
1373
+ return Validator.fromAmino(object.value);
1374
+ },
1375
+ toAminoMsg(message: Validator): ValidatorAminoMsg {
1376
+ return {
1377
+ type: "cosmos-sdk/Validator",
1378
+ value: Validator.toAmino(message)
1379
+ };
1380
+ },
1381
+ fromProtoMsg(message: ValidatorProtoMsg): Validator {
1382
+ return Validator.decode(message.value);
1383
+ },
1384
+ toProto(message: Validator): Uint8Array {
1385
+ return Validator.encode(message).finish();
1386
+ },
1387
+ toProtoMsg(message: Validator): ValidatorProtoMsg {
1388
+ return {
1389
+ typeUrl: "/cosmos.staking.v1beta1.Validator",
1390
+ value: Validator.encode(message).finish()
1391
+ };
1392
+ }
1393
+ };
1394
+ GlobalDecoderRegistry.register(Validator.typeUrl, Validator);
1395
+ GlobalDecoderRegistry.registerAminoProtoMapping(Validator.aminoType, Validator.typeUrl);
1396
+ function createBaseValAddresses(): ValAddresses {
1397
+ return {
1398
+ addresses: []
1399
+ };
1400
+ }
1401
+ export const ValAddresses = {
1402
+ typeUrl: "/cosmos.staking.v1beta1.ValAddresses",
1403
+ aminoType: "cosmos-sdk/ValAddresses",
1404
+ is(o: any): o is ValAddresses {
1405
+ return o && (o.$typeUrl === ValAddresses.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string"));
1406
+ },
1407
+ isAmino(o: any): o is ValAddressesAmino {
1408
+ return o && (o.$typeUrl === ValAddresses.typeUrl || Array.isArray(o.addresses) && (!o.addresses.length || typeof o.addresses[0] === "string"));
1409
+ },
1410
+ encode(message: ValAddresses, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
1411
+ for (const v of message.addresses) {
1412
+ writer.uint32(10).string(v!);
1413
+ }
1414
+ return writer;
1415
+ },
1416
+ decode(input: BinaryReader | Uint8Array, length?: number): ValAddresses {
1417
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1418
+ let end = length === undefined ? reader.len : reader.pos + length;
1419
+ const message = createBaseValAddresses();
1420
+ while (reader.pos < end) {
1421
+ const tag = reader.uint32();
1422
+ switch (tag >>> 3) {
1423
+ case 1:
1424
+ message.addresses.push(reader.string());
1425
+ break;
1426
+ default:
1427
+ reader.skipType(tag & 7);
1428
+ break;
1429
+ }
1430
+ }
1431
+ return message;
1432
+ },
1433
+ fromPartial(object: DeepPartial<ValAddresses>): ValAddresses {
1434
+ const message = createBaseValAddresses();
1435
+ message.addresses = object.addresses?.map(e => e) || [];
1436
+ return message;
1437
+ },
1438
+ fromAmino(object: ValAddressesAmino): ValAddresses {
1439
+ const message = createBaseValAddresses();
1440
+ message.addresses = object.addresses?.map(e => e) || [];
1441
+ return message;
1442
+ },
1443
+ toAmino(message: ValAddresses): ValAddressesAmino {
1444
+ const obj: any = {};
1445
+ if (message.addresses) {
1446
+ obj.addresses = message.addresses.map(e => e);
1447
+ } else {
1448
+ obj.addresses = message.addresses;
1449
+ }
1450
+ return obj;
1451
+ },
1452
+ fromAminoMsg(object: ValAddressesAminoMsg): ValAddresses {
1453
+ return ValAddresses.fromAmino(object.value);
1454
+ },
1455
+ toAminoMsg(message: ValAddresses): ValAddressesAminoMsg {
1456
+ return {
1457
+ type: "cosmos-sdk/ValAddresses",
1458
+ value: ValAddresses.toAmino(message)
1459
+ };
1460
+ },
1461
+ fromProtoMsg(message: ValAddressesProtoMsg): ValAddresses {
1462
+ return ValAddresses.decode(message.value);
1463
+ },
1464
+ toProto(message: ValAddresses): Uint8Array {
1465
+ return ValAddresses.encode(message).finish();
1466
+ },
1467
+ toProtoMsg(message: ValAddresses): ValAddressesProtoMsg {
1468
+ return {
1469
+ typeUrl: "/cosmos.staking.v1beta1.ValAddresses",
1470
+ value: ValAddresses.encode(message).finish()
1471
+ };
1472
+ }
1473
+ };
1474
+ GlobalDecoderRegistry.register(ValAddresses.typeUrl, ValAddresses);
1475
+ GlobalDecoderRegistry.registerAminoProtoMapping(ValAddresses.aminoType, ValAddresses.typeUrl);
1476
+ function createBaseDVPair(): DVPair {
1477
+ return {
1478
+ delegatorAddress: "",
1479
+ validatorAddress: ""
1480
+ };
1481
+ }
1482
+ export const DVPair = {
1483
+ typeUrl: "/cosmos.staking.v1beta1.DVPair",
1484
+ aminoType: "cosmos-sdk/DVPair",
1485
+ is(o: any): o is DVPair {
1486
+ return o && (o.$typeUrl === DVPair.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string");
1487
+ },
1488
+ isAmino(o: any): o is DVPairAmino {
1489
+ return o && (o.$typeUrl === DVPair.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string");
1490
+ },
1491
+ encode(message: DVPair, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
1492
+ if (message.delegatorAddress !== "") {
1493
+ writer.uint32(10).string(message.delegatorAddress);
1494
+ }
1495
+ if (message.validatorAddress !== "") {
1496
+ writer.uint32(18).string(message.validatorAddress);
1497
+ }
1498
+ return writer;
1499
+ },
1500
+ decode(input: BinaryReader | Uint8Array, length?: number): DVPair {
1501
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1502
+ let end = length === undefined ? reader.len : reader.pos + length;
1503
+ const message = createBaseDVPair();
1504
+ while (reader.pos < end) {
1505
+ const tag = reader.uint32();
1506
+ switch (tag >>> 3) {
1507
+ case 1:
1508
+ message.delegatorAddress = reader.string();
1509
+ break;
1510
+ case 2:
1511
+ message.validatorAddress = reader.string();
1512
+ break;
1513
+ default:
1514
+ reader.skipType(tag & 7);
1515
+ break;
1516
+ }
1517
+ }
1518
+ return message;
1519
+ },
1520
+ fromPartial(object: DeepPartial<DVPair>): DVPair {
1521
+ const message = createBaseDVPair();
1522
+ message.delegatorAddress = object.delegatorAddress ?? "";
1523
+ message.validatorAddress = object.validatorAddress ?? "";
1524
+ return message;
1525
+ },
1526
+ fromAmino(object: DVPairAmino): DVPair {
1527
+ const message = createBaseDVPair();
1528
+ if (object.delegator_address !== undefined && object.delegator_address !== null) {
1529
+ message.delegatorAddress = object.delegator_address;
1530
+ }
1531
+ if (object.validator_address !== undefined && object.validator_address !== null) {
1532
+ message.validatorAddress = object.validator_address;
1533
+ }
1534
+ return message;
1535
+ },
1536
+ toAmino(message: DVPair): DVPairAmino {
1537
+ const obj: any = {};
1538
+ obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress;
1539
+ obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress;
1540
+ return obj;
1541
+ },
1542
+ fromAminoMsg(object: DVPairAminoMsg): DVPair {
1543
+ return DVPair.fromAmino(object.value);
1544
+ },
1545
+ toAminoMsg(message: DVPair): DVPairAminoMsg {
1546
+ return {
1547
+ type: "cosmos-sdk/DVPair",
1548
+ value: DVPair.toAmino(message)
1549
+ };
1550
+ },
1551
+ fromProtoMsg(message: DVPairProtoMsg): DVPair {
1552
+ return DVPair.decode(message.value);
1553
+ },
1554
+ toProto(message: DVPair): Uint8Array {
1555
+ return DVPair.encode(message).finish();
1556
+ },
1557
+ toProtoMsg(message: DVPair): DVPairProtoMsg {
1558
+ return {
1559
+ typeUrl: "/cosmos.staking.v1beta1.DVPair",
1560
+ value: DVPair.encode(message).finish()
1561
+ };
1562
+ }
1563
+ };
1564
+ GlobalDecoderRegistry.register(DVPair.typeUrl, DVPair);
1565
+ GlobalDecoderRegistry.registerAminoProtoMapping(DVPair.aminoType, DVPair.typeUrl);
1566
+ function createBaseDVPairs(): DVPairs {
1567
+ return {
1568
+ pairs: []
1569
+ };
1570
+ }
1571
+ export const DVPairs = {
1572
+ typeUrl: "/cosmos.staking.v1beta1.DVPairs",
1573
+ aminoType: "cosmos-sdk/DVPairs",
1574
+ is(o: any): o is DVPairs {
1575
+ return o && (o.$typeUrl === DVPairs.typeUrl || Array.isArray(o.pairs) && (!o.pairs.length || DVPair.is(o.pairs[0])));
1576
+ },
1577
+ isAmino(o: any): o is DVPairsAmino {
1578
+ return o && (o.$typeUrl === DVPairs.typeUrl || Array.isArray(o.pairs) && (!o.pairs.length || DVPair.isAmino(o.pairs[0])));
1579
+ },
1580
+ encode(message: DVPairs, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
1581
+ for (const v of message.pairs) {
1582
+ DVPair.encode(v!, writer.uint32(10).fork()).ldelim();
1583
+ }
1584
+ return writer;
1585
+ },
1586
+ decode(input: BinaryReader | Uint8Array, length?: number): DVPairs {
1587
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1588
+ let end = length === undefined ? reader.len : reader.pos + length;
1589
+ const message = createBaseDVPairs();
1590
+ while (reader.pos < end) {
1591
+ const tag = reader.uint32();
1592
+ switch (tag >>> 3) {
1593
+ case 1:
1594
+ message.pairs.push(DVPair.decode(reader, reader.uint32()));
1595
+ break;
1596
+ default:
1597
+ reader.skipType(tag & 7);
1598
+ break;
1599
+ }
1600
+ }
1601
+ return message;
1602
+ },
1603
+ fromPartial(object: DeepPartial<DVPairs>): DVPairs {
1604
+ const message = createBaseDVPairs();
1605
+ message.pairs = object.pairs?.map(e => DVPair.fromPartial(e)) || [];
1606
+ return message;
1607
+ },
1608
+ fromAmino(object: DVPairsAmino): DVPairs {
1609
+ const message = createBaseDVPairs();
1610
+ message.pairs = object.pairs?.map(e => DVPair.fromAmino(e)) || [];
1611
+ return message;
1612
+ },
1613
+ toAmino(message: DVPairs): DVPairsAmino {
1614
+ const obj: any = {};
1615
+ if (message.pairs) {
1616
+ obj.pairs = message.pairs.map(e => e ? DVPair.toAmino(e) : undefined);
1617
+ } else {
1618
+ obj.pairs = message.pairs;
1619
+ }
1620
+ return obj;
1621
+ },
1622
+ fromAminoMsg(object: DVPairsAminoMsg): DVPairs {
1623
+ return DVPairs.fromAmino(object.value);
1624
+ },
1625
+ toAminoMsg(message: DVPairs): DVPairsAminoMsg {
1626
+ return {
1627
+ type: "cosmos-sdk/DVPairs",
1628
+ value: DVPairs.toAmino(message)
1629
+ };
1630
+ },
1631
+ fromProtoMsg(message: DVPairsProtoMsg): DVPairs {
1632
+ return DVPairs.decode(message.value);
1633
+ },
1634
+ toProto(message: DVPairs): Uint8Array {
1635
+ return DVPairs.encode(message).finish();
1636
+ },
1637
+ toProtoMsg(message: DVPairs): DVPairsProtoMsg {
1638
+ return {
1639
+ typeUrl: "/cosmos.staking.v1beta1.DVPairs",
1640
+ value: DVPairs.encode(message).finish()
1641
+ };
1642
+ }
1643
+ };
1644
+ GlobalDecoderRegistry.register(DVPairs.typeUrl, DVPairs);
1645
+ GlobalDecoderRegistry.registerAminoProtoMapping(DVPairs.aminoType, DVPairs.typeUrl);
1646
+ function createBaseDVVTriplet(): DVVTriplet {
1647
+ return {
1648
+ delegatorAddress: "",
1649
+ validatorSrcAddress: "",
1650
+ validatorDstAddress: ""
1651
+ };
1652
+ }
1653
+ export const DVVTriplet = {
1654
+ typeUrl: "/cosmos.staking.v1beta1.DVVTriplet",
1655
+ aminoType: "cosmos-sdk/DVVTriplet",
1656
+ is(o: any): o is DVVTriplet {
1657
+ return o && (o.$typeUrl === DVVTriplet.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string");
1658
+ },
1659
+ isAmino(o: any): o is DVVTripletAmino {
1660
+ return o && (o.$typeUrl === DVVTriplet.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string");
1661
+ },
1662
+ encode(message: DVVTriplet, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
1663
+ if (message.delegatorAddress !== "") {
1664
+ writer.uint32(10).string(message.delegatorAddress);
1665
+ }
1666
+ if (message.validatorSrcAddress !== "") {
1667
+ writer.uint32(18).string(message.validatorSrcAddress);
1668
+ }
1669
+ if (message.validatorDstAddress !== "") {
1670
+ writer.uint32(26).string(message.validatorDstAddress);
1671
+ }
1672
+ return writer;
1673
+ },
1674
+ decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplet {
1675
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1676
+ let end = length === undefined ? reader.len : reader.pos + length;
1677
+ const message = createBaseDVVTriplet();
1678
+ while (reader.pos < end) {
1679
+ const tag = reader.uint32();
1680
+ switch (tag >>> 3) {
1681
+ case 1:
1682
+ message.delegatorAddress = reader.string();
1683
+ break;
1684
+ case 2:
1685
+ message.validatorSrcAddress = reader.string();
1686
+ break;
1687
+ case 3:
1688
+ message.validatorDstAddress = reader.string();
1689
+ break;
1690
+ default:
1691
+ reader.skipType(tag & 7);
1692
+ break;
1693
+ }
1694
+ }
1695
+ return message;
1696
+ },
1697
+ fromPartial(object: DeepPartial<DVVTriplet>): DVVTriplet {
1698
+ const message = createBaseDVVTriplet();
1699
+ message.delegatorAddress = object.delegatorAddress ?? "";
1700
+ message.validatorSrcAddress = object.validatorSrcAddress ?? "";
1701
+ message.validatorDstAddress = object.validatorDstAddress ?? "";
1702
+ return message;
1703
+ },
1704
+ fromAmino(object: DVVTripletAmino): DVVTriplet {
1705
+ const message = createBaseDVVTriplet();
1706
+ if (object.delegator_address !== undefined && object.delegator_address !== null) {
1707
+ message.delegatorAddress = object.delegator_address;
1708
+ }
1709
+ if (object.validator_src_address !== undefined && object.validator_src_address !== null) {
1710
+ message.validatorSrcAddress = object.validator_src_address;
1711
+ }
1712
+ if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) {
1713
+ message.validatorDstAddress = object.validator_dst_address;
1714
+ }
1715
+ return message;
1716
+ },
1717
+ toAmino(message: DVVTriplet): DVVTripletAmino {
1718
+ const obj: any = {};
1719
+ obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress;
1720
+ obj.validator_src_address = message.validatorSrcAddress === "" ? undefined : message.validatorSrcAddress;
1721
+ obj.validator_dst_address = message.validatorDstAddress === "" ? undefined : message.validatorDstAddress;
1722
+ return obj;
1723
+ },
1724
+ fromAminoMsg(object: DVVTripletAminoMsg): DVVTriplet {
1725
+ return DVVTriplet.fromAmino(object.value);
1726
+ },
1727
+ toAminoMsg(message: DVVTriplet): DVVTripletAminoMsg {
1728
+ return {
1729
+ type: "cosmos-sdk/DVVTriplet",
1730
+ value: DVVTriplet.toAmino(message)
1731
+ };
1732
+ },
1733
+ fromProtoMsg(message: DVVTripletProtoMsg): DVVTriplet {
1734
+ return DVVTriplet.decode(message.value);
1735
+ },
1736
+ toProto(message: DVVTriplet): Uint8Array {
1737
+ return DVVTriplet.encode(message).finish();
1738
+ },
1739
+ toProtoMsg(message: DVVTriplet): DVVTripletProtoMsg {
1740
+ return {
1741
+ typeUrl: "/cosmos.staking.v1beta1.DVVTriplet",
1742
+ value: DVVTriplet.encode(message).finish()
1743
+ };
1744
+ }
1745
+ };
1746
+ GlobalDecoderRegistry.register(DVVTriplet.typeUrl, DVVTriplet);
1747
+ GlobalDecoderRegistry.registerAminoProtoMapping(DVVTriplet.aminoType, DVVTriplet.typeUrl);
1748
+ function createBaseDVVTriplets(): DVVTriplets {
1749
+ return {
1750
+ triplets: []
1751
+ };
1752
+ }
1753
+ export const DVVTriplets = {
1754
+ typeUrl: "/cosmos.staking.v1beta1.DVVTriplets",
1755
+ aminoType: "cosmos-sdk/DVVTriplets",
1756
+ is(o: any): o is DVVTriplets {
1757
+ return o && (o.$typeUrl === DVVTriplets.typeUrl || Array.isArray(o.triplets) && (!o.triplets.length || DVVTriplet.is(o.triplets[0])));
1758
+ },
1759
+ isAmino(o: any): o is DVVTripletsAmino {
1760
+ return o && (o.$typeUrl === DVVTriplets.typeUrl || Array.isArray(o.triplets) && (!o.triplets.length || DVVTriplet.isAmino(o.triplets[0])));
1761
+ },
1762
+ encode(message: DVVTriplets, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
1763
+ for (const v of message.triplets) {
1764
+ DVVTriplet.encode(v!, writer.uint32(10).fork()).ldelim();
1765
+ }
1766
+ return writer;
1767
+ },
1768
+ decode(input: BinaryReader | Uint8Array, length?: number): DVVTriplets {
1769
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1770
+ let end = length === undefined ? reader.len : reader.pos + length;
1771
+ const message = createBaseDVVTriplets();
1772
+ while (reader.pos < end) {
1773
+ const tag = reader.uint32();
1774
+ switch (tag >>> 3) {
1775
+ case 1:
1776
+ message.triplets.push(DVVTriplet.decode(reader, reader.uint32()));
1777
+ break;
1778
+ default:
1779
+ reader.skipType(tag & 7);
1780
+ break;
1781
+ }
1782
+ }
1783
+ return message;
1784
+ },
1785
+ fromPartial(object: DeepPartial<DVVTriplets>): DVVTriplets {
1786
+ const message = createBaseDVVTriplets();
1787
+ message.triplets = object.triplets?.map(e => DVVTriplet.fromPartial(e)) || [];
1788
+ return message;
1789
+ },
1790
+ fromAmino(object: DVVTripletsAmino): DVVTriplets {
1791
+ const message = createBaseDVVTriplets();
1792
+ message.triplets = object.triplets?.map(e => DVVTriplet.fromAmino(e)) || [];
1793
+ return message;
1794
+ },
1795
+ toAmino(message: DVVTriplets): DVVTripletsAmino {
1796
+ const obj: any = {};
1797
+ if (message.triplets) {
1798
+ obj.triplets = message.triplets.map(e => e ? DVVTriplet.toAmino(e) : undefined);
1799
+ } else {
1800
+ obj.triplets = message.triplets;
1801
+ }
1802
+ return obj;
1803
+ },
1804
+ fromAminoMsg(object: DVVTripletsAminoMsg): DVVTriplets {
1805
+ return DVVTriplets.fromAmino(object.value);
1806
+ },
1807
+ toAminoMsg(message: DVVTriplets): DVVTripletsAminoMsg {
1808
+ return {
1809
+ type: "cosmos-sdk/DVVTriplets",
1810
+ value: DVVTriplets.toAmino(message)
1811
+ };
1812
+ },
1813
+ fromProtoMsg(message: DVVTripletsProtoMsg): DVVTriplets {
1814
+ return DVVTriplets.decode(message.value);
1815
+ },
1816
+ toProto(message: DVVTriplets): Uint8Array {
1817
+ return DVVTriplets.encode(message).finish();
1818
+ },
1819
+ toProtoMsg(message: DVVTriplets): DVVTripletsProtoMsg {
1820
+ return {
1821
+ typeUrl: "/cosmos.staking.v1beta1.DVVTriplets",
1822
+ value: DVVTriplets.encode(message).finish()
1823
+ };
1824
+ }
1825
+ };
1826
+ GlobalDecoderRegistry.register(DVVTriplets.typeUrl, DVVTriplets);
1827
+ GlobalDecoderRegistry.registerAminoProtoMapping(DVVTriplets.aminoType, DVVTriplets.typeUrl);
1828
+ function createBaseDelegation(): Delegation {
1829
+ return {
1830
+ delegatorAddress: "",
1831
+ validatorAddress: "",
1832
+ shares: ""
1833
+ };
1834
+ }
1835
+ export const Delegation = {
1836
+ typeUrl: "/cosmos.staking.v1beta1.Delegation",
1837
+ aminoType: "cosmos-sdk/Delegation",
1838
+ is(o: any): o is Delegation {
1839
+ return o && (o.$typeUrl === Delegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && typeof o.shares === "string");
1840
+ },
1841
+ isAmino(o: any): o is DelegationAmino {
1842
+ return o && (o.$typeUrl === Delegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && typeof o.shares === "string");
1843
+ },
1844
+ encode(message: Delegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
1845
+ if (message.delegatorAddress !== "") {
1846
+ writer.uint32(10).string(message.delegatorAddress);
1847
+ }
1848
+ if (message.validatorAddress !== "") {
1849
+ writer.uint32(18).string(message.validatorAddress);
1850
+ }
1851
+ if (message.shares !== "") {
1852
+ writer.uint32(26).string(message.shares);
1853
+ }
1854
+ return writer;
1855
+ },
1856
+ decode(input: BinaryReader | Uint8Array, length?: number): Delegation {
1857
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1858
+ let end = length === undefined ? reader.len : reader.pos + length;
1859
+ const message = createBaseDelegation();
1860
+ while (reader.pos < end) {
1861
+ const tag = reader.uint32();
1862
+ switch (tag >>> 3) {
1863
+ case 1:
1864
+ message.delegatorAddress = reader.string();
1865
+ break;
1866
+ case 2:
1867
+ message.validatorAddress = reader.string();
1868
+ break;
1869
+ case 3:
1870
+ message.shares = reader.string();
1871
+ break;
1872
+ default:
1873
+ reader.skipType(tag & 7);
1874
+ break;
1875
+ }
1876
+ }
1877
+ return message;
1878
+ },
1879
+ fromPartial(object: DeepPartial<Delegation>): Delegation {
1880
+ const message = createBaseDelegation();
1881
+ message.delegatorAddress = object.delegatorAddress ?? "";
1882
+ message.validatorAddress = object.validatorAddress ?? "";
1883
+ message.shares = object.shares ?? "";
1884
+ return message;
1885
+ },
1886
+ fromAmino(object: DelegationAmino): Delegation {
1887
+ const message = createBaseDelegation();
1888
+ if (object.delegator_address !== undefined && object.delegator_address !== null) {
1889
+ message.delegatorAddress = object.delegator_address;
1890
+ }
1891
+ if (object.validator_address !== undefined && object.validator_address !== null) {
1892
+ message.validatorAddress = object.validator_address;
1893
+ }
1894
+ if (object.shares !== undefined && object.shares !== null) {
1895
+ message.shares = object.shares;
1896
+ }
1897
+ return message;
1898
+ },
1899
+ toAmino(message: Delegation): DelegationAmino {
1900
+ const obj: any = {};
1901
+ obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress;
1902
+ obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress;
1903
+ obj.shares = message.shares === "" ? undefined : message.shares;
1904
+ return obj;
1905
+ },
1906
+ fromAminoMsg(object: DelegationAminoMsg): Delegation {
1907
+ return Delegation.fromAmino(object.value);
1908
+ },
1909
+ toAminoMsg(message: Delegation): DelegationAminoMsg {
1910
+ return {
1911
+ type: "cosmos-sdk/Delegation",
1912
+ value: Delegation.toAmino(message)
1913
+ };
1914
+ },
1915
+ fromProtoMsg(message: DelegationProtoMsg): Delegation {
1916
+ return Delegation.decode(message.value);
1917
+ },
1918
+ toProto(message: Delegation): Uint8Array {
1919
+ return Delegation.encode(message).finish();
1920
+ },
1921
+ toProtoMsg(message: Delegation): DelegationProtoMsg {
1922
+ return {
1923
+ typeUrl: "/cosmos.staking.v1beta1.Delegation",
1924
+ value: Delegation.encode(message).finish()
1925
+ };
1926
+ }
1927
+ };
1928
+ GlobalDecoderRegistry.register(Delegation.typeUrl, Delegation);
1929
+ GlobalDecoderRegistry.registerAminoProtoMapping(Delegation.aminoType, Delegation.typeUrl);
1930
+ function createBaseUnbondingDelegation(): UnbondingDelegation {
1931
+ return {
1932
+ delegatorAddress: "",
1933
+ validatorAddress: "",
1934
+ entries: []
1935
+ };
1936
+ }
1937
+ export const UnbondingDelegation = {
1938
+ typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation",
1939
+ aminoType: "cosmos-sdk/UnbondingDelegation",
1940
+ is(o: any): o is UnbondingDelegation {
1941
+ return o && (o.$typeUrl === UnbondingDelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorAddress === "string" && Array.isArray(o.entries) && (!o.entries.length || UnbondingDelegationEntry.is(o.entries[0])));
1942
+ },
1943
+ isAmino(o: any): o is UnbondingDelegationAmino {
1944
+ return o && (o.$typeUrl === UnbondingDelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_address === "string" && Array.isArray(o.entries) && (!o.entries.length || UnbondingDelegationEntry.isAmino(o.entries[0])));
1945
+ },
1946
+ encode(message: UnbondingDelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
1947
+ if (message.delegatorAddress !== "") {
1948
+ writer.uint32(10).string(message.delegatorAddress);
1949
+ }
1950
+ if (message.validatorAddress !== "") {
1951
+ writer.uint32(18).string(message.validatorAddress);
1952
+ }
1953
+ for (const v of message.entries) {
1954
+ UnbondingDelegationEntry.encode(v!, writer.uint32(26).fork()).ldelim();
1955
+ }
1956
+ return writer;
1957
+ },
1958
+ decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegation {
1959
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
1960
+ let end = length === undefined ? reader.len : reader.pos + length;
1961
+ const message = createBaseUnbondingDelegation();
1962
+ while (reader.pos < end) {
1963
+ const tag = reader.uint32();
1964
+ switch (tag >>> 3) {
1965
+ case 1:
1966
+ message.delegatorAddress = reader.string();
1967
+ break;
1968
+ case 2:
1969
+ message.validatorAddress = reader.string();
1970
+ break;
1971
+ case 3:
1972
+ message.entries.push(UnbondingDelegationEntry.decode(reader, reader.uint32()));
1973
+ break;
1974
+ default:
1975
+ reader.skipType(tag & 7);
1976
+ break;
1977
+ }
1978
+ }
1979
+ return message;
1980
+ },
1981
+ fromPartial(object: DeepPartial<UnbondingDelegation>): UnbondingDelegation {
1982
+ const message = createBaseUnbondingDelegation();
1983
+ message.delegatorAddress = object.delegatorAddress ?? "";
1984
+ message.validatorAddress = object.validatorAddress ?? "";
1985
+ message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromPartial(e)) || [];
1986
+ return message;
1987
+ },
1988
+ fromAmino(object: UnbondingDelegationAmino): UnbondingDelegation {
1989
+ const message = createBaseUnbondingDelegation();
1990
+ if (object.delegator_address !== undefined && object.delegator_address !== null) {
1991
+ message.delegatorAddress = object.delegator_address;
1992
+ }
1993
+ if (object.validator_address !== undefined && object.validator_address !== null) {
1994
+ message.validatorAddress = object.validator_address;
1995
+ }
1996
+ message.entries = object.entries?.map(e => UnbondingDelegationEntry.fromAmino(e)) || [];
1997
+ return message;
1998
+ },
1999
+ toAmino(message: UnbondingDelegation): UnbondingDelegationAmino {
2000
+ const obj: any = {};
2001
+ obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress;
2002
+ obj.validator_address = message.validatorAddress === "" ? undefined : message.validatorAddress;
2003
+ if (message.entries) {
2004
+ obj.entries = message.entries.map(e => e ? UnbondingDelegationEntry.toAmino(e) : undefined);
2005
+ } else {
2006
+ obj.entries = message.entries;
2007
+ }
2008
+ return obj;
2009
+ },
2010
+ fromAminoMsg(object: UnbondingDelegationAminoMsg): UnbondingDelegation {
2011
+ return UnbondingDelegation.fromAmino(object.value);
2012
+ },
2013
+ toAminoMsg(message: UnbondingDelegation): UnbondingDelegationAminoMsg {
2014
+ return {
2015
+ type: "cosmos-sdk/UnbondingDelegation",
2016
+ value: UnbondingDelegation.toAmino(message)
2017
+ };
2018
+ },
2019
+ fromProtoMsg(message: UnbondingDelegationProtoMsg): UnbondingDelegation {
2020
+ return UnbondingDelegation.decode(message.value);
2021
+ },
2022
+ toProto(message: UnbondingDelegation): Uint8Array {
2023
+ return UnbondingDelegation.encode(message).finish();
2024
+ },
2025
+ toProtoMsg(message: UnbondingDelegation): UnbondingDelegationProtoMsg {
2026
+ return {
2027
+ typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegation",
2028
+ value: UnbondingDelegation.encode(message).finish()
2029
+ };
2030
+ }
2031
+ };
2032
+ GlobalDecoderRegistry.register(UnbondingDelegation.typeUrl, UnbondingDelegation);
2033
+ GlobalDecoderRegistry.registerAminoProtoMapping(UnbondingDelegation.aminoType, UnbondingDelegation.typeUrl);
2034
+ function createBaseUnbondingDelegationEntry(): UnbondingDelegationEntry {
2035
+ return {
2036
+ creationHeight: BigInt(0),
2037
+ completionTime: new Date(),
2038
+ initialBalance: "",
2039
+ balance: "",
2040
+ unbondingId: BigInt(0),
2041
+ unbondingOnHoldRefCount: BigInt(0)
2042
+ };
2043
+ }
2044
+ export const UnbondingDelegationEntry = {
2045
+ typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry",
2046
+ aminoType: "cosmos-sdk/UnbondingDelegationEntry",
2047
+ is(o: any): o is UnbondingDelegationEntry {
2048
+ return o && (o.$typeUrl === UnbondingDelegationEntry.typeUrl || typeof o.creationHeight === "bigint" && Timestamp.is(o.completionTime) && typeof o.initialBalance === "string" && typeof o.balance === "string" && typeof o.unbondingId === "bigint" && typeof o.unbondingOnHoldRefCount === "bigint");
2049
+ },
2050
+ isAmino(o: any): o is UnbondingDelegationEntryAmino {
2051
+ return o && (o.$typeUrl === UnbondingDelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isAmino(o.completion_time) && typeof o.initial_balance === "string" && typeof o.balance === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint");
2052
+ },
2053
+ encode(message: UnbondingDelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
2054
+ if (message.creationHeight !== BigInt(0)) {
2055
+ writer.uint32(8).int64(message.creationHeight);
2056
+ }
2057
+ if (message.completionTime !== undefined) {
2058
+ Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim();
2059
+ }
2060
+ if (message.initialBalance !== "") {
2061
+ writer.uint32(26).string(message.initialBalance);
2062
+ }
2063
+ if (message.balance !== "") {
2064
+ writer.uint32(34).string(message.balance);
2065
+ }
2066
+ if (message.unbondingId !== BigInt(0)) {
2067
+ writer.uint32(40).uint64(message.unbondingId);
2068
+ }
2069
+ if (message.unbondingOnHoldRefCount !== BigInt(0)) {
2070
+ writer.uint32(48).int64(message.unbondingOnHoldRefCount);
2071
+ }
2072
+ return writer;
2073
+ },
2074
+ decode(input: BinaryReader | Uint8Array, length?: number): UnbondingDelegationEntry {
2075
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2076
+ let end = length === undefined ? reader.len : reader.pos + length;
2077
+ const message = createBaseUnbondingDelegationEntry();
2078
+ while (reader.pos < end) {
2079
+ const tag = reader.uint32();
2080
+ switch (tag >>> 3) {
2081
+ case 1:
2082
+ message.creationHeight = reader.int64();
2083
+ break;
2084
+ case 2:
2085
+ message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2086
+ break;
2087
+ case 3:
2088
+ message.initialBalance = reader.string();
2089
+ break;
2090
+ case 4:
2091
+ message.balance = reader.string();
2092
+ break;
2093
+ case 5:
2094
+ message.unbondingId = reader.uint64();
2095
+ break;
2096
+ case 6:
2097
+ message.unbondingOnHoldRefCount = reader.int64();
2098
+ break;
2099
+ default:
2100
+ reader.skipType(tag & 7);
2101
+ break;
2102
+ }
2103
+ }
2104
+ return message;
2105
+ },
2106
+ fromPartial(object: DeepPartial<UnbondingDelegationEntry>): UnbondingDelegationEntry {
2107
+ const message = createBaseUnbondingDelegationEntry();
2108
+ message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0);
2109
+ message.completionTime = object.completionTime ?? undefined;
2110
+ message.initialBalance = object.initialBalance ?? "";
2111
+ message.balance = object.balance ?? "";
2112
+ message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0);
2113
+ message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0);
2114
+ return message;
2115
+ },
2116
+ fromAmino(object: UnbondingDelegationEntryAmino): UnbondingDelegationEntry {
2117
+ const message = createBaseUnbondingDelegationEntry();
2118
+ if (object.creation_height !== undefined && object.creation_height !== null) {
2119
+ message.creationHeight = BigInt(object.creation_height);
2120
+ }
2121
+ if (object.completion_time !== undefined && object.completion_time !== null) {
2122
+ message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time));
2123
+ }
2124
+ if (object.initial_balance !== undefined && object.initial_balance !== null) {
2125
+ message.initialBalance = object.initial_balance;
2126
+ }
2127
+ if (object.balance !== undefined && object.balance !== null) {
2128
+ message.balance = object.balance;
2129
+ }
2130
+ if (object.unbonding_id !== undefined && object.unbonding_id !== null) {
2131
+ message.unbondingId = BigInt(object.unbonding_id);
2132
+ }
2133
+ if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) {
2134
+ message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count);
2135
+ }
2136
+ return message;
2137
+ },
2138
+ toAmino(message: UnbondingDelegationEntry): UnbondingDelegationEntryAmino {
2139
+ const obj: any = {};
2140
+ obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight?.toString() : undefined;
2141
+ obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date();
2142
+ obj.initial_balance = message.initialBalance === "" ? undefined : message.initialBalance;
2143
+ obj.balance = message.balance === "" ? undefined : message.balance;
2144
+ obj.unbonding_id = message.unbondingId !== BigInt(0) ? message.unbondingId?.toString() : undefined;
2145
+ obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount !== BigInt(0) ? message.unbondingOnHoldRefCount?.toString() : undefined;
2146
+ return obj;
2147
+ },
2148
+ fromAminoMsg(object: UnbondingDelegationEntryAminoMsg): UnbondingDelegationEntry {
2149
+ return UnbondingDelegationEntry.fromAmino(object.value);
2150
+ },
2151
+ toAminoMsg(message: UnbondingDelegationEntry): UnbondingDelegationEntryAminoMsg {
2152
+ return {
2153
+ type: "cosmos-sdk/UnbondingDelegationEntry",
2154
+ value: UnbondingDelegationEntry.toAmino(message)
2155
+ };
2156
+ },
2157
+ fromProtoMsg(message: UnbondingDelegationEntryProtoMsg): UnbondingDelegationEntry {
2158
+ return UnbondingDelegationEntry.decode(message.value);
2159
+ },
2160
+ toProto(message: UnbondingDelegationEntry): Uint8Array {
2161
+ return UnbondingDelegationEntry.encode(message).finish();
2162
+ },
2163
+ toProtoMsg(message: UnbondingDelegationEntry): UnbondingDelegationEntryProtoMsg {
2164
+ return {
2165
+ typeUrl: "/cosmos.staking.v1beta1.UnbondingDelegationEntry",
2166
+ value: UnbondingDelegationEntry.encode(message).finish()
2167
+ };
2168
+ }
2169
+ };
2170
+ GlobalDecoderRegistry.register(UnbondingDelegationEntry.typeUrl, UnbondingDelegationEntry);
2171
+ GlobalDecoderRegistry.registerAminoProtoMapping(UnbondingDelegationEntry.aminoType, UnbondingDelegationEntry.typeUrl);
2172
+ function createBaseRedelegationEntry(): RedelegationEntry {
2173
+ return {
2174
+ creationHeight: BigInt(0),
2175
+ completionTime: new Date(),
2176
+ initialBalance: "",
2177
+ sharesDst: "",
2178
+ unbondingId: BigInt(0),
2179
+ unbondingOnHoldRefCount: BigInt(0)
2180
+ };
2181
+ }
2182
+ export const RedelegationEntry = {
2183
+ typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry",
2184
+ aminoType: "cosmos-sdk/RedelegationEntry",
2185
+ is(o: any): o is RedelegationEntry {
2186
+ return o && (o.$typeUrl === RedelegationEntry.typeUrl || typeof o.creationHeight === "bigint" && Timestamp.is(o.completionTime) && typeof o.initialBalance === "string" && typeof o.sharesDst === "string" && typeof o.unbondingId === "bigint" && typeof o.unbondingOnHoldRefCount === "bigint");
2187
+ },
2188
+ isAmino(o: any): o is RedelegationEntryAmino {
2189
+ return o && (o.$typeUrl === RedelegationEntry.typeUrl || typeof o.creation_height === "bigint" && Timestamp.isAmino(o.completion_time) && typeof o.initial_balance === "string" && typeof o.shares_dst === "string" && typeof o.unbonding_id === "bigint" && typeof o.unbonding_on_hold_ref_count === "bigint");
2190
+ },
2191
+ encode(message: RedelegationEntry, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
2192
+ if (message.creationHeight !== BigInt(0)) {
2193
+ writer.uint32(8).int64(message.creationHeight);
2194
+ }
2195
+ if (message.completionTime !== undefined) {
2196
+ Timestamp.encode(toTimestamp(message.completionTime), writer.uint32(18).fork()).ldelim();
2197
+ }
2198
+ if (message.initialBalance !== "") {
2199
+ writer.uint32(26).string(message.initialBalance);
2200
+ }
2201
+ if (message.sharesDst !== "") {
2202
+ writer.uint32(34).string(message.sharesDst);
2203
+ }
2204
+ if (message.unbondingId !== BigInt(0)) {
2205
+ writer.uint32(40).uint64(message.unbondingId);
2206
+ }
2207
+ if (message.unbondingOnHoldRefCount !== BigInt(0)) {
2208
+ writer.uint32(48).int64(message.unbondingOnHoldRefCount);
2209
+ }
2210
+ return writer;
2211
+ },
2212
+ decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntry {
2213
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2214
+ let end = length === undefined ? reader.len : reader.pos + length;
2215
+ const message = createBaseRedelegationEntry();
2216
+ while (reader.pos < end) {
2217
+ const tag = reader.uint32();
2218
+ switch (tag >>> 3) {
2219
+ case 1:
2220
+ message.creationHeight = reader.int64();
2221
+ break;
2222
+ case 2:
2223
+ message.completionTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
2224
+ break;
2225
+ case 3:
2226
+ message.initialBalance = reader.string();
2227
+ break;
2228
+ case 4:
2229
+ message.sharesDst = reader.string();
2230
+ break;
2231
+ case 5:
2232
+ message.unbondingId = reader.uint64();
2233
+ break;
2234
+ case 6:
2235
+ message.unbondingOnHoldRefCount = reader.int64();
2236
+ break;
2237
+ default:
2238
+ reader.skipType(tag & 7);
2239
+ break;
2240
+ }
2241
+ }
2242
+ return message;
2243
+ },
2244
+ fromPartial(object: DeepPartial<RedelegationEntry>): RedelegationEntry {
2245
+ const message = createBaseRedelegationEntry();
2246
+ message.creationHeight = object.creationHeight !== undefined && object.creationHeight !== null ? BigInt(object.creationHeight.toString()) : BigInt(0);
2247
+ message.completionTime = object.completionTime ?? undefined;
2248
+ message.initialBalance = object.initialBalance ?? "";
2249
+ message.sharesDst = object.sharesDst ?? "";
2250
+ message.unbondingId = object.unbondingId !== undefined && object.unbondingId !== null ? BigInt(object.unbondingId.toString()) : BigInt(0);
2251
+ message.unbondingOnHoldRefCount = object.unbondingOnHoldRefCount !== undefined && object.unbondingOnHoldRefCount !== null ? BigInt(object.unbondingOnHoldRefCount.toString()) : BigInt(0);
2252
+ return message;
2253
+ },
2254
+ fromAmino(object: RedelegationEntryAmino): RedelegationEntry {
2255
+ const message = createBaseRedelegationEntry();
2256
+ if (object.creation_height !== undefined && object.creation_height !== null) {
2257
+ message.creationHeight = BigInt(object.creation_height);
2258
+ }
2259
+ if (object.completion_time !== undefined && object.completion_time !== null) {
2260
+ message.completionTime = fromTimestamp(Timestamp.fromAmino(object.completion_time));
2261
+ }
2262
+ if (object.initial_balance !== undefined && object.initial_balance !== null) {
2263
+ message.initialBalance = object.initial_balance;
2264
+ }
2265
+ if (object.shares_dst !== undefined && object.shares_dst !== null) {
2266
+ message.sharesDst = object.shares_dst;
2267
+ }
2268
+ if (object.unbonding_id !== undefined && object.unbonding_id !== null) {
2269
+ message.unbondingId = BigInt(object.unbonding_id);
2270
+ }
2271
+ if (object.unbonding_on_hold_ref_count !== undefined && object.unbonding_on_hold_ref_count !== null) {
2272
+ message.unbondingOnHoldRefCount = BigInt(object.unbonding_on_hold_ref_count);
2273
+ }
2274
+ return message;
2275
+ },
2276
+ toAmino(message: RedelegationEntry): RedelegationEntryAmino {
2277
+ const obj: any = {};
2278
+ obj.creation_height = message.creationHeight !== BigInt(0) ? message.creationHeight?.toString() : undefined;
2279
+ obj.completion_time = message.completionTime ? Timestamp.toAmino(toTimestamp(message.completionTime)) : new Date();
2280
+ obj.initial_balance = message.initialBalance === "" ? undefined : message.initialBalance;
2281
+ obj.shares_dst = message.sharesDst === "" ? undefined : message.sharesDst;
2282
+ obj.unbonding_id = message.unbondingId !== BigInt(0) ? message.unbondingId?.toString() : undefined;
2283
+ obj.unbonding_on_hold_ref_count = message.unbondingOnHoldRefCount !== BigInt(0) ? message.unbondingOnHoldRefCount?.toString() : undefined;
2284
+ return obj;
2285
+ },
2286
+ fromAminoMsg(object: RedelegationEntryAminoMsg): RedelegationEntry {
2287
+ return RedelegationEntry.fromAmino(object.value);
2288
+ },
2289
+ toAminoMsg(message: RedelegationEntry): RedelegationEntryAminoMsg {
2290
+ return {
2291
+ type: "cosmos-sdk/RedelegationEntry",
2292
+ value: RedelegationEntry.toAmino(message)
2293
+ };
2294
+ },
2295
+ fromProtoMsg(message: RedelegationEntryProtoMsg): RedelegationEntry {
2296
+ return RedelegationEntry.decode(message.value);
2297
+ },
2298
+ toProto(message: RedelegationEntry): Uint8Array {
2299
+ return RedelegationEntry.encode(message).finish();
2300
+ },
2301
+ toProtoMsg(message: RedelegationEntry): RedelegationEntryProtoMsg {
2302
+ return {
2303
+ typeUrl: "/cosmos.staking.v1beta1.RedelegationEntry",
2304
+ value: RedelegationEntry.encode(message).finish()
2305
+ };
2306
+ }
2307
+ };
2308
+ GlobalDecoderRegistry.register(RedelegationEntry.typeUrl, RedelegationEntry);
2309
+ GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationEntry.aminoType, RedelegationEntry.typeUrl);
2310
+ function createBaseRedelegation(): Redelegation {
2311
+ return {
2312
+ delegatorAddress: "",
2313
+ validatorSrcAddress: "",
2314
+ validatorDstAddress: "",
2315
+ entries: []
2316
+ };
2317
+ }
2318
+ export const Redelegation = {
2319
+ typeUrl: "/cosmos.staking.v1beta1.Redelegation",
2320
+ aminoType: "cosmos-sdk/Redelegation",
2321
+ is(o: any): o is Redelegation {
2322
+ return o && (o.$typeUrl === Redelegation.typeUrl || typeof o.delegatorAddress === "string" && typeof o.validatorSrcAddress === "string" && typeof o.validatorDstAddress === "string" && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntry.is(o.entries[0])));
2323
+ },
2324
+ isAmino(o: any): o is RedelegationAmino {
2325
+ return o && (o.$typeUrl === Redelegation.typeUrl || typeof o.delegator_address === "string" && typeof o.validator_src_address === "string" && typeof o.validator_dst_address === "string" && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntry.isAmino(o.entries[0])));
2326
+ },
2327
+ encode(message: Redelegation, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
2328
+ if (message.delegatorAddress !== "") {
2329
+ writer.uint32(10).string(message.delegatorAddress);
2330
+ }
2331
+ if (message.validatorSrcAddress !== "") {
2332
+ writer.uint32(18).string(message.validatorSrcAddress);
2333
+ }
2334
+ if (message.validatorDstAddress !== "") {
2335
+ writer.uint32(26).string(message.validatorDstAddress);
2336
+ }
2337
+ for (const v of message.entries) {
2338
+ RedelegationEntry.encode(v!, writer.uint32(34).fork()).ldelim();
2339
+ }
2340
+ return writer;
2341
+ },
2342
+ decode(input: BinaryReader | Uint8Array, length?: number): Redelegation {
2343
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2344
+ let end = length === undefined ? reader.len : reader.pos + length;
2345
+ const message = createBaseRedelegation();
2346
+ while (reader.pos < end) {
2347
+ const tag = reader.uint32();
2348
+ switch (tag >>> 3) {
2349
+ case 1:
2350
+ message.delegatorAddress = reader.string();
2351
+ break;
2352
+ case 2:
2353
+ message.validatorSrcAddress = reader.string();
2354
+ break;
2355
+ case 3:
2356
+ message.validatorDstAddress = reader.string();
2357
+ break;
2358
+ case 4:
2359
+ message.entries.push(RedelegationEntry.decode(reader, reader.uint32()));
2360
+ break;
2361
+ default:
2362
+ reader.skipType(tag & 7);
2363
+ break;
2364
+ }
2365
+ }
2366
+ return message;
2367
+ },
2368
+ fromPartial(object: DeepPartial<Redelegation>): Redelegation {
2369
+ const message = createBaseRedelegation();
2370
+ message.delegatorAddress = object.delegatorAddress ?? "";
2371
+ message.validatorSrcAddress = object.validatorSrcAddress ?? "";
2372
+ message.validatorDstAddress = object.validatorDstAddress ?? "";
2373
+ message.entries = object.entries?.map(e => RedelegationEntry.fromPartial(e)) || [];
2374
+ return message;
2375
+ },
2376
+ fromAmino(object: RedelegationAmino): Redelegation {
2377
+ const message = createBaseRedelegation();
2378
+ if (object.delegator_address !== undefined && object.delegator_address !== null) {
2379
+ message.delegatorAddress = object.delegator_address;
2380
+ }
2381
+ if (object.validator_src_address !== undefined && object.validator_src_address !== null) {
2382
+ message.validatorSrcAddress = object.validator_src_address;
2383
+ }
2384
+ if (object.validator_dst_address !== undefined && object.validator_dst_address !== null) {
2385
+ message.validatorDstAddress = object.validator_dst_address;
2386
+ }
2387
+ message.entries = object.entries?.map(e => RedelegationEntry.fromAmino(e)) || [];
2388
+ return message;
2389
+ },
2390
+ toAmino(message: Redelegation): RedelegationAmino {
2391
+ const obj: any = {};
2392
+ obj.delegator_address = message.delegatorAddress === "" ? undefined : message.delegatorAddress;
2393
+ obj.validator_src_address = message.validatorSrcAddress === "" ? undefined : message.validatorSrcAddress;
2394
+ obj.validator_dst_address = message.validatorDstAddress === "" ? undefined : message.validatorDstAddress;
2395
+ if (message.entries) {
2396
+ obj.entries = message.entries.map(e => e ? RedelegationEntry.toAmino(e) : undefined);
2397
+ } else {
2398
+ obj.entries = message.entries;
2399
+ }
2400
+ return obj;
2401
+ },
2402
+ fromAminoMsg(object: RedelegationAminoMsg): Redelegation {
2403
+ return Redelegation.fromAmino(object.value);
2404
+ },
2405
+ toAminoMsg(message: Redelegation): RedelegationAminoMsg {
2406
+ return {
2407
+ type: "cosmos-sdk/Redelegation",
2408
+ value: Redelegation.toAmino(message)
2409
+ };
2410
+ },
2411
+ fromProtoMsg(message: RedelegationProtoMsg): Redelegation {
2412
+ return Redelegation.decode(message.value);
2413
+ },
2414
+ toProto(message: Redelegation): Uint8Array {
2415
+ return Redelegation.encode(message).finish();
2416
+ },
2417
+ toProtoMsg(message: Redelegation): RedelegationProtoMsg {
2418
+ return {
2419
+ typeUrl: "/cosmos.staking.v1beta1.Redelegation",
2420
+ value: Redelegation.encode(message).finish()
2421
+ };
2422
+ }
2423
+ };
2424
+ GlobalDecoderRegistry.register(Redelegation.typeUrl, Redelegation);
2425
+ GlobalDecoderRegistry.registerAminoProtoMapping(Redelegation.aminoType, Redelegation.typeUrl);
2426
+ function createBaseParams(): Params {
2427
+ return {
2428
+ unbondingTime: Duration.fromPartial({}),
2429
+ maxValidators: 0,
2430
+ maxEntries: 0,
2431
+ historicalEntries: 0,
2432
+ bondDenom: "",
2433
+ minCommissionRate: ""
2434
+ };
2435
+ }
2436
+ export const Params = {
2437
+ typeUrl: "/cosmos.staking.v1beta1.Params",
2438
+ aminoType: "cosmos-sdk/x/staking/Params",
2439
+ is(o: any): o is Params {
2440
+ return o && (o.$typeUrl === Params.typeUrl || Duration.is(o.unbondingTime) && typeof o.maxValidators === "number" && typeof o.maxEntries === "number" && typeof o.historicalEntries === "number" && typeof o.bondDenom === "string" && typeof o.minCommissionRate === "string");
2441
+ },
2442
+ isAmino(o: any): o is ParamsAmino {
2443
+ return o && (o.$typeUrl === Params.typeUrl || Duration.isAmino(o.unbonding_time) && typeof o.max_validators === "number" && typeof o.max_entries === "number" && typeof o.historical_entries === "number" && typeof o.bond_denom === "string" && typeof o.min_commission_rate === "string");
2444
+ },
2445
+ encode(message: Params, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
2446
+ if (message.unbondingTime !== undefined) {
2447
+ Duration.encode(message.unbondingTime, writer.uint32(10).fork()).ldelim();
2448
+ }
2449
+ if (message.maxValidators !== 0) {
2450
+ writer.uint32(16).uint32(message.maxValidators);
2451
+ }
2452
+ if (message.maxEntries !== 0) {
2453
+ writer.uint32(24).uint32(message.maxEntries);
2454
+ }
2455
+ if (message.historicalEntries !== 0) {
2456
+ writer.uint32(32).uint32(message.historicalEntries);
2457
+ }
2458
+ if (message.bondDenom !== "") {
2459
+ writer.uint32(42).string(message.bondDenom);
2460
+ }
2461
+ if (message.minCommissionRate !== "") {
2462
+ writer.uint32(50).string(message.minCommissionRate);
2463
+ }
2464
+ return writer;
2465
+ },
2466
+ decode(input: BinaryReader | Uint8Array, length?: number): Params {
2467
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2468
+ let end = length === undefined ? reader.len : reader.pos + length;
2469
+ const message = createBaseParams();
2470
+ while (reader.pos < end) {
2471
+ const tag = reader.uint32();
2472
+ switch (tag >>> 3) {
2473
+ case 1:
2474
+ message.unbondingTime = Duration.decode(reader, reader.uint32());
2475
+ break;
2476
+ case 2:
2477
+ message.maxValidators = reader.uint32();
2478
+ break;
2479
+ case 3:
2480
+ message.maxEntries = reader.uint32();
2481
+ break;
2482
+ case 4:
2483
+ message.historicalEntries = reader.uint32();
2484
+ break;
2485
+ case 5:
2486
+ message.bondDenom = reader.string();
2487
+ break;
2488
+ case 6:
2489
+ message.minCommissionRate = reader.string();
2490
+ break;
2491
+ default:
2492
+ reader.skipType(tag & 7);
2493
+ break;
2494
+ }
2495
+ }
2496
+ return message;
2497
+ },
2498
+ fromPartial(object: DeepPartial<Params>): Params {
2499
+ const message = createBaseParams();
2500
+ message.unbondingTime = object.unbondingTime !== undefined && object.unbondingTime !== null ? Duration.fromPartial(object.unbondingTime) : undefined;
2501
+ message.maxValidators = object.maxValidators ?? 0;
2502
+ message.maxEntries = object.maxEntries ?? 0;
2503
+ message.historicalEntries = object.historicalEntries ?? 0;
2504
+ message.bondDenom = object.bondDenom ?? "";
2505
+ message.minCommissionRate = object.minCommissionRate ?? "";
2506
+ return message;
2507
+ },
2508
+ fromAmino(object: ParamsAmino): Params {
2509
+ const message = createBaseParams();
2510
+ if (object.unbonding_time !== undefined && object.unbonding_time !== null) {
2511
+ message.unbondingTime = Duration.fromAmino(object.unbonding_time);
2512
+ }
2513
+ if (object.max_validators !== undefined && object.max_validators !== null) {
2514
+ message.maxValidators = object.max_validators;
2515
+ }
2516
+ if (object.max_entries !== undefined && object.max_entries !== null) {
2517
+ message.maxEntries = object.max_entries;
2518
+ }
2519
+ if (object.historical_entries !== undefined && object.historical_entries !== null) {
2520
+ message.historicalEntries = object.historical_entries;
2521
+ }
2522
+ if (object.bond_denom !== undefined && object.bond_denom !== null) {
2523
+ message.bondDenom = object.bond_denom;
2524
+ }
2525
+ if (object.min_commission_rate !== undefined && object.min_commission_rate !== null) {
2526
+ message.minCommissionRate = object.min_commission_rate;
2527
+ }
2528
+ return message;
2529
+ },
2530
+ toAmino(message: Params): ParamsAmino {
2531
+ const obj: any = {};
2532
+ obj.unbonding_time = message.unbondingTime ? Duration.toAmino(message.unbondingTime) : Duration.toAmino(Duration.fromPartial({}));
2533
+ obj.max_validators = message.maxValidators === 0 ? undefined : message.maxValidators;
2534
+ obj.max_entries = message.maxEntries === 0 ? undefined : message.maxEntries;
2535
+ obj.historical_entries = message.historicalEntries === 0 ? undefined : message.historicalEntries;
2536
+ obj.bond_denom = message.bondDenom === "" ? undefined : message.bondDenom;
2537
+ obj.min_commission_rate = message.minCommissionRate ?? "";
2538
+ return obj;
2539
+ },
2540
+ fromAminoMsg(object: ParamsAminoMsg): Params {
2541
+ return Params.fromAmino(object.value);
2542
+ },
2543
+ toAminoMsg(message: Params): ParamsAminoMsg {
2544
+ return {
2545
+ type: "cosmos-sdk/x/staking/Params",
2546
+ value: Params.toAmino(message)
2547
+ };
2548
+ },
2549
+ fromProtoMsg(message: ParamsProtoMsg): Params {
2550
+ return Params.decode(message.value);
2551
+ },
2552
+ toProto(message: Params): Uint8Array {
2553
+ return Params.encode(message).finish();
2554
+ },
2555
+ toProtoMsg(message: Params): ParamsProtoMsg {
2556
+ return {
2557
+ typeUrl: "/cosmos.staking.v1beta1.Params",
2558
+ value: Params.encode(message).finish()
2559
+ };
2560
+ }
2561
+ };
2562
+ GlobalDecoderRegistry.register(Params.typeUrl, Params);
2563
+ GlobalDecoderRegistry.registerAminoProtoMapping(Params.aminoType, Params.typeUrl);
2564
+ function createBaseDelegationResponse(): DelegationResponse {
2565
+ return {
2566
+ delegation: Delegation.fromPartial({}),
2567
+ balance: Coin.fromPartial({})
2568
+ };
2569
+ }
2570
+ export const DelegationResponse = {
2571
+ typeUrl: "/cosmos.staking.v1beta1.DelegationResponse",
2572
+ aminoType: "cosmos-sdk/DelegationResponse",
2573
+ is(o: any): o is DelegationResponse {
2574
+ return o && (o.$typeUrl === DelegationResponse.typeUrl || Delegation.is(o.delegation) && Coin.is(o.balance));
2575
+ },
2576
+ isAmino(o: any): o is DelegationResponseAmino {
2577
+ return o && (o.$typeUrl === DelegationResponse.typeUrl || Delegation.isAmino(o.delegation) && Coin.isAmino(o.balance));
2578
+ },
2579
+ encode(message: DelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
2580
+ if (message.delegation !== undefined) {
2581
+ Delegation.encode(message.delegation, writer.uint32(10).fork()).ldelim();
2582
+ }
2583
+ if (message.balance !== undefined) {
2584
+ Coin.encode(message.balance, writer.uint32(18).fork()).ldelim();
2585
+ }
2586
+ return writer;
2587
+ },
2588
+ decode(input: BinaryReader | Uint8Array, length?: number): DelegationResponse {
2589
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2590
+ let end = length === undefined ? reader.len : reader.pos + length;
2591
+ const message = createBaseDelegationResponse();
2592
+ while (reader.pos < end) {
2593
+ const tag = reader.uint32();
2594
+ switch (tag >>> 3) {
2595
+ case 1:
2596
+ message.delegation = Delegation.decode(reader, reader.uint32());
2597
+ break;
2598
+ case 2:
2599
+ message.balance = Coin.decode(reader, reader.uint32());
2600
+ break;
2601
+ default:
2602
+ reader.skipType(tag & 7);
2603
+ break;
2604
+ }
2605
+ }
2606
+ return message;
2607
+ },
2608
+ fromPartial(object: DeepPartial<DelegationResponse>): DelegationResponse {
2609
+ const message = createBaseDelegationResponse();
2610
+ message.delegation = object.delegation !== undefined && object.delegation !== null ? Delegation.fromPartial(object.delegation) : undefined;
2611
+ message.balance = object.balance !== undefined && object.balance !== null ? Coin.fromPartial(object.balance) : undefined;
2612
+ return message;
2613
+ },
2614
+ fromAmino(object: DelegationResponseAmino): DelegationResponse {
2615
+ const message = createBaseDelegationResponse();
2616
+ if (object.delegation !== undefined && object.delegation !== null) {
2617
+ message.delegation = Delegation.fromAmino(object.delegation);
2618
+ }
2619
+ if (object.balance !== undefined && object.balance !== null) {
2620
+ message.balance = Coin.fromAmino(object.balance);
2621
+ }
2622
+ return message;
2623
+ },
2624
+ toAmino(message: DelegationResponse): DelegationResponseAmino {
2625
+ const obj: any = {};
2626
+ obj.delegation = message.delegation ? Delegation.toAmino(message.delegation) : Delegation.toAmino(Delegation.fromPartial({}));
2627
+ obj.balance = message.balance ? Coin.toAmino(message.balance) : Coin.toAmino(Coin.fromPartial({}));
2628
+ return obj;
2629
+ },
2630
+ fromAminoMsg(object: DelegationResponseAminoMsg): DelegationResponse {
2631
+ return DelegationResponse.fromAmino(object.value);
2632
+ },
2633
+ toAminoMsg(message: DelegationResponse): DelegationResponseAminoMsg {
2634
+ return {
2635
+ type: "cosmos-sdk/DelegationResponse",
2636
+ value: DelegationResponse.toAmino(message)
2637
+ };
2638
+ },
2639
+ fromProtoMsg(message: DelegationResponseProtoMsg): DelegationResponse {
2640
+ return DelegationResponse.decode(message.value);
2641
+ },
2642
+ toProto(message: DelegationResponse): Uint8Array {
2643
+ return DelegationResponse.encode(message).finish();
2644
+ },
2645
+ toProtoMsg(message: DelegationResponse): DelegationResponseProtoMsg {
2646
+ return {
2647
+ typeUrl: "/cosmos.staking.v1beta1.DelegationResponse",
2648
+ value: DelegationResponse.encode(message).finish()
2649
+ };
2650
+ }
2651
+ };
2652
+ GlobalDecoderRegistry.register(DelegationResponse.typeUrl, DelegationResponse);
2653
+ GlobalDecoderRegistry.registerAminoProtoMapping(DelegationResponse.aminoType, DelegationResponse.typeUrl);
2654
+ function createBaseRedelegationEntryResponse(): RedelegationEntryResponse {
2655
+ return {
2656
+ redelegationEntry: RedelegationEntry.fromPartial({}),
2657
+ balance: ""
2658
+ };
2659
+ }
2660
+ export const RedelegationEntryResponse = {
2661
+ typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse",
2662
+ aminoType: "cosmos-sdk/RedelegationEntryResponse",
2663
+ is(o: any): o is RedelegationEntryResponse {
2664
+ return o && (o.$typeUrl === RedelegationEntryResponse.typeUrl || RedelegationEntry.is(o.redelegationEntry) && typeof o.balance === "string");
2665
+ },
2666
+ isAmino(o: any): o is RedelegationEntryResponseAmino {
2667
+ return o && (o.$typeUrl === RedelegationEntryResponse.typeUrl || RedelegationEntry.isAmino(o.redelegation_entry) && typeof o.balance === "string");
2668
+ },
2669
+ encode(message: RedelegationEntryResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
2670
+ if (message.redelegationEntry !== undefined) {
2671
+ RedelegationEntry.encode(message.redelegationEntry, writer.uint32(10).fork()).ldelim();
2672
+ }
2673
+ if (message.balance !== "") {
2674
+ writer.uint32(34).string(message.balance);
2675
+ }
2676
+ return writer;
2677
+ },
2678
+ decode(input: BinaryReader | Uint8Array, length?: number): RedelegationEntryResponse {
2679
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2680
+ let end = length === undefined ? reader.len : reader.pos + length;
2681
+ const message = createBaseRedelegationEntryResponse();
2682
+ while (reader.pos < end) {
2683
+ const tag = reader.uint32();
2684
+ switch (tag >>> 3) {
2685
+ case 1:
2686
+ message.redelegationEntry = RedelegationEntry.decode(reader, reader.uint32());
2687
+ break;
2688
+ case 4:
2689
+ message.balance = reader.string();
2690
+ break;
2691
+ default:
2692
+ reader.skipType(tag & 7);
2693
+ break;
2694
+ }
2695
+ }
2696
+ return message;
2697
+ },
2698
+ fromPartial(object: DeepPartial<RedelegationEntryResponse>): RedelegationEntryResponse {
2699
+ const message = createBaseRedelegationEntryResponse();
2700
+ message.redelegationEntry = object.redelegationEntry !== undefined && object.redelegationEntry !== null ? RedelegationEntry.fromPartial(object.redelegationEntry) : undefined;
2701
+ message.balance = object.balance ?? "";
2702
+ return message;
2703
+ },
2704
+ fromAmino(object: RedelegationEntryResponseAmino): RedelegationEntryResponse {
2705
+ const message = createBaseRedelegationEntryResponse();
2706
+ if (object.redelegation_entry !== undefined && object.redelegation_entry !== null) {
2707
+ message.redelegationEntry = RedelegationEntry.fromAmino(object.redelegation_entry);
2708
+ }
2709
+ if (object.balance !== undefined && object.balance !== null) {
2710
+ message.balance = object.balance;
2711
+ }
2712
+ return message;
2713
+ },
2714
+ toAmino(message: RedelegationEntryResponse): RedelegationEntryResponseAmino {
2715
+ const obj: any = {};
2716
+ obj.redelegation_entry = message.redelegationEntry ? RedelegationEntry.toAmino(message.redelegationEntry) : RedelegationEntry.toAmino(RedelegationEntry.fromPartial({}));
2717
+ obj.balance = message.balance === "" ? undefined : message.balance;
2718
+ return obj;
2719
+ },
2720
+ fromAminoMsg(object: RedelegationEntryResponseAminoMsg): RedelegationEntryResponse {
2721
+ return RedelegationEntryResponse.fromAmino(object.value);
2722
+ },
2723
+ toAminoMsg(message: RedelegationEntryResponse): RedelegationEntryResponseAminoMsg {
2724
+ return {
2725
+ type: "cosmos-sdk/RedelegationEntryResponse",
2726
+ value: RedelegationEntryResponse.toAmino(message)
2727
+ };
2728
+ },
2729
+ fromProtoMsg(message: RedelegationEntryResponseProtoMsg): RedelegationEntryResponse {
2730
+ return RedelegationEntryResponse.decode(message.value);
2731
+ },
2732
+ toProto(message: RedelegationEntryResponse): Uint8Array {
2733
+ return RedelegationEntryResponse.encode(message).finish();
2734
+ },
2735
+ toProtoMsg(message: RedelegationEntryResponse): RedelegationEntryResponseProtoMsg {
2736
+ return {
2737
+ typeUrl: "/cosmos.staking.v1beta1.RedelegationEntryResponse",
2738
+ value: RedelegationEntryResponse.encode(message).finish()
2739
+ };
2740
+ }
2741
+ };
2742
+ GlobalDecoderRegistry.register(RedelegationEntryResponse.typeUrl, RedelegationEntryResponse);
2743
+ GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationEntryResponse.aminoType, RedelegationEntryResponse.typeUrl);
2744
+ function createBaseRedelegationResponse(): RedelegationResponse {
2745
+ return {
2746
+ redelegation: Redelegation.fromPartial({}),
2747
+ entries: []
2748
+ };
2749
+ }
2750
+ export const RedelegationResponse = {
2751
+ typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse",
2752
+ aminoType: "cosmos-sdk/RedelegationResponse",
2753
+ is(o: any): o is RedelegationResponse {
2754
+ return o && (o.$typeUrl === RedelegationResponse.typeUrl || Redelegation.is(o.redelegation) && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntryResponse.is(o.entries[0])));
2755
+ },
2756
+ isAmino(o: any): o is RedelegationResponseAmino {
2757
+ return o && (o.$typeUrl === RedelegationResponse.typeUrl || Redelegation.isAmino(o.redelegation) && Array.isArray(o.entries) && (!o.entries.length || RedelegationEntryResponse.isAmino(o.entries[0])));
2758
+ },
2759
+ encode(message: RedelegationResponse, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
2760
+ if (message.redelegation !== undefined) {
2761
+ Redelegation.encode(message.redelegation, writer.uint32(10).fork()).ldelim();
2762
+ }
2763
+ for (const v of message.entries) {
2764
+ RedelegationEntryResponse.encode(v!, writer.uint32(18).fork()).ldelim();
2765
+ }
2766
+ return writer;
2767
+ },
2768
+ decode(input: BinaryReader | Uint8Array, length?: number): RedelegationResponse {
2769
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2770
+ let end = length === undefined ? reader.len : reader.pos + length;
2771
+ const message = createBaseRedelegationResponse();
2772
+ while (reader.pos < end) {
2773
+ const tag = reader.uint32();
2774
+ switch (tag >>> 3) {
2775
+ case 1:
2776
+ message.redelegation = Redelegation.decode(reader, reader.uint32());
2777
+ break;
2778
+ case 2:
2779
+ message.entries.push(RedelegationEntryResponse.decode(reader, reader.uint32()));
2780
+ break;
2781
+ default:
2782
+ reader.skipType(tag & 7);
2783
+ break;
2784
+ }
2785
+ }
2786
+ return message;
2787
+ },
2788
+ fromPartial(object: DeepPartial<RedelegationResponse>): RedelegationResponse {
2789
+ const message = createBaseRedelegationResponse();
2790
+ message.redelegation = object.redelegation !== undefined && object.redelegation !== null ? Redelegation.fromPartial(object.redelegation) : undefined;
2791
+ message.entries = object.entries?.map(e => RedelegationEntryResponse.fromPartial(e)) || [];
2792
+ return message;
2793
+ },
2794
+ fromAmino(object: RedelegationResponseAmino): RedelegationResponse {
2795
+ const message = createBaseRedelegationResponse();
2796
+ if (object.redelegation !== undefined && object.redelegation !== null) {
2797
+ message.redelegation = Redelegation.fromAmino(object.redelegation);
2798
+ }
2799
+ message.entries = object.entries?.map(e => RedelegationEntryResponse.fromAmino(e)) || [];
2800
+ return message;
2801
+ },
2802
+ toAmino(message: RedelegationResponse): RedelegationResponseAmino {
2803
+ const obj: any = {};
2804
+ obj.redelegation = message.redelegation ? Redelegation.toAmino(message.redelegation) : Redelegation.toAmino(Redelegation.fromPartial({}));
2805
+ if (message.entries) {
2806
+ obj.entries = message.entries.map(e => e ? RedelegationEntryResponse.toAmino(e) : undefined);
2807
+ } else {
2808
+ obj.entries = message.entries;
2809
+ }
2810
+ return obj;
2811
+ },
2812
+ fromAminoMsg(object: RedelegationResponseAminoMsg): RedelegationResponse {
2813
+ return RedelegationResponse.fromAmino(object.value);
2814
+ },
2815
+ toAminoMsg(message: RedelegationResponse): RedelegationResponseAminoMsg {
2816
+ return {
2817
+ type: "cosmos-sdk/RedelegationResponse",
2818
+ value: RedelegationResponse.toAmino(message)
2819
+ };
2820
+ },
2821
+ fromProtoMsg(message: RedelegationResponseProtoMsg): RedelegationResponse {
2822
+ return RedelegationResponse.decode(message.value);
2823
+ },
2824
+ toProto(message: RedelegationResponse): Uint8Array {
2825
+ return RedelegationResponse.encode(message).finish();
2826
+ },
2827
+ toProtoMsg(message: RedelegationResponse): RedelegationResponseProtoMsg {
2828
+ return {
2829
+ typeUrl: "/cosmos.staking.v1beta1.RedelegationResponse",
2830
+ value: RedelegationResponse.encode(message).finish()
2831
+ };
2832
+ }
2833
+ };
2834
+ GlobalDecoderRegistry.register(RedelegationResponse.typeUrl, RedelegationResponse);
2835
+ GlobalDecoderRegistry.registerAminoProtoMapping(RedelegationResponse.aminoType, RedelegationResponse.typeUrl);
2836
+ function createBasePool(): Pool {
2837
+ return {
2838
+ notBondedTokens: "",
2839
+ bondedTokens: ""
2840
+ };
2841
+ }
2842
+ export const Pool = {
2843
+ typeUrl: "/cosmos.staking.v1beta1.Pool",
2844
+ aminoType: "cosmos-sdk/Pool",
2845
+ is(o: any): o is Pool {
2846
+ return o && (o.$typeUrl === Pool.typeUrl || typeof o.notBondedTokens === "string" && typeof o.bondedTokens === "string");
2847
+ },
2848
+ isAmino(o: any): o is PoolAmino {
2849
+ return o && (o.$typeUrl === Pool.typeUrl || typeof o.not_bonded_tokens === "string" && typeof o.bonded_tokens === "string");
2850
+ },
2851
+ encode(message: Pool, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
2852
+ if (message.notBondedTokens !== "") {
2853
+ writer.uint32(10).string(message.notBondedTokens);
2854
+ }
2855
+ if (message.bondedTokens !== "") {
2856
+ writer.uint32(18).string(message.bondedTokens);
2857
+ }
2858
+ return writer;
2859
+ },
2860
+ decode(input: BinaryReader | Uint8Array, length?: number): Pool {
2861
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2862
+ let end = length === undefined ? reader.len : reader.pos + length;
2863
+ const message = createBasePool();
2864
+ while (reader.pos < end) {
2865
+ const tag = reader.uint32();
2866
+ switch (tag >>> 3) {
2867
+ case 1:
2868
+ message.notBondedTokens = reader.string();
2869
+ break;
2870
+ case 2:
2871
+ message.bondedTokens = reader.string();
2872
+ break;
2873
+ default:
2874
+ reader.skipType(tag & 7);
2875
+ break;
2876
+ }
2877
+ }
2878
+ return message;
2879
+ },
2880
+ fromPartial(object: DeepPartial<Pool>): Pool {
2881
+ const message = createBasePool();
2882
+ message.notBondedTokens = object.notBondedTokens ?? "";
2883
+ message.bondedTokens = object.bondedTokens ?? "";
2884
+ return message;
2885
+ },
2886
+ fromAmino(object: PoolAmino): Pool {
2887
+ const message = createBasePool();
2888
+ if (object.not_bonded_tokens !== undefined && object.not_bonded_tokens !== null) {
2889
+ message.notBondedTokens = object.not_bonded_tokens;
2890
+ }
2891
+ if (object.bonded_tokens !== undefined && object.bonded_tokens !== null) {
2892
+ message.bondedTokens = object.bonded_tokens;
2893
+ }
2894
+ return message;
2895
+ },
2896
+ toAmino(message: Pool): PoolAmino {
2897
+ const obj: any = {};
2898
+ obj.not_bonded_tokens = message.notBondedTokens ?? "";
2899
+ obj.bonded_tokens = message.bondedTokens ?? "";
2900
+ return obj;
2901
+ },
2902
+ fromAminoMsg(object: PoolAminoMsg): Pool {
2903
+ return Pool.fromAmino(object.value);
2904
+ },
2905
+ toAminoMsg(message: Pool): PoolAminoMsg {
2906
+ return {
2907
+ type: "cosmos-sdk/Pool",
2908
+ value: Pool.toAmino(message)
2909
+ };
2910
+ },
2911
+ fromProtoMsg(message: PoolProtoMsg): Pool {
2912
+ return Pool.decode(message.value);
2913
+ },
2914
+ toProto(message: Pool): Uint8Array {
2915
+ return Pool.encode(message).finish();
2916
+ },
2917
+ toProtoMsg(message: Pool): PoolProtoMsg {
2918
+ return {
2919
+ typeUrl: "/cosmos.staking.v1beta1.Pool",
2920
+ value: Pool.encode(message).finish()
2921
+ };
2922
+ }
2923
+ };
2924
+ GlobalDecoderRegistry.register(Pool.typeUrl, Pool);
2925
+ GlobalDecoderRegistry.registerAminoProtoMapping(Pool.aminoType, Pool.typeUrl);
2926
+ function createBaseValidatorUpdates(): ValidatorUpdates {
2927
+ return {
2928
+ updates: []
2929
+ };
2930
+ }
2931
+ export const ValidatorUpdates = {
2932
+ typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates",
2933
+ aminoType: "cosmos-sdk/ValidatorUpdates",
2934
+ is(o: any): o is ValidatorUpdates {
2935
+ return o && (o.$typeUrl === ValidatorUpdates.typeUrl || Array.isArray(o.updates) && (!o.updates.length || ValidatorUpdate.is(o.updates[0])));
2936
+ },
2937
+ isAmino(o: any): o is ValidatorUpdatesAmino {
2938
+ return o && (o.$typeUrl === ValidatorUpdates.typeUrl || Array.isArray(o.updates) && (!o.updates.length || ValidatorUpdate.isAmino(o.updates[0])));
2939
+ },
2940
+ encode(message: ValidatorUpdates, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
2941
+ for (const v of message.updates) {
2942
+ ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim();
2943
+ }
2944
+ return writer;
2945
+ },
2946
+ decode(input: BinaryReader | Uint8Array, length?: number): ValidatorUpdates {
2947
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
2948
+ let end = length === undefined ? reader.len : reader.pos + length;
2949
+ const message = createBaseValidatorUpdates();
2950
+ while (reader.pos < end) {
2951
+ const tag = reader.uint32();
2952
+ switch (tag >>> 3) {
2953
+ case 1:
2954
+ message.updates.push(ValidatorUpdate.decode(reader, reader.uint32()));
2955
+ break;
2956
+ default:
2957
+ reader.skipType(tag & 7);
2958
+ break;
2959
+ }
2960
+ }
2961
+ return message;
2962
+ },
2963
+ fromPartial(object: DeepPartial<ValidatorUpdates>): ValidatorUpdates {
2964
+ const message = createBaseValidatorUpdates();
2965
+ message.updates = object.updates?.map(e => ValidatorUpdate.fromPartial(e)) || [];
2966
+ return message;
2967
+ },
2968
+ fromAmino(object: ValidatorUpdatesAmino): ValidatorUpdates {
2969
+ const message = createBaseValidatorUpdates();
2970
+ message.updates = object.updates?.map(e => ValidatorUpdate.fromAmino(e)) || [];
2971
+ return message;
2972
+ },
2973
+ toAmino(message: ValidatorUpdates): ValidatorUpdatesAmino {
2974
+ const obj: any = {};
2975
+ if (message.updates) {
2976
+ obj.updates = message.updates.map(e => e ? ValidatorUpdate.toAmino(e) : undefined);
2977
+ } else {
2978
+ obj.updates = message.updates;
2979
+ }
2980
+ return obj;
2981
+ },
2982
+ fromAminoMsg(object: ValidatorUpdatesAminoMsg): ValidatorUpdates {
2983
+ return ValidatorUpdates.fromAmino(object.value);
2984
+ },
2985
+ toAminoMsg(message: ValidatorUpdates): ValidatorUpdatesAminoMsg {
2986
+ return {
2987
+ type: "cosmos-sdk/ValidatorUpdates",
2988
+ value: ValidatorUpdates.toAmino(message)
2989
+ };
2990
+ },
2991
+ fromProtoMsg(message: ValidatorUpdatesProtoMsg): ValidatorUpdates {
2992
+ return ValidatorUpdates.decode(message.value);
2993
+ },
2994
+ toProto(message: ValidatorUpdates): Uint8Array {
2995
+ return ValidatorUpdates.encode(message).finish();
2996
+ },
2997
+ toProtoMsg(message: ValidatorUpdates): ValidatorUpdatesProtoMsg {
2998
+ return {
2999
+ typeUrl: "/cosmos.staking.v1beta1.ValidatorUpdates",
3000
+ value: ValidatorUpdates.encode(message).finish()
3001
+ };
3002
+ }
3003
+ };
3004
+ GlobalDecoderRegistry.register(ValidatorUpdates.typeUrl, ValidatorUpdates);
3005
+ GlobalDecoderRegistry.registerAminoProtoMapping(ValidatorUpdates.aminoType, ValidatorUpdates.typeUrl);