decentralcardgame-cardchain-client-ts 0.0.13 → 0.0.15

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 (314) hide show
  1. package/DecentralCardGame.cardchain.cardchain/module.js +357 -334
  2. package/DecentralCardGame.cardchain.cardchain/module.ts +531 -498
  3. package/DecentralCardGame.cardchain.cardchain/registry.js +77 -75
  4. package/DecentralCardGame.cardchain.cardchain/registry.ts +77 -75
  5. package/DecentralCardGame.cardchain.cardchain/rest.js +31 -23
  6. package/DecentralCardGame.cardchain.cardchain/rest.ts +89 -62
  7. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/card.js +89 -0
  8. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/card.ts +95 -0
  9. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/genesis.js +11 -11
  10. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/genesis.ts +12 -12
  11. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/match.js +1 -1
  12. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/match.ts +1 -1
  13. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/params.js +58 -29
  14. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/params.ts +65 -33
  15. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/query.js +72 -66
  16. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/query.ts +99 -92
  17. package/DecentralCardGame.cardchain.cardchain/types/{cardchain/cardchain/collection.js → DecentralCardGame/cardchain/cardchain/set.js} +8 -8
  18. package/DecentralCardGame.cardchain.cardchain/types/{cardchain/cardchain/collection.ts → DecentralCardGame/cardchain/cardchain/set.ts} +20 -20
  19. package/DecentralCardGame.cardchain.cardchain/types/{cardchain/cardchain/collection_proposal.js → DecentralCardGame/cardchain/cardchain/set_proposal.js} +11 -11
  20. package/DecentralCardGame.cardchain.cardchain/types/{cardchain/cardchain/collection_proposal.ts → DecentralCardGame/cardchain/cardchain/set_proposal.ts} +18 -18
  21. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/tx.js +362 -261
  22. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/tx.ts +568 -466
  23. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/user.js +34 -8
  24. package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/user.ts +36 -9
  25. package/DecentralCardGame.cardchain.cardchain/types/amino/amino.js +2 -0
  26. package/DecentralCardGame.cardchain.cardchain/types/amino/amino.ts +2 -0
  27. package/DecentralCardGame.cardchain.cardchain/types.js +23 -23
  28. package/DecentralCardGame.cardchain.cardchain/types.ts +24 -24
  29. package/client.js +7 -7
  30. package/client.ts +10 -9
  31. package/cosmos.auth.v1beta1/module.js +2 -0
  32. package/cosmos.auth.v1beta1/module.ts +2 -0
  33. package/cosmos.auth.v1beta1/rest.js +18 -3
  34. package/cosmos.auth.v1beta1/rest.ts +113 -3
  35. package/cosmos.auth.v1beta1/types/amino/amino.js +2 -0
  36. package/cosmos.auth.v1beta1/types/amino/amino.ts +2 -0
  37. package/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/auth.js +84 -0
  38. package/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/auth.ts +104 -0
  39. package/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/genesis.ts +1 -1
  40. package/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/query.js +104 -3
  41. package/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/query.ts +157 -4
  42. package/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/tx.js +105 -0
  43. package/cosmos.auth.v1beta1/types/cosmos/auth/v1beta1/tx.ts +172 -0
  44. package/cosmos.auth.v1beta1/types/cosmos/msg/v1/msg.js +2 -0
  45. package/cosmos.auth.v1beta1/types/cosmos/msg/v1/msg.ts +2 -0
  46. package/cosmos.auth.v1beta1/types/cosmos/query/v1/query.js +2 -0
  47. package/cosmos.auth.v1beta1/types/cosmos/query/v1/query.ts +2 -0
  48. package/cosmos.auth.v1beta1/types.js +2 -1
  49. package/cosmos.auth.v1beta1/types.ts +2 -0
  50. package/cosmos.authz.v1beta1/module.js +19 -19
  51. package/cosmos.authz.v1beta1/module.ts +29 -29
  52. package/cosmos.authz.v1beta1/registry.js +2 -2
  53. package/cosmos.authz.v1beta1/registry.ts +2 -2
  54. package/cosmos.authz.v1beta1/types/amino/amino.js +2 -0
  55. package/cosmos.authz.v1beta1/types/amino/amino.ts +2 -0
  56. package/cosmos.authz.v1beta1/types/cosmos/authz/v1beta1/tx.ts +1 -1
  57. package/cosmos.bank.v1beta1/module.js +16 -16
  58. package/cosmos.bank.v1beta1/module.ts +24 -24
  59. package/cosmos.bank.v1beta1/registry.js +2 -2
  60. package/cosmos.bank.v1beta1/registry.ts +2 -2
  61. package/cosmos.bank.v1beta1/rest.js +37 -6
  62. package/cosmos.bank.v1beta1/rest.ts +99 -6
  63. package/cosmos.bank.v1beta1/types/amino/amino.js +2 -0
  64. package/cosmos.bank.v1beta1/types/amino/amino.ts +2 -0
  65. package/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/authz.js +18 -2
  66. package/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/authz.ts +24 -2
  67. package/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/bank.ts +9 -0
  68. package/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/genesis.js +18 -2
  69. package/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/genesis.ts +25 -4
  70. package/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/query.js +230 -1
  71. package/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/query.ts +356 -5
  72. package/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/tx.js +206 -1
  73. package/cosmos.bank.v1beta1/types/cosmos/bank/v1beta1/tx.ts +305 -1
  74. package/cosmos.bank.v1beta1/types/cosmos/query/v1/query.js +2 -0
  75. package/cosmos.bank.v1beta1/types/cosmos/query/v1/query.ts +2 -0
  76. package/cosmos.base.tendermint.v1beta1/rest.js +3 -3
  77. package/cosmos.base.tendermint.v1beta1/rest.ts +18 -27
  78. package/cosmos.base.tendermint.v1beta1/types/amino/amino.js +2 -0
  79. package/cosmos.base.tendermint.v1beta1/types/amino/amino.ts +2 -0
  80. package/cosmos.base.tendermint.v1beta1/types/cosmos/base/tendermint/v1beta1/query.ts +16 -46
  81. package/cosmos.consensus.v1/index.js +5 -0
  82. package/cosmos.consensus.v1/index.ts +6 -0
  83. package/cosmos.consensus.v1/module.js +81 -0
  84. package/cosmos.consensus.v1/module.ts +129 -0
  85. package/cosmos.consensus.v1/registry.js +5 -0
  86. package/cosmos.consensus.v1/registry.ts +9 -0
  87. package/cosmos.consensus.v1/rest.js +100 -0
  88. package/cosmos.consensus.v1/rest.ts +268 -0
  89. package/cosmos.consensus.v1/types/cosmos/consensus/v1/query.js +94 -0
  90. package/cosmos.consensus.v1/types/cosmos/consensus/v1/query.ts +147 -0
  91. package/cosmos.consensus.v1/types/cosmos/consensus/v1/tx.js +129 -0
  92. package/cosmos.consensus.v1/types/cosmos/consensus/v1/tx.ts +196 -0
  93. package/cosmos.consensus.v1/types/cosmos/msg/v1/msg.js +2 -0
  94. package/cosmos.consensus.v1/types/cosmos/msg/v1/msg.ts +2 -0
  95. package/cosmos.consensus.v1/types/cosmos_proto/cosmos.js +171 -0
  96. package/cosmos.consensus.v1/types/cosmos_proto/cosmos.ts +247 -0
  97. package/cosmos.consensus.v1/types/gogoproto/gogo.js +2 -0
  98. package/cosmos.consensus.v1/types/gogoproto/gogo.ts +2 -0
  99. package/cosmos.consensus.v1/types/google/api/annotations.js +2 -0
  100. package/cosmos.consensus.v1/types/google/api/annotations.ts +2 -0
  101. package/cosmos.consensus.v1/types/google/api/http.js +260 -0
  102. package/cosmos.consensus.v1/types/google/api/http.ts +589 -0
  103. package/cosmos.consensus.v1/types/google/protobuf/descriptor.js +2830 -0
  104. package/cosmos.consensus.v1/types/google/protobuf/descriptor.ts +3753 -0
  105. package/cosmos.consensus.v1/types/google/protobuf/duration.js +84 -0
  106. package/cosmos.consensus.v1/types/google/protobuf/duration.ts +187 -0
  107. package/cosmos.consensus.v1/types/tendermint/types/params.js +369 -0
  108. package/cosmos.consensus.v1/types/tendermint/types/params.ts +498 -0
  109. package/cosmos.consensus.v1/types.js +1 -0
  110. package/cosmos.consensus.v1/types.ts +5 -0
  111. package/cosmos.crisis.v1beta1/module.js +24 -1
  112. package/cosmos.crisis.v1beta1/module.ts +34 -1
  113. package/cosmos.crisis.v1beta1/registry.js +2 -0
  114. package/cosmos.crisis.v1beta1/registry.ts +2 -0
  115. package/cosmos.crisis.v1beta1/rest.ts +19 -0
  116. package/cosmos.crisis.v1beta1/types/amino/amino.js +2 -0
  117. package/cosmos.crisis.v1beta1/types/amino/amino.ts +2 -0
  118. package/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/tx.js +95 -0
  119. package/cosmos.crisis.v1beta1/types/cosmos/crisis/v1beta1/tx.ts +140 -1
  120. package/cosmos.distribution.v1beta1/module.js +67 -21
  121. package/cosmos.distribution.v1beta1/module.ts +100 -34
  122. package/cosmos.distribution.v1beta1/registry.js +8 -4
  123. package/cosmos.distribution.v1beta1/registry.ts +8 -4
  124. package/cosmos.distribution.v1beta1/rest.js +14 -0
  125. package/cosmos.distribution.v1beta1/rest.ts +66 -7
  126. package/cosmos.distribution.v1beta1/types/amino/amino.js +2 -0
  127. package/cosmos.distribution.v1beta1/types/amino/amino.ts +2 -0
  128. package/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/distribution.ts +19 -0
  129. package/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/genesis.ts +4 -4
  130. package/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/query.js +120 -0
  131. package/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/query.ts +158 -1
  132. package/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/tx.js +199 -0
  133. package/cosmos.distribution.v1beta1/types/cosmos/distribution/v1beta1/tx.ts +300 -3
  134. package/cosmos.evidence.v1beta1/rest.js +4 -3
  135. package/cosmos.evidence.v1beta1/rest.ts +4 -3
  136. package/cosmos.evidence.v1beta1/types/amino/amino.js +2 -0
  137. package/cosmos.evidence.v1beta1/types/amino/amino.ts +2 -0
  138. package/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/evidence.ts +7 -1
  139. package/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/query.js +13 -2
  140. package/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/query.ts +25 -3
  141. package/cosmos.evidence.v1beta1/types/cosmos/evidence/v1beta1/tx.ts +2 -0
  142. package/cosmos.feegrant.v1beta1/types/amino/amino.js +2 -0
  143. package/cosmos.feegrant.v1beta1/types/amino/amino.ts +2 -0
  144. package/cosmos.gov.v1/module.js +46 -21
  145. package/cosmos.gov.v1/module.ts +68 -33
  146. package/cosmos.gov.v1/registry.js +6 -4
  147. package/cosmos.gov.v1/registry.ts +6 -4
  148. package/cosmos.gov.v1/rest.ts +155 -41
  149. package/cosmos.gov.v1/types/amino/amino.js +2 -0
  150. package/cosmos.gov.v1/types/amino/amino.ts +2 -0
  151. package/cosmos.gov.v1/types/cosmos/gov/v1/genesis.js +13 -1
  152. package/cosmos.gov.v1/types/cosmos/gov/v1/genesis.ts +40 -5
  153. package/cosmos.gov.v1/types/cosmos/gov/v1/gov.js +179 -0
  154. package/cosmos.gov.v1/types/cosmos/gov/v1/gov.ts +277 -6
  155. package/cosmos.gov.v1/types/cosmos/gov/v1/query.js +13 -2
  156. package/cosmos.gov.v1/types/cosmos/gov/v1/query.ts +45 -7
  157. package/cosmos.gov.v1/types/cosmos/gov/v1/tx.js +113 -2
  158. package/cosmos.gov.v1/types/cosmos/gov/v1/tx.ts +186 -3
  159. package/cosmos.gov.v1/types.js +2 -1
  160. package/cosmos.gov.v1/types.ts +2 -0
  161. package/cosmos.gov.v1beta1/module.js +24 -24
  162. package/cosmos.gov.v1beta1/module.ts +36 -36
  163. package/cosmos.gov.v1beta1/registry.js +4 -4
  164. package/cosmos.gov.v1beta1/registry.ts +4 -4
  165. package/cosmos.gov.v1beta1/rest.ts +65 -96
  166. package/cosmos.gov.v1beta1/types/amino/amino.js +2 -0
  167. package/cosmos.gov.v1beta1/types/amino/amino.ts +2 -0
  168. package/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/genesis.ts +3 -3
  169. package/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/gov.ts +45 -10
  170. package/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/query.ts +4 -2
  171. package/cosmos.gov.v1beta1/types/cosmos/gov/v1beta1/tx.ts +16 -1
  172. package/cosmos.group.v1/module.js +92 -92
  173. package/cosmos.group.v1/module.ts +138 -138
  174. package/cosmos.group.v1/registry.js +16 -16
  175. package/cosmos.group.v1/registry.ts +16 -16
  176. package/cosmos.group.v1/rest.js +3 -3
  177. package/cosmos.group.v1/rest.ts +29 -9
  178. package/cosmos.group.v1/types/amino/amino.js +2 -0
  179. package/cosmos.group.v1/types/amino/amino.ts +2 -0
  180. package/cosmos.group.v1/types/cosmos/group/v1/query.ts +5 -5
  181. package/cosmos.group.v1/types/cosmos/group/v1/tx.js +52 -34
  182. package/cosmos.group.v1/types/cosmos/group/v1/tx.ts +79 -49
  183. package/cosmos.group.v1/types/cosmos/group/v1/types.js +20 -0
  184. package/cosmos.group.v1/types/cosmos/group/v1/types.ts +46 -6
  185. package/cosmos.mint.v1beta1/rest.ts +9 -1
  186. package/cosmos.mint.v1beta1/types/amino/amino.js +2 -0
  187. package/cosmos.mint.v1beta1/types/amino/amino.ts +2 -0
  188. package/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/genesis.ts +1 -1
  189. package/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/mint.ts +1 -1
  190. package/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/tx.js +105 -0
  191. package/cosmos.mint.v1beta1/types/cosmos/mint/v1beta1/tx.ts +172 -0
  192. package/cosmos.mint.v1beta1/types/cosmos/msg/v1/msg.js +2 -0
  193. package/cosmos.mint.v1beta1/types/cosmos/msg/v1/msg.ts +2 -0
  194. package/cosmos.nft.v1beta1/rest.ts +18 -22
  195. package/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/event.ts +10 -0
  196. package/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/genesis.ts +1 -0
  197. package/cosmos.nft.v1beta1/types/cosmos/nft/v1beta1/query.ts +20 -0
  198. package/cosmos.nft.v1beta1/types/cosmos_proto/cosmos.js +171 -0
  199. package/cosmos.nft.v1beta1/types/cosmos_proto/cosmos.ts +247 -0
  200. package/cosmos.params.v1beta1/types/amino/amino.js +2 -0
  201. package/cosmos.params.v1beta1/types/amino/amino.ts +2 -0
  202. package/cosmos.slashing.v1beta1/rest.ts +8 -0
  203. package/cosmos.slashing.v1beta1/types/amino/amino.js +2 -0
  204. package/cosmos.slashing.v1beta1/types/amino/amino.ts +2 -0
  205. package/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/genesis.ts +1 -1
  206. package/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/tx.js +94 -0
  207. package/cosmos.slashing.v1beta1/types/cosmos/slashing/v1beta1/tx.ts +139 -0
  208. package/cosmos.staking.v1beta1/module.js +41 -39
  209. package/cosmos.staking.v1beta1/module.ts +61 -59
  210. package/cosmos.staking.v1beta1/registry.js +6 -6
  211. package/cosmos.staking.v1beta1/registry.ts +6 -6
  212. package/cosmos.staking.v1beta1/rest.js +7 -7
  213. package/cosmos.staking.v1beta1/rest.ts +49 -8
  214. package/cosmos.staking.v1beta1/types/amino/amino.js +2 -0
  215. package/cosmos.staking.v1beta1/types/amino/amino.ts +2 -0
  216. package/cosmos.staking.v1beta1/types/cosmos/query/v1/query.js +2 -0
  217. package/cosmos.staking.v1beta1/types/cosmos/query/v1/query.ts +2 -0
  218. package/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/genesis.ts +1 -1
  219. package/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/query.ts +36 -5
  220. package/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/staking.js +180 -2
  221. package/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/staking.ts +206 -3
  222. package/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/tx.js +94 -1
  223. package/cosmos.staking.v1beta1/types/cosmos/staking/v1beta1/tx.ts +138 -1
  224. package/cosmos.staking.v1beta1/types/tendermint/abci/types.js +3812 -0
  225. package/cosmos.staking.v1beta1/types/tendermint/abci/types.ts +4525 -0
  226. package/cosmos.staking.v1beta1/types/tendermint/types/params.js +369 -0
  227. package/cosmos.staking.v1beta1/types/tendermint/types/params.ts +498 -0
  228. package/cosmos.staking.v1beta1/types.js +2 -1
  229. package/cosmos.staking.v1beta1/types.ts +2 -0
  230. package/cosmos.tx.v1beta1/rest.js +66 -2
  231. package/cosmos.tx.v1beta1/rest.ts +177 -16
  232. package/cosmos.tx.v1beta1/types/amino/amino.js +2 -0
  233. package/cosmos.tx.v1beta1/types/amino/amino.ts +2 -0
  234. package/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/service.js +360 -2
  235. package/cosmos.tx.v1beta1/types/cosmos/tx/v1beta1/service.ts +524 -2
  236. package/cosmos.tx.v1beta1/types/tendermint/abci/types.js +592 -266
  237. package/cosmos.tx.v1beta1/types/tendermint/abci/types.ts +703 -332
  238. package/cosmos.tx.v1beta1/types/tendermint/types/params.js +8 -17
  239. package/cosmos.tx.v1beta1/types/tendermint/types/params.ts +9 -25
  240. package/cosmos.upgrade.v1beta1/rest.ts +0 -1
  241. package/cosmos.upgrade.v1beta1/types/amino/amino.js +2 -0
  242. package/cosmos.upgrade.v1beta1/types/amino/amino.ts +2 -0
  243. package/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/tx.ts +3 -3
  244. package/cosmos.upgrade.v1beta1/types/cosmos/upgrade/v1beta1/upgrade.ts +6 -4
  245. package/cosmos.vesting.v1beta1/types/amino/amino.js +2 -0
  246. package/cosmos.vesting.v1beta1/types/amino/amino.ts +2 -0
  247. package/cosmos.vesting.v1beta1/types/cosmos/auth/v1beta1/auth.js +84 -0
  248. package/cosmos.vesting.v1beta1/types/cosmos/auth/v1beta1/auth.ts +104 -0
  249. package/ibc.applications.interchain_accounts.controller.v1/rest.ts +1 -0
  250. package/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/controller/v1/tx.js +13 -2
  251. package/ibc.applications.interchain_accounts.controller.v1/types/ibc/applications/interchain_accounts/controller/v1/tx.ts +16 -4
  252. package/ibc.applications.transfer.v1/module.js +5 -27
  253. package/ibc.applications.transfer.v1/module.ts +5 -34
  254. package/ibc.applications.transfer.v1/registry.js +1 -4
  255. package/ibc.applications.transfer.v1/registry.ts +0 -2
  256. package/ibc.applications.transfer.v1/rest.js +15 -1
  257. package/ibc.applications.transfer.v1/rest.ts +30 -1
  258. package/ibc.applications.transfer.v1/types/amino/amino.js +2 -0
  259. package/ibc.applications.transfer.v1/types/amino/amino.ts +2 -0
  260. package/ibc.applications.transfer.v1/types/cosmos/upgrade/v1beta1/upgrade.ts +6 -4
  261. package/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/authz.js +135 -0
  262. package/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/authz.ts +178 -0
  263. package/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/genesis.js +16 -1
  264. package/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/genesis.ts +23 -2
  265. package/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/query.js +91 -0
  266. package/ibc.applications.transfer.v1/types/ibc/applications/transfer/v1/query.ts +120 -0
  267. package/ibc.applications.transfer.v1/types/ibc/core/client/v1/client.ts +5 -1
  268. package/ibc.applications.transfer.v1/types.js +3 -1
  269. package/ibc.applications.transfer.v1/types.ts +4 -0
  270. package/ibc.core.channel.v1/rest.ts +1 -0
  271. package/ibc.core.channel.v1/types/amino/amino.js +2 -0
  272. package/ibc.core.channel.v1/types/amino/amino.ts +2 -0
  273. package/ibc.core.channel.v1/types/cosmos/upgrade/v1beta1/upgrade.ts +6 -4
  274. package/ibc.core.channel.v1/types/ibc/core/channel/v1/tx.js +13 -2
  275. package/ibc.core.channel.v1/types/ibc/core/channel/v1/tx.ts +14 -2
  276. package/ibc.core.channel.v1/types/ibc/core/client/v1/client.ts +5 -1
  277. package/ibc.core.client.v1/rest.ts +5 -1
  278. package/ibc.core.client.v1/types/amino/amino.js +2 -0
  279. package/ibc.core.client.v1/types/amino/amino.ts +2 -0
  280. package/ibc.core.client.v1/types/cosmos/upgrade/v1beta1/upgrade.ts +6 -4
  281. package/ibc.core.client.v1/types/ibc/core/client/v1/client.ts +5 -1
  282. package/ibc.core.client.v1/types/ibc/core/client/v1/tx.js +9 -8
  283. package/ibc.core.client.v1/types/ibc/core/client/v1/tx.ts +28 -14
  284. package/ibc.core.connection.v1/types/amino/amino.js +2 -0
  285. package/ibc.core.connection.v1/types/amino/amino.ts +2 -0
  286. package/ibc.core.connection.v1/types/{proofs.js → cosmos/ics23/v1/proofs.js} +1 -1
  287. package/ibc.core.connection.v1/types/{proofs.ts → cosmos/ics23/v1/proofs.ts} +1 -1
  288. package/ibc.core.connection.v1/types/cosmos/upgrade/v1beta1/upgrade.ts +6 -4
  289. package/ibc.core.connection.v1/types/ibc/core/client/v1/client.ts +5 -1
  290. package/ibc.core.connection.v1/types/ibc/core/commitment/v1/commitment.js +1 -1
  291. package/ibc.core.connection.v1/types/ibc/core/commitment/v1/commitment.ts +1 -1
  292. package/ibc.core.connection.v1/types/ibc/core/connection/v1/tx.js +26 -0
  293. package/ibc.core.connection.v1/types/ibc/core/connection/v1/tx.ts +34 -0
  294. package/index.js +3 -1
  295. package/index.ts +3 -1
  296. package/package.json +5 -6
  297. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/copyright_proposal.js +0 -0
  298. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/copyright_proposal.ts +0 -0
  299. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/council.js +0 -0
  300. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/council.ts +0 -0
  301. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/image.js +0 -0
  302. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/image.ts +0 -0
  303. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/match_reporter_proposal.js +0 -0
  304. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/match_reporter_proposal.ts +0 -0
  305. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/num.js +0 -0
  306. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/num.ts +0 -0
  307. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/running_average.js +0 -0
  308. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/running_average.ts +0 -0
  309. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/sell_offer.js +0 -0
  310. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/sell_offer.ts +0 -0
  311. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/server.js +0 -0
  312. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain → DecentralCardGame/cardchain}/cardchain/server.ts +0 -0
  313. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain/cardchain/voteing.js → DecentralCardGame/cardchain/cardchain/voting.js} +0 -0
  314. /package/DecentralCardGame.cardchain.cardchain/types/{cardchain/cardchain/voteing.ts → DecentralCardGame/cardchain/cardchain/voting.ts} +0 -0
@@ -0,0 +1,4525 @@
1
+ /* eslint-disable */
2
+ import Long from "long";
3
+ import _m0 from "protobufjs/minimal";
4
+ import { Timestamp } from "../../google/protobuf/timestamp";
5
+ import { PublicKey } from "../crypto/keys";
6
+ import { ProofOps } from "../crypto/proof";
7
+ import { ConsensusParams } from "../types/params";
8
+ import { Header } from "../types/types";
9
+
10
+ export const protobufPackage = "tendermint.abci";
11
+
12
+ export enum CheckTxType {
13
+ NEW = 0,
14
+ RECHECK = 1,
15
+ UNRECOGNIZED = -1,
16
+ }
17
+
18
+ export function checkTxTypeFromJSON(object: any): CheckTxType {
19
+ switch (object) {
20
+ case 0:
21
+ case "NEW":
22
+ return CheckTxType.NEW;
23
+ case 1:
24
+ case "RECHECK":
25
+ return CheckTxType.RECHECK;
26
+ case -1:
27
+ case "UNRECOGNIZED":
28
+ default:
29
+ return CheckTxType.UNRECOGNIZED;
30
+ }
31
+ }
32
+
33
+ export function checkTxTypeToJSON(object: CheckTxType): string {
34
+ switch (object) {
35
+ case CheckTxType.NEW:
36
+ return "NEW";
37
+ case CheckTxType.RECHECK:
38
+ return "RECHECK";
39
+ case CheckTxType.UNRECOGNIZED:
40
+ default:
41
+ return "UNRECOGNIZED";
42
+ }
43
+ }
44
+
45
+ export enum MisbehaviorType {
46
+ UNKNOWN = 0,
47
+ DUPLICATE_VOTE = 1,
48
+ LIGHT_CLIENT_ATTACK = 2,
49
+ UNRECOGNIZED = -1,
50
+ }
51
+
52
+ export function misbehaviorTypeFromJSON(object: any): MisbehaviorType {
53
+ switch (object) {
54
+ case 0:
55
+ case "UNKNOWN":
56
+ return MisbehaviorType.UNKNOWN;
57
+ case 1:
58
+ case "DUPLICATE_VOTE":
59
+ return MisbehaviorType.DUPLICATE_VOTE;
60
+ case 2:
61
+ case "LIGHT_CLIENT_ATTACK":
62
+ return MisbehaviorType.LIGHT_CLIENT_ATTACK;
63
+ case -1:
64
+ case "UNRECOGNIZED":
65
+ default:
66
+ return MisbehaviorType.UNRECOGNIZED;
67
+ }
68
+ }
69
+
70
+ export function misbehaviorTypeToJSON(object: MisbehaviorType): string {
71
+ switch (object) {
72
+ case MisbehaviorType.UNKNOWN:
73
+ return "UNKNOWN";
74
+ case MisbehaviorType.DUPLICATE_VOTE:
75
+ return "DUPLICATE_VOTE";
76
+ case MisbehaviorType.LIGHT_CLIENT_ATTACK:
77
+ return "LIGHT_CLIENT_ATTACK";
78
+ case MisbehaviorType.UNRECOGNIZED:
79
+ default:
80
+ return "UNRECOGNIZED";
81
+ }
82
+ }
83
+
84
+ export interface Request {
85
+ echo: RequestEcho | undefined;
86
+ flush: RequestFlush | undefined;
87
+ info: RequestInfo | undefined;
88
+ initChain: RequestInitChain | undefined;
89
+ query: RequestQuery | undefined;
90
+ beginBlock: RequestBeginBlock | undefined;
91
+ checkTx: RequestCheckTx | undefined;
92
+ deliverTx: RequestDeliverTx | undefined;
93
+ endBlock: RequestEndBlock | undefined;
94
+ commit: RequestCommit | undefined;
95
+ listSnapshots: RequestListSnapshots | undefined;
96
+ offerSnapshot: RequestOfferSnapshot | undefined;
97
+ loadSnapshotChunk: RequestLoadSnapshotChunk | undefined;
98
+ applySnapshotChunk: RequestApplySnapshotChunk | undefined;
99
+ prepareProposal: RequestPrepareProposal | undefined;
100
+ processProposal: RequestProcessProposal | undefined;
101
+ }
102
+
103
+ export interface RequestEcho {
104
+ message: string;
105
+ }
106
+
107
+ export interface RequestFlush {
108
+ }
109
+
110
+ export interface RequestInfo {
111
+ version: string;
112
+ blockVersion: number;
113
+ p2pVersion: number;
114
+ abciVersion: string;
115
+ }
116
+
117
+ export interface RequestInitChain {
118
+ time: Date | undefined;
119
+ chainId: string;
120
+ consensusParams: ConsensusParams | undefined;
121
+ validators: ValidatorUpdate[];
122
+ appStateBytes: Uint8Array;
123
+ initialHeight: number;
124
+ }
125
+
126
+ export interface RequestQuery {
127
+ data: Uint8Array;
128
+ path: string;
129
+ height: number;
130
+ prove: boolean;
131
+ }
132
+
133
+ export interface RequestBeginBlock {
134
+ hash: Uint8Array;
135
+ header: Header | undefined;
136
+ lastCommitInfo: CommitInfo | undefined;
137
+ byzantineValidators: Misbehavior[];
138
+ }
139
+
140
+ export interface RequestCheckTx {
141
+ tx: Uint8Array;
142
+ type: CheckTxType;
143
+ }
144
+
145
+ export interface RequestDeliverTx {
146
+ tx: Uint8Array;
147
+ }
148
+
149
+ export interface RequestEndBlock {
150
+ height: number;
151
+ }
152
+
153
+ export interface RequestCommit {
154
+ }
155
+
156
+ /** lists available snapshots */
157
+ export interface RequestListSnapshots {
158
+ }
159
+
160
+ /** offers a snapshot to the application */
161
+ export interface RequestOfferSnapshot {
162
+ /** snapshot offered by peers */
163
+ snapshot:
164
+ | Snapshot
165
+ | undefined;
166
+ /** light client-verified app hash for snapshot height */
167
+ appHash: Uint8Array;
168
+ }
169
+
170
+ /** loads a snapshot chunk */
171
+ export interface RequestLoadSnapshotChunk {
172
+ height: number;
173
+ format: number;
174
+ chunk: number;
175
+ }
176
+
177
+ /** Applies a snapshot chunk */
178
+ export interface RequestApplySnapshotChunk {
179
+ index: number;
180
+ chunk: Uint8Array;
181
+ sender: string;
182
+ }
183
+
184
+ export interface RequestPrepareProposal {
185
+ /** the modified transactions cannot exceed this size. */
186
+ maxTxBytes: number;
187
+ /**
188
+ * txs is an array of transactions that will be included in a block,
189
+ * sent to the app for possible modifications.
190
+ */
191
+ txs: Uint8Array[];
192
+ localLastCommit: ExtendedCommitInfo | undefined;
193
+ misbehavior: Misbehavior[];
194
+ height: number;
195
+ time: Date | undefined;
196
+ nextValidatorsHash: Uint8Array;
197
+ /** address of the public key of the validator proposing the block. */
198
+ proposerAddress: Uint8Array;
199
+ }
200
+
201
+ export interface RequestProcessProposal {
202
+ txs: Uint8Array[];
203
+ proposedLastCommit: CommitInfo | undefined;
204
+ misbehavior: Misbehavior[];
205
+ /** hash is the merkle root hash of the fields of the proposed block. */
206
+ hash: Uint8Array;
207
+ height: number;
208
+ time: Date | undefined;
209
+ nextValidatorsHash: Uint8Array;
210
+ /** address of the public key of the original proposer of the block. */
211
+ proposerAddress: Uint8Array;
212
+ }
213
+
214
+ export interface Response {
215
+ exception: ResponseException | undefined;
216
+ echo: ResponseEcho | undefined;
217
+ flush: ResponseFlush | undefined;
218
+ info: ResponseInfo | undefined;
219
+ initChain: ResponseInitChain | undefined;
220
+ query: ResponseQuery | undefined;
221
+ beginBlock: ResponseBeginBlock | undefined;
222
+ checkTx: ResponseCheckTx | undefined;
223
+ deliverTx: ResponseDeliverTx | undefined;
224
+ endBlock: ResponseEndBlock | undefined;
225
+ commit: ResponseCommit | undefined;
226
+ listSnapshots: ResponseListSnapshots | undefined;
227
+ offerSnapshot: ResponseOfferSnapshot | undefined;
228
+ loadSnapshotChunk: ResponseLoadSnapshotChunk | undefined;
229
+ applySnapshotChunk: ResponseApplySnapshotChunk | undefined;
230
+ prepareProposal: ResponsePrepareProposal | undefined;
231
+ processProposal: ResponseProcessProposal | undefined;
232
+ }
233
+
234
+ /** nondeterministic */
235
+ export interface ResponseException {
236
+ error: string;
237
+ }
238
+
239
+ export interface ResponseEcho {
240
+ message: string;
241
+ }
242
+
243
+ export interface ResponseFlush {
244
+ }
245
+
246
+ export interface ResponseInfo {
247
+ data: string;
248
+ version: string;
249
+ appVersion: number;
250
+ lastBlockHeight: number;
251
+ lastBlockAppHash: Uint8Array;
252
+ }
253
+
254
+ export interface ResponseInitChain {
255
+ consensusParams: ConsensusParams | undefined;
256
+ validators: ValidatorUpdate[];
257
+ appHash: Uint8Array;
258
+ }
259
+
260
+ export interface ResponseQuery {
261
+ code: number;
262
+ /** bytes data = 2; // use "value" instead. */
263
+ log: string;
264
+ /** nondeterministic */
265
+ info: string;
266
+ index: number;
267
+ key: Uint8Array;
268
+ value: Uint8Array;
269
+ proofOps: ProofOps | undefined;
270
+ height: number;
271
+ codespace: string;
272
+ }
273
+
274
+ export interface ResponseBeginBlock {
275
+ events: Event[];
276
+ }
277
+
278
+ export interface ResponseCheckTx {
279
+ code: number;
280
+ data: Uint8Array;
281
+ /** nondeterministic */
282
+ log: string;
283
+ /** nondeterministic */
284
+ info: string;
285
+ gasWanted: number;
286
+ gasUsed: number;
287
+ events: Event[];
288
+ codespace: string;
289
+ sender: string;
290
+ priority: number;
291
+ /**
292
+ * mempool_error is set by CometBFT.
293
+ * ABCI applictions creating a ResponseCheckTX should not set mempool_error.
294
+ */
295
+ mempoolError: string;
296
+ }
297
+
298
+ export interface ResponseDeliverTx {
299
+ code: number;
300
+ data: Uint8Array;
301
+ /** nondeterministic */
302
+ log: string;
303
+ /** nondeterministic */
304
+ info: string;
305
+ gasWanted: number;
306
+ gasUsed: number;
307
+ /** nondeterministic */
308
+ events: Event[];
309
+ codespace: string;
310
+ }
311
+
312
+ export interface ResponseEndBlock {
313
+ validatorUpdates: ValidatorUpdate[];
314
+ consensusParamUpdates: ConsensusParams | undefined;
315
+ events: Event[];
316
+ }
317
+
318
+ export interface ResponseCommit {
319
+ /** reserve 1 */
320
+ data: Uint8Array;
321
+ retainHeight: number;
322
+ }
323
+
324
+ export interface ResponseListSnapshots {
325
+ snapshots: Snapshot[];
326
+ }
327
+
328
+ export interface ResponseOfferSnapshot {
329
+ result: ResponseOfferSnapshot_Result;
330
+ }
331
+
332
+ export enum ResponseOfferSnapshot_Result {
333
+ /** UNKNOWN - Unknown result, abort all snapshot restoration */
334
+ UNKNOWN = 0,
335
+ /** ACCEPT - Snapshot accepted, apply chunks */
336
+ ACCEPT = 1,
337
+ /** ABORT - Abort all snapshot restoration */
338
+ ABORT = 2,
339
+ /** REJECT - Reject this specific snapshot, try others */
340
+ REJECT = 3,
341
+ /** REJECT_FORMAT - Reject all snapshots of this format, try others */
342
+ REJECT_FORMAT = 4,
343
+ /** REJECT_SENDER - Reject all snapshots from the sender(s), try others */
344
+ REJECT_SENDER = 5,
345
+ UNRECOGNIZED = -1,
346
+ }
347
+
348
+ export function responseOfferSnapshot_ResultFromJSON(object: any): ResponseOfferSnapshot_Result {
349
+ switch (object) {
350
+ case 0:
351
+ case "UNKNOWN":
352
+ return ResponseOfferSnapshot_Result.UNKNOWN;
353
+ case 1:
354
+ case "ACCEPT":
355
+ return ResponseOfferSnapshot_Result.ACCEPT;
356
+ case 2:
357
+ case "ABORT":
358
+ return ResponseOfferSnapshot_Result.ABORT;
359
+ case 3:
360
+ case "REJECT":
361
+ return ResponseOfferSnapshot_Result.REJECT;
362
+ case 4:
363
+ case "REJECT_FORMAT":
364
+ return ResponseOfferSnapshot_Result.REJECT_FORMAT;
365
+ case 5:
366
+ case "REJECT_SENDER":
367
+ return ResponseOfferSnapshot_Result.REJECT_SENDER;
368
+ case -1:
369
+ case "UNRECOGNIZED":
370
+ default:
371
+ return ResponseOfferSnapshot_Result.UNRECOGNIZED;
372
+ }
373
+ }
374
+
375
+ export function responseOfferSnapshot_ResultToJSON(object: ResponseOfferSnapshot_Result): string {
376
+ switch (object) {
377
+ case ResponseOfferSnapshot_Result.UNKNOWN:
378
+ return "UNKNOWN";
379
+ case ResponseOfferSnapshot_Result.ACCEPT:
380
+ return "ACCEPT";
381
+ case ResponseOfferSnapshot_Result.ABORT:
382
+ return "ABORT";
383
+ case ResponseOfferSnapshot_Result.REJECT:
384
+ return "REJECT";
385
+ case ResponseOfferSnapshot_Result.REJECT_FORMAT:
386
+ return "REJECT_FORMAT";
387
+ case ResponseOfferSnapshot_Result.REJECT_SENDER:
388
+ return "REJECT_SENDER";
389
+ case ResponseOfferSnapshot_Result.UNRECOGNIZED:
390
+ default:
391
+ return "UNRECOGNIZED";
392
+ }
393
+ }
394
+
395
+ export interface ResponseLoadSnapshotChunk {
396
+ chunk: Uint8Array;
397
+ }
398
+
399
+ export interface ResponseApplySnapshotChunk {
400
+ result: ResponseApplySnapshotChunk_Result;
401
+ /** Chunks to refetch and reapply */
402
+ refetchChunks: number[];
403
+ /** Chunk senders to reject and ban */
404
+ rejectSenders: string[];
405
+ }
406
+
407
+ export enum ResponseApplySnapshotChunk_Result {
408
+ /** UNKNOWN - Unknown result, abort all snapshot restoration */
409
+ UNKNOWN = 0,
410
+ /** ACCEPT - Chunk successfully accepted */
411
+ ACCEPT = 1,
412
+ /** ABORT - Abort all snapshot restoration */
413
+ ABORT = 2,
414
+ /** RETRY - Retry chunk (combine with refetch and reject) */
415
+ RETRY = 3,
416
+ /** RETRY_SNAPSHOT - Retry snapshot (combine with refetch and reject) */
417
+ RETRY_SNAPSHOT = 4,
418
+ /** REJECT_SNAPSHOT - Reject this snapshot, try others */
419
+ REJECT_SNAPSHOT = 5,
420
+ UNRECOGNIZED = -1,
421
+ }
422
+
423
+ export function responseApplySnapshotChunk_ResultFromJSON(object: any): ResponseApplySnapshotChunk_Result {
424
+ switch (object) {
425
+ case 0:
426
+ case "UNKNOWN":
427
+ return ResponseApplySnapshotChunk_Result.UNKNOWN;
428
+ case 1:
429
+ case "ACCEPT":
430
+ return ResponseApplySnapshotChunk_Result.ACCEPT;
431
+ case 2:
432
+ case "ABORT":
433
+ return ResponseApplySnapshotChunk_Result.ABORT;
434
+ case 3:
435
+ case "RETRY":
436
+ return ResponseApplySnapshotChunk_Result.RETRY;
437
+ case 4:
438
+ case "RETRY_SNAPSHOT":
439
+ return ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT;
440
+ case 5:
441
+ case "REJECT_SNAPSHOT":
442
+ return ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT;
443
+ case -1:
444
+ case "UNRECOGNIZED":
445
+ default:
446
+ return ResponseApplySnapshotChunk_Result.UNRECOGNIZED;
447
+ }
448
+ }
449
+
450
+ export function responseApplySnapshotChunk_ResultToJSON(object: ResponseApplySnapshotChunk_Result): string {
451
+ switch (object) {
452
+ case ResponseApplySnapshotChunk_Result.UNKNOWN:
453
+ return "UNKNOWN";
454
+ case ResponseApplySnapshotChunk_Result.ACCEPT:
455
+ return "ACCEPT";
456
+ case ResponseApplySnapshotChunk_Result.ABORT:
457
+ return "ABORT";
458
+ case ResponseApplySnapshotChunk_Result.RETRY:
459
+ return "RETRY";
460
+ case ResponseApplySnapshotChunk_Result.RETRY_SNAPSHOT:
461
+ return "RETRY_SNAPSHOT";
462
+ case ResponseApplySnapshotChunk_Result.REJECT_SNAPSHOT:
463
+ return "REJECT_SNAPSHOT";
464
+ case ResponseApplySnapshotChunk_Result.UNRECOGNIZED:
465
+ default:
466
+ return "UNRECOGNIZED";
467
+ }
468
+ }
469
+
470
+ export interface ResponsePrepareProposal {
471
+ txs: Uint8Array[];
472
+ }
473
+
474
+ export interface ResponseProcessProposal {
475
+ status: ResponseProcessProposal_ProposalStatus;
476
+ }
477
+
478
+ export enum ResponseProcessProposal_ProposalStatus {
479
+ UNKNOWN = 0,
480
+ ACCEPT = 1,
481
+ REJECT = 2,
482
+ UNRECOGNIZED = -1,
483
+ }
484
+
485
+ export function responseProcessProposal_ProposalStatusFromJSON(object: any): ResponseProcessProposal_ProposalStatus {
486
+ switch (object) {
487
+ case 0:
488
+ case "UNKNOWN":
489
+ return ResponseProcessProposal_ProposalStatus.UNKNOWN;
490
+ case 1:
491
+ case "ACCEPT":
492
+ return ResponseProcessProposal_ProposalStatus.ACCEPT;
493
+ case 2:
494
+ case "REJECT":
495
+ return ResponseProcessProposal_ProposalStatus.REJECT;
496
+ case -1:
497
+ case "UNRECOGNIZED":
498
+ default:
499
+ return ResponseProcessProposal_ProposalStatus.UNRECOGNIZED;
500
+ }
501
+ }
502
+
503
+ export function responseProcessProposal_ProposalStatusToJSON(object: ResponseProcessProposal_ProposalStatus): string {
504
+ switch (object) {
505
+ case ResponseProcessProposal_ProposalStatus.UNKNOWN:
506
+ return "UNKNOWN";
507
+ case ResponseProcessProposal_ProposalStatus.ACCEPT:
508
+ return "ACCEPT";
509
+ case ResponseProcessProposal_ProposalStatus.REJECT:
510
+ return "REJECT";
511
+ case ResponseProcessProposal_ProposalStatus.UNRECOGNIZED:
512
+ default:
513
+ return "UNRECOGNIZED";
514
+ }
515
+ }
516
+
517
+ export interface CommitInfo {
518
+ round: number;
519
+ votes: VoteInfo[];
520
+ }
521
+
522
+ export interface ExtendedCommitInfo {
523
+ /** The round at which the block proposer decided in the previous height. */
524
+ round: number;
525
+ /**
526
+ * List of validators' addresses in the last validator set with their voting
527
+ * information, including vote extensions.
528
+ */
529
+ votes: ExtendedVoteInfo[];
530
+ }
531
+
532
+ /**
533
+ * Event allows application developers to attach additional information to
534
+ * ResponseBeginBlock, ResponseEndBlock, ResponseCheckTx and ResponseDeliverTx.
535
+ * Later, transactions may be queried using these events.
536
+ */
537
+ export interface Event {
538
+ type: string;
539
+ attributes: EventAttribute[];
540
+ }
541
+
542
+ /** EventAttribute is a single key-value pair, associated with an event. */
543
+ export interface EventAttribute {
544
+ key: string;
545
+ value: string;
546
+ /** nondeterministic */
547
+ index: boolean;
548
+ }
549
+
550
+ /**
551
+ * TxResult contains results of executing the transaction.
552
+ *
553
+ * One usage is indexing transaction results.
554
+ */
555
+ export interface TxResult {
556
+ height: number;
557
+ index: number;
558
+ tx: Uint8Array;
559
+ result: ResponseDeliverTx | undefined;
560
+ }
561
+
562
+ /** Validator */
563
+ export interface Validator {
564
+ /** The first 20 bytes of SHA256(public key) */
565
+ address: Uint8Array;
566
+ /** PubKey pub_key = 2 [(gogoproto.nullable)=false]; */
567
+ power: number;
568
+ }
569
+
570
+ /** ValidatorUpdate */
571
+ export interface ValidatorUpdate {
572
+ pubKey: PublicKey | undefined;
573
+ power: number;
574
+ }
575
+
576
+ /** VoteInfo */
577
+ export interface VoteInfo {
578
+ validator: Validator | undefined;
579
+ signedLastBlock: boolean;
580
+ }
581
+
582
+ export interface ExtendedVoteInfo {
583
+ validator: Validator | undefined;
584
+ signedLastBlock: boolean;
585
+ /** Reserved for future use */
586
+ voteExtension: Uint8Array;
587
+ }
588
+
589
+ export interface Misbehavior {
590
+ type: MisbehaviorType;
591
+ /** The offending validator */
592
+ validator:
593
+ | Validator
594
+ | undefined;
595
+ /** The height when the offense occurred */
596
+ height: number;
597
+ /** The corresponding time where the offense occurred */
598
+ time:
599
+ | Date
600
+ | undefined;
601
+ /**
602
+ * Total voting power of the validator set in case the ABCI application does
603
+ * not store historical validators.
604
+ * https://github.com/tendermint/tendermint/issues/4581
605
+ */
606
+ totalVotingPower: number;
607
+ }
608
+
609
+ export interface Snapshot {
610
+ /** The height at which the snapshot was taken */
611
+ height: number;
612
+ /** The application-specific snapshot format */
613
+ format: number;
614
+ /** Number of chunks in the snapshot */
615
+ chunks: number;
616
+ /** Arbitrary snapshot hash, equal only if identical */
617
+ hash: Uint8Array;
618
+ /** Arbitrary application metadata */
619
+ metadata: Uint8Array;
620
+ }
621
+
622
+ function createBaseRequest(): Request {
623
+ return {
624
+ echo: undefined,
625
+ flush: undefined,
626
+ info: undefined,
627
+ initChain: undefined,
628
+ query: undefined,
629
+ beginBlock: undefined,
630
+ checkTx: undefined,
631
+ deliverTx: undefined,
632
+ endBlock: undefined,
633
+ commit: undefined,
634
+ listSnapshots: undefined,
635
+ offerSnapshot: undefined,
636
+ loadSnapshotChunk: undefined,
637
+ applySnapshotChunk: undefined,
638
+ prepareProposal: undefined,
639
+ processProposal: undefined,
640
+ };
641
+ }
642
+
643
+ export const Request = {
644
+ encode(message: Request, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
645
+ if (message.echo !== undefined) {
646
+ RequestEcho.encode(message.echo, writer.uint32(10).fork()).ldelim();
647
+ }
648
+ if (message.flush !== undefined) {
649
+ RequestFlush.encode(message.flush, writer.uint32(18).fork()).ldelim();
650
+ }
651
+ if (message.info !== undefined) {
652
+ RequestInfo.encode(message.info, writer.uint32(26).fork()).ldelim();
653
+ }
654
+ if (message.initChain !== undefined) {
655
+ RequestInitChain.encode(message.initChain, writer.uint32(42).fork()).ldelim();
656
+ }
657
+ if (message.query !== undefined) {
658
+ RequestQuery.encode(message.query, writer.uint32(50).fork()).ldelim();
659
+ }
660
+ if (message.beginBlock !== undefined) {
661
+ RequestBeginBlock.encode(message.beginBlock, writer.uint32(58).fork()).ldelim();
662
+ }
663
+ if (message.checkTx !== undefined) {
664
+ RequestCheckTx.encode(message.checkTx, writer.uint32(66).fork()).ldelim();
665
+ }
666
+ if (message.deliverTx !== undefined) {
667
+ RequestDeliverTx.encode(message.deliverTx, writer.uint32(74).fork()).ldelim();
668
+ }
669
+ if (message.endBlock !== undefined) {
670
+ RequestEndBlock.encode(message.endBlock, writer.uint32(82).fork()).ldelim();
671
+ }
672
+ if (message.commit !== undefined) {
673
+ RequestCommit.encode(message.commit, writer.uint32(90).fork()).ldelim();
674
+ }
675
+ if (message.listSnapshots !== undefined) {
676
+ RequestListSnapshots.encode(message.listSnapshots, writer.uint32(98).fork()).ldelim();
677
+ }
678
+ if (message.offerSnapshot !== undefined) {
679
+ RequestOfferSnapshot.encode(message.offerSnapshot, writer.uint32(106).fork()).ldelim();
680
+ }
681
+ if (message.loadSnapshotChunk !== undefined) {
682
+ RequestLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(114).fork()).ldelim();
683
+ }
684
+ if (message.applySnapshotChunk !== undefined) {
685
+ RequestApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(122).fork()).ldelim();
686
+ }
687
+ if (message.prepareProposal !== undefined) {
688
+ RequestPrepareProposal.encode(message.prepareProposal, writer.uint32(130).fork()).ldelim();
689
+ }
690
+ if (message.processProposal !== undefined) {
691
+ RequestProcessProposal.encode(message.processProposal, writer.uint32(138).fork()).ldelim();
692
+ }
693
+ return writer;
694
+ },
695
+
696
+ decode(input: _m0.Reader | Uint8Array, length?: number): Request {
697
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
698
+ let end = length === undefined ? reader.len : reader.pos + length;
699
+ const message = createBaseRequest();
700
+ while (reader.pos < end) {
701
+ const tag = reader.uint32();
702
+ switch (tag >>> 3) {
703
+ case 1:
704
+ message.echo = RequestEcho.decode(reader, reader.uint32());
705
+ break;
706
+ case 2:
707
+ message.flush = RequestFlush.decode(reader, reader.uint32());
708
+ break;
709
+ case 3:
710
+ message.info = RequestInfo.decode(reader, reader.uint32());
711
+ break;
712
+ case 5:
713
+ message.initChain = RequestInitChain.decode(reader, reader.uint32());
714
+ break;
715
+ case 6:
716
+ message.query = RequestQuery.decode(reader, reader.uint32());
717
+ break;
718
+ case 7:
719
+ message.beginBlock = RequestBeginBlock.decode(reader, reader.uint32());
720
+ break;
721
+ case 8:
722
+ message.checkTx = RequestCheckTx.decode(reader, reader.uint32());
723
+ break;
724
+ case 9:
725
+ message.deliverTx = RequestDeliverTx.decode(reader, reader.uint32());
726
+ break;
727
+ case 10:
728
+ message.endBlock = RequestEndBlock.decode(reader, reader.uint32());
729
+ break;
730
+ case 11:
731
+ message.commit = RequestCommit.decode(reader, reader.uint32());
732
+ break;
733
+ case 12:
734
+ message.listSnapshots = RequestListSnapshots.decode(reader, reader.uint32());
735
+ break;
736
+ case 13:
737
+ message.offerSnapshot = RequestOfferSnapshot.decode(reader, reader.uint32());
738
+ break;
739
+ case 14:
740
+ message.loadSnapshotChunk = RequestLoadSnapshotChunk.decode(reader, reader.uint32());
741
+ break;
742
+ case 15:
743
+ message.applySnapshotChunk = RequestApplySnapshotChunk.decode(reader, reader.uint32());
744
+ break;
745
+ case 16:
746
+ message.prepareProposal = RequestPrepareProposal.decode(reader, reader.uint32());
747
+ break;
748
+ case 17:
749
+ message.processProposal = RequestProcessProposal.decode(reader, reader.uint32());
750
+ break;
751
+ default:
752
+ reader.skipType(tag & 7);
753
+ break;
754
+ }
755
+ }
756
+ return message;
757
+ },
758
+
759
+ fromJSON(object: any): Request {
760
+ return {
761
+ echo: isSet(object.echo) ? RequestEcho.fromJSON(object.echo) : undefined,
762
+ flush: isSet(object.flush) ? RequestFlush.fromJSON(object.flush) : undefined,
763
+ info: isSet(object.info) ? RequestInfo.fromJSON(object.info) : undefined,
764
+ initChain: isSet(object.initChain) ? RequestInitChain.fromJSON(object.initChain) : undefined,
765
+ query: isSet(object.query) ? RequestQuery.fromJSON(object.query) : undefined,
766
+ beginBlock: isSet(object.beginBlock) ? RequestBeginBlock.fromJSON(object.beginBlock) : undefined,
767
+ checkTx: isSet(object.checkTx) ? RequestCheckTx.fromJSON(object.checkTx) : undefined,
768
+ deliverTx: isSet(object.deliverTx) ? RequestDeliverTx.fromJSON(object.deliverTx) : undefined,
769
+ endBlock: isSet(object.endBlock) ? RequestEndBlock.fromJSON(object.endBlock) : undefined,
770
+ commit: isSet(object.commit) ? RequestCommit.fromJSON(object.commit) : undefined,
771
+ listSnapshots: isSet(object.listSnapshots) ? RequestListSnapshots.fromJSON(object.listSnapshots) : undefined,
772
+ offerSnapshot: isSet(object.offerSnapshot) ? RequestOfferSnapshot.fromJSON(object.offerSnapshot) : undefined,
773
+ loadSnapshotChunk: isSet(object.loadSnapshotChunk)
774
+ ? RequestLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk)
775
+ : undefined,
776
+ applySnapshotChunk: isSet(object.applySnapshotChunk)
777
+ ? RequestApplySnapshotChunk.fromJSON(object.applySnapshotChunk)
778
+ : undefined,
779
+ prepareProposal: isSet(object.prepareProposal)
780
+ ? RequestPrepareProposal.fromJSON(object.prepareProposal)
781
+ : undefined,
782
+ processProposal: isSet(object.processProposal)
783
+ ? RequestProcessProposal.fromJSON(object.processProposal)
784
+ : undefined,
785
+ };
786
+ },
787
+
788
+ toJSON(message: Request): unknown {
789
+ const obj: any = {};
790
+ message.echo !== undefined && (obj.echo = message.echo ? RequestEcho.toJSON(message.echo) : undefined);
791
+ message.flush !== undefined && (obj.flush = message.flush ? RequestFlush.toJSON(message.flush) : undefined);
792
+ message.info !== undefined && (obj.info = message.info ? RequestInfo.toJSON(message.info) : undefined);
793
+ message.initChain !== undefined
794
+ && (obj.initChain = message.initChain ? RequestInitChain.toJSON(message.initChain) : undefined);
795
+ message.query !== undefined && (obj.query = message.query ? RequestQuery.toJSON(message.query) : undefined);
796
+ message.beginBlock !== undefined
797
+ && (obj.beginBlock = message.beginBlock ? RequestBeginBlock.toJSON(message.beginBlock) : undefined);
798
+ message.checkTx !== undefined
799
+ && (obj.checkTx = message.checkTx ? RequestCheckTx.toJSON(message.checkTx) : undefined);
800
+ message.deliverTx !== undefined
801
+ && (obj.deliverTx = message.deliverTx ? RequestDeliverTx.toJSON(message.deliverTx) : undefined);
802
+ message.endBlock !== undefined
803
+ && (obj.endBlock = message.endBlock ? RequestEndBlock.toJSON(message.endBlock) : undefined);
804
+ message.commit !== undefined && (obj.commit = message.commit ? RequestCommit.toJSON(message.commit) : undefined);
805
+ message.listSnapshots !== undefined
806
+ && (obj.listSnapshots = message.listSnapshots ? RequestListSnapshots.toJSON(message.listSnapshots) : undefined);
807
+ message.offerSnapshot !== undefined
808
+ && (obj.offerSnapshot = message.offerSnapshot ? RequestOfferSnapshot.toJSON(message.offerSnapshot) : undefined);
809
+ message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk
810
+ ? RequestLoadSnapshotChunk.toJSON(message.loadSnapshotChunk)
811
+ : undefined);
812
+ message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk
813
+ ? RequestApplySnapshotChunk.toJSON(message.applySnapshotChunk)
814
+ : undefined);
815
+ message.prepareProposal !== undefined && (obj.prepareProposal = message.prepareProposal
816
+ ? RequestPrepareProposal.toJSON(message.prepareProposal)
817
+ : undefined);
818
+ message.processProposal !== undefined && (obj.processProposal = message.processProposal
819
+ ? RequestProcessProposal.toJSON(message.processProposal)
820
+ : undefined);
821
+ return obj;
822
+ },
823
+
824
+ fromPartial<I extends Exact<DeepPartial<Request>, I>>(object: I): Request {
825
+ const message = createBaseRequest();
826
+ message.echo = (object.echo !== undefined && object.echo !== null)
827
+ ? RequestEcho.fromPartial(object.echo)
828
+ : undefined;
829
+ message.flush = (object.flush !== undefined && object.flush !== null)
830
+ ? RequestFlush.fromPartial(object.flush)
831
+ : undefined;
832
+ message.info = (object.info !== undefined && object.info !== null)
833
+ ? RequestInfo.fromPartial(object.info)
834
+ : undefined;
835
+ message.initChain = (object.initChain !== undefined && object.initChain !== null)
836
+ ? RequestInitChain.fromPartial(object.initChain)
837
+ : undefined;
838
+ message.query = (object.query !== undefined && object.query !== null)
839
+ ? RequestQuery.fromPartial(object.query)
840
+ : undefined;
841
+ message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null)
842
+ ? RequestBeginBlock.fromPartial(object.beginBlock)
843
+ : undefined;
844
+ message.checkTx = (object.checkTx !== undefined && object.checkTx !== null)
845
+ ? RequestCheckTx.fromPartial(object.checkTx)
846
+ : undefined;
847
+ message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null)
848
+ ? RequestDeliverTx.fromPartial(object.deliverTx)
849
+ : undefined;
850
+ message.endBlock = (object.endBlock !== undefined && object.endBlock !== null)
851
+ ? RequestEndBlock.fromPartial(object.endBlock)
852
+ : undefined;
853
+ message.commit = (object.commit !== undefined && object.commit !== null)
854
+ ? RequestCommit.fromPartial(object.commit)
855
+ : undefined;
856
+ message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null)
857
+ ? RequestListSnapshots.fromPartial(object.listSnapshots)
858
+ : undefined;
859
+ message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null)
860
+ ? RequestOfferSnapshot.fromPartial(object.offerSnapshot)
861
+ : undefined;
862
+ message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null)
863
+ ? RequestLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk)
864
+ : undefined;
865
+ message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null)
866
+ ? RequestApplySnapshotChunk.fromPartial(object.applySnapshotChunk)
867
+ : undefined;
868
+ message.prepareProposal = (object.prepareProposal !== undefined && object.prepareProposal !== null)
869
+ ? RequestPrepareProposal.fromPartial(object.prepareProposal)
870
+ : undefined;
871
+ message.processProposal = (object.processProposal !== undefined && object.processProposal !== null)
872
+ ? RequestProcessProposal.fromPartial(object.processProposal)
873
+ : undefined;
874
+ return message;
875
+ },
876
+ };
877
+
878
+ function createBaseRequestEcho(): RequestEcho {
879
+ return { message: "" };
880
+ }
881
+
882
+ export const RequestEcho = {
883
+ encode(message: RequestEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
884
+ if (message.message !== "") {
885
+ writer.uint32(10).string(message.message);
886
+ }
887
+ return writer;
888
+ },
889
+
890
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestEcho {
891
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
892
+ let end = length === undefined ? reader.len : reader.pos + length;
893
+ const message = createBaseRequestEcho();
894
+ while (reader.pos < end) {
895
+ const tag = reader.uint32();
896
+ switch (tag >>> 3) {
897
+ case 1:
898
+ message.message = reader.string();
899
+ break;
900
+ default:
901
+ reader.skipType(tag & 7);
902
+ break;
903
+ }
904
+ }
905
+ return message;
906
+ },
907
+
908
+ fromJSON(object: any): RequestEcho {
909
+ return { message: isSet(object.message) ? String(object.message) : "" };
910
+ },
911
+
912
+ toJSON(message: RequestEcho): unknown {
913
+ const obj: any = {};
914
+ message.message !== undefined && (obj.message = message.message);
915
+ return obj;
916
+ },
917
+
918
+ fromPartial<I extends Exact<DeepPartial<RequestEcho>, I>>(object: I): RequestEcho {
919
+ const message = createBaseRequestEcho();
920
+ message.message = object.message ?? "";
921
+ return message;
922
+ },
923
+ };
924
+
925
+ function createBaseRequestFlush(): RequestFlush {
926
+ return {};
927
+ }
928
+
929
+ export const RequestFlush = {
930
+ encode(_: RequestFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
931
+ return writer;
932
+ },
933
+
934
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestFlush {
935
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
936
+ let end = length === undefined ? reader.len : reader.pos + length;
937
+ const message = createBaseRequestFlush();
938
+ while (reader.pos < end) {
939
+ const tag = reader.uint32();
940
+ switch (tag >>> 3) {
941
+ default:
942
+ reader.skipType(tag & 7);
943
+ break;
944
+ }
945
+ }
946
+ return message;
947
+ },
948
+
949
+ fromJSON(_: any): RequestFlush {
950
+ return {};
951
+ },
952
+
953
+ toJSON(_: RequestFlush): unknown {
954
+ const obj: any = {};
955
+ return obj;
956
+ },
957
+
958
+ fromPartial<I extends Exact<DeepPartial<RequestFlush>, I>>(_: I): RequestFlush {
959
+ const message = createBaseRequestFlush();
960
+ return message;
961
+ },
962
+ };
963
+
964
+ function createBaseRequestInfo(): RequestInfo {
965
+ return { version: "", blockVersion: 0, p2pVersion: 0, abciVersion: "" };
966
+ }
967
+
968
+ export const RequestInfo = {
969
+ encode(message: RequestInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
970
+ if (message.version !== "") {
971
+ writer.uint32(10).string(message.version);
972
+ }
973
+ if (message.blockVersion !== 0) {
974
+ writer.uint32(16).uint64(message.blockVersion);
975
+ }
976
+ if (message.p2pVersion !== 0) {
977
+ writer.uint32(24).uint64(message.p2pVersion);
978
+ }
979
+ if (message.abciVersion !== "") {
980
+ writer.uint32(34).string(message.abciVersion);
981
+ }
982
+ return writer;
983
+ },
984
+
985
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestInfo {
986
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
987
+ let end = length === undefined ? reader.len : reader.pos + length;
988
+ const message = createBaseRequestInfo();
989
+ while (reader.pos < end) {
990
+ const tag = reader.uint32();
991
+ switch (tag >>> 3) {
992
+ case 1:
993
+ message.version = reader.string();
994
+ break;
995
+ case 2:
996
+ message.blockVersion = longToNumber(reader.uint64() as Long);
997
+ break;
998
+ case 3:
999
+ message.p2pVersion = longToNumber(reader.uint64() as Long);
1000
+ break;
1001
+ case 4:
1002
+ message.abciVersion = reader.string();
1003
+ break;
1004
+ default:
1005
+ reader.skipType(tag & 7);
1006
+ break;
1007
+ }
1008
+ }
1009
+ return message;
1010
+ },
1011
+
1012
+ fromJSON(object: any): RequestInfo {
1013
+ return {
1014
+ version: isSet(object.version) ? String(object.version) : "",
1015
+ blockVersion: isSet(object.blockVersion) ? Number(object.blockVersion) : 0,
1016
+ p2pVersion: isSet(object.p2pVersion) ? Number(object.p2pVersion) : 0,
1017
+ abciVersion: isSet(object.abciVersion) ? String(object.abciVersion) : "",
1018
+ };
1019
+ },
1020
+
1021
+ toJSON(message: RequestInfo): unknown {
1022
+ const obj: any = {};
1023
+ message.version !== undefined && (obj.version = message.version);
1024
+ message.blockVersion !== undefined && (obj.blockVersion = Math.round(message.blockVersion));
1025
+ message.p2pVersion !== undefined && (obj.p2pVersion = Math.round(message.p2pVersion));
1026
+ message.abciVersion !== undefined && (obj.abciVersion = message.abciVersion);
1027
+ return obj;
1028
+ },
1029
+
1030
+ fromPartial<I extends Exact<DeepPartial<RequestInfo>, I>>(object: I): RequestInfo {
1031
+ const message = createBaseRequestInfo();
1032
+ message.version = object.version ?? "";
1033
+ message.blockVersion = object.blockVersion ?? 0;
1034
+ message.p2pVersion = object.p2pVersion ?? 0;
1035
+ message.abciVersion = object.abciVersion ?? "";
1036
+ return message;
1037
+ },
1038
+ };
1039
+
1040
+ function createBaseRequestInitChain(): RequestInitChain {
1041
+ return {
1042
+ time: undefined,
1043
+ chainId: "",
1044
+ consensusParams: undefined,
1045
+ validators: [],
1046
+ appStateBytes: new Uint8Array(),
1047
+ initialHeight: 0,
1048
+ };
1049
+ }
1050
+
1051
+ export const RequestInitChain = {
1052
+ encode(message: RequestInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1053
+ if (message.time !== undefined) {
1054
+ Timestamp.encode(toTimestamp(message.time), writer.uint32(10).fork()).ldelim();
1055
+ }
1056
+ if (message.chainId !== "") {
1057
+ writer.uint32(18).string(message.chainId);
1058
+ }
1059
+ if (message.consensusParams !== undefined) {
1060
+ ConsensusParams.encode(message.consensusParams, writer.uint32(26).fork()).ldelim();
1061
+ }
1062
+ for (const v of message.validators) {
1063
+ ValidatorUpdate.encode(v!, writer.uint32(34).fork()).ldelim();
1064
+ }
1065
+ if (message.appStateBytes.length !== 0) {
1066
+ writer.uint32(42).bytes(message.appStateBytes);
1067
+ }
1068
+ if (message.initialHeight !== 0) {
1069
+ writer.uint32(48).int64(message.initialHeight);
1070
+ }
1071
+ return writer;
1072
+ },
1073
+
1074
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestInitChain {
1075
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1076
+ let end = length === undefined ? reader.len : reader.pos + length;
1077
+ const message = createBaseRequestInitChain();
1078
+ while (reader.pos < end) {
1079
+ const tag = reader.uint32();
1080
+ switch (tag >>> 3) {
1081
+ case 1:
1082
+ message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1083
+ break;
1084
+ case 2:
1085
+ message.chainId = reader.string();
1086
+ break;
1087
+ case 3:
1088
+ message.consensusParams = ConsensusParams.decode(reader, reader.uint32());
1089
+ break;
1090
+ case 4:
1091
+ message.validators.push(ValidatorUpdate.decode(reader, reader.uint32()));
1092
+ break;
1093
+ case 5:
1094
+ message.appStateBytes = reader.bytes();
1095
+ break;
1096
+ case 6:
1097
+ message.initialHeight = longToNumber(reader.int64() as Long);
1098
+ break;
1099
+ default:
1100
+ reader.skipType(tag & 7);
1101
+ break;
1102
+ }
1103
+ }
1104
+ return message;
1105
+ },
1106
+
1107
+ fromJSON(object: any): RequestInitChain {
1108
+ return {
1109
+ time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
1110
+ chainId: isSet(object.chainId) ? String(object.chainId) : "",
1111
+ consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined,
1112
+ validators: Array.isArray(object?.validators)
1113
+ ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e))
1114
+ : [],
1115
+ appStateBytes: isSet(object.appStateBytes) ? bytesFromBase64(object.appStateBytes) : new Uint8Array(),
1116
+ initialHeight: isSet(object.initialHeight) ? Number(object.initialHeight) : 0,
1117
+ };
1118
+ },
1119
+
1120
+ toJSON(message: RequestInitChain): unknown {
1121
+ const obj: any = {};
1122
+ message.time !== undefined && (obj.time = message.time.toISOString());
1123
+ message.chainId !== undefined && (obj.chainId = message.chainId);
1124
+ message.consensusParams !== undefined
1125
+ && (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined);
1126
+ if (message.validators) {
1127
+ obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined);
1128
+ } else {
1129
+ obj.validators = [];
1130
+ }
1131
+ message.appStateBytes !== undefined
1132
+ && (obj.appStateBytes = base64FromBytes(
1133
+ message.appStateBytes !== undefined ? message.appStateBytes : new Uint8Array(),
1134
+ ));
1135
+ message.initialHeight !== undefined && (obj.initialHeight = Math.round(message.initialHeight));
1136
+ return obj;
1137
+ },
1138
+
1139
+ fromPartial<I extends Exact<DeepPartial<RequestInitChain>, I>>(object: I): RequestInitChain {
1140
+ const message = createBaseRequestInitChain();
1141
+ message.time = object.time ?? undefined;
1142
+ message.chainId = object.chainId ?? "";
1143
+ message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null)
1144
+ ? ConsensusParams.fromPartial(object.consensusParams)
1145
+ : undefined;
1146
+ message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || [];
1147
+ message.appStateBytes = object.appStateBytes ?? new Uint8Array();
1148
+ message.initialHeight = object.initialHeight ?? 0;
1149
+ return message;
1150
+ },
1151
+ };
1152
+
1153
+ function createBaseRequestQuery(): RequestQuery {
1154
+ return { data: new Uint8Array(), path: "", height: 0, prove: false };
1155
+ }
1156
+
1157
+ export const RequestQuery = {
1158
+ encode(message: RequestQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1159
+ if (message.data.length !== 0) {
1160
+ writer.uint32(10).bytes(message.data);
1161
+ }
1162
+ if (message.path !== "") {
1163
+ writer.uint32(18).string(message.path);
1164
+ }
1165
+ if (message.height !== 0) {
1166
+ writer.uint32(24).int64(message.height);
1167
+ }
1168
+ if (message.prove === true) {
1169
+ writer.uint32(32).bool(message.prove);
1170
+ }
1171
+ return writer;
1172
+ },
1173
+
1174
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestQuery {
1175
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1176
+ let end = length === undefined ? reader.len : reader.pos + length;
1177
+ const message = createBaseRequestQuery();
1178
+ while (reader.pos < end) {
1179
+ const tag = reader.uint32();
1180
+ switch (tag >>> 3) {
1181
+ case 1:
1182
+ message.data = reader.bytes();
1183
+ break;
1184
+ case 2:
1185
+ message.path = reader.string();
1186
+ break;
1187
+ case 3:
1188
+ message.height = longToNumber(reader.int64() as Long);
1189
+ break;
1190
+ case 4:
1191
+ message.prove = reader.bool();
1192
+ break;
1193
+ default:
1194
+ reader.skipType(tag & 7);
1195
+ break;
1196
+ }
1197
+ }
1198
+ return message;
1199
+ },
1200
+
1201
+ fromJSON(object: any): RequestQuery {
1202
+ return {
1203
+ data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
1204
+ path: isSet(object.path) ? String(object.path) : "",
1205
+ height: isSet(object.height) ? Number(object.height) : 0,
1206
+ prove: isSet(object.prove) ? Boolean(object.prove) : false,
1207
+ };
1208
+ },
1209
+
1210
+ toJSON(message: RequestQuery): unknown {
1211
+ const obj: any = {};
1212
+ message.data !== undefined
1213
+ && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
1214
+ message.path !== undefined && (obj.path = message.path);
1215
+ message.height !== undefined && (obj.height = Math.round(message.height));
1216
+ message.prove !== undefined && (obj.prove = message.prove);
1217
+ return obj;
1218
+ },
1219
+
1220
+ fromPartial<I extends Exact<DeepPartial<RequestQuery>, I>>(object: I): RequestQuery {
1221
+ const message = createBaseRequestQuery();
1222
+ message.data = object.data ?? new Uint8Array();
1223
+ message.path = object.path ?? "";
1224
+ message.height = object.height ?? 0;
1225
+ message.prove = object.prove ?? false;
1226
+ return message;
1227
+ },
1228
+ };
1229
+
1230
+ function createBaseRequestBeginBlock(): RequestBeginBlock {
1231
+ return { hash: new Uint8Array(), header: undefined, lastCommitInfo: undefined, byzantineValidators: [] };
1232
+ }
1233
+
1234
+ export const RequestBeginBlock = {
1235
+ encode(message: RequestBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1236
+ if (message.hash.length !== 0) {
1237
+ writer.uint32(10).bytes(message.hash);
1238
+ }
1239
+ if (message.header !== undefined) {
1240
+ Header.encode(message.header, writer.uint32(18).fork()).ldelim();
1241
+ }
1242
+ if (message.lastCommitInfo !== undefined) {
1243
+ CommitInfo.encode(message.lastCommitInfo, writer.uint32(26).fork()).ldelim();
1244
+ }
1245
+ for (const v of message.byzantineValidators) {
1246
+ Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim();
1247
+ }
1248
+ return writer;
1249
+ },
1250
+
1251
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestBeginBlock {
1252
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1253
+ let end = length === undefined ? reader.len : reader.pos + length;
1254
+ const message = createBaseRequestBeginBlock();
1255
+ while (reader.pos < end) {
1256
+ const tag = reader.uint32();
1257
+ switch (tag >>> 3) {
1258
+ case 1:
1259
+ message.hash = reader.bytes();
1260
+ break;
1261
+ case 2:
1262
+ message.header = Header.decode(reader, reader.uint32());
1263
+ break;
1264
+ case 3:
1265
+ message.lastCommitInfo = CommitInfo.decode(reader, reader.uint32());
1266
+ break;
1267
+ case 4:
1268
+ message.byzantineValidators.push(Misbehavior.decode(reader, reader.uint32()));
1269
+ break;
1270
+ default:
1271
+ reader.skipType(tag & 7);
1272
+ break;
1273
+ }
1274
+ }
1275
+ return message;
1276
+ },
1277
+
1278
+ fromJSON(object: any): RequestBeginBlock {
1279
+ return {
1280
+ hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(),
1281
+ header: isSet(object.header) ? Header.fromJSON(object.header) : undefined,
1282
+ lastCommitInfo: isSet(object.lastCommitInfo) ? CommitInfo.fromJSON(object.lastCommitInfo) : undefined,
1283
+ byzantineValidators: Array.isArray(object?.byzantineValidators)
1284
+ ? object.byzantineValidators.map((e: any) => Misbehavior.fromJSON(e))
1285
+ : [],
1286
+ };
1287
+ },
1288
+
1289
+ toJSON(message: RequestBeginBlock): unknown {
1290
+ const obj: any = {};
1291
+ message.hash !== undefined
1292
+ && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
1293
+ message.header !== undefined && (obj.header = message.header ? Header.toJSON(message.header) : undefined);
1294
+ message.lastCommitInfo !== undefined
1295
+ && (obj.lastCommitInfo = message.lastCommitInfo ? CommitInfo.toJSON(message.lastCommitInfo) : undefined);
1296
+ if (message.byzantineValidators) {
1297
+ obj.byzantineValidators = message.byzantineValidators.map((e) => e ? Misbehavior.toJSON(e) : undefined);
1298
+ } else {
1299
+ obj.byzantineValidators = [];
1300
+ }
1301
+ return obj;
1302
+ },
1303
+
1304
+ fromPartial<I extends Exact<DeepPartial<RequestBeginBlock>, I>>(object: I): RequestBeginBlock {
1305
+ const message = createBaseRequestBeginBlock();
1306
+ message.hash = object.hash ?? new Uint8Array();
1307
+ message.header = (object.header !== undefined && object.header !== null)
1308
+ ? Header.fromPartial(object.header)
1309
+ : undefined;
1310
+ message.lastCommitInfo = (object.lastCommitInfo !== undefined && object.lastCommitInfo !== null)
1311
+ ? CommitInfo.fromPartial(object.lastCommitInfo)
1312
+ : undefined;
1313
+ message.byzantineValidators = object.byzantineValidators?.map((e) => Misbehavior.fromPartial(e)) || [];
1314
+ return message;
1315
+ },
1316
+ };
1317
+
1318
+ function createBaseRequestCheckTx(): RequestCheckTx {
1319
+ return { tx: new Uint8Array(), type: 0 };
1320
+ }
1321
+
1322
+ export const RequestCheckTx = {
1323
+ encode(message: RequestCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1324
+ if (message.tx.length !== 0) {
1325
+ writer.uint32(10).bytes(message.tx);
1326
+ }
1327
+ if (message.type !== 0) {
1328
+ writer.uint32(16).int32(message.type);
1329
+ }
1330
+ return writer;
1331
+ },
1332
+
1333
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestCheckTx {
1334
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1335
+ let end = length === undefined ? reader.len : reader.pos + length;
1336
+ const message = createBaseRequestCheckTx();
1337
+ while (reader.pos < end) {
1338
+ const tag = reader.uint32();
1339
+ switch (tag >>> 3) {
1340
+ case 1:
1341
+ message.tx = reader.bytes();
1342
+ break;
1343
+ case 2:
1344
+ message.type = reader.int32() as any;
1345
+ break;
1346
+ default:
1347
+ reader.skipType(tag & 7);
1348
+ break;
1349
+ }
1350
+ }
1351
+ return message;
1352
+ },
1353
+
1354
+ fromJSON(object: any): RequestCheckTx {
1355
+ return {
1356
+ tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(),
1357
+ type: isSet(object.type) ? checkTxTypeFromJSON(object.type) : 0,
1358
+ };
1359
+ },
1360
+
1361
+ toJSON(message: RequestCheckTx): unknown {
1362
+ const obj: any = {};
1363
+ message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array()));
1364
+ message.type !== undefined && (obj.type = checkTxTypeToJSON(message.type));
1365
+ return obj;
1366
+ },
1367
+
1368
+ fromPartial<I extends Exact<DeepPartial<RequestCheckTx>, I>>(object: I): RequestCheckTx {
1369
+ const message = createBaseRequestCheckTx();
1370
+ message.tx = object.tx ?? new Uint8Array();
1371
+ message.type = object.type ?? 0;
1372
+ return message;
1373
+ },
1374
+ };
1375
+
1376
+ function createBaseRequestDeliverTx(): RequestDeliverTx {
1377
+ return { tx: new Uint8Array() };
1378
+ }
1379
+
1380
+ export const RequestDeliverTx = {
1381
+ encode(message: RequestDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1382
+ if (message.tx.length !== 0) {
1383
+ writer.uint32(10).bytes(message.tx);
1384
+ }
1385
+ return writer;
1386
+ },
1387
+
1388
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestDeliverTx {
1389
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1390
+ let end = length === undefined ? reader.len : reader.pos + length;
1391
+ const message = createBaseRequestDeliverTx();
1392
+ while (reader.pos < end) {
1393
+ const tag = reader.uint32();
1394
+ switch (tag >>> 3) {
1395
+ case 1:
1396
+ message.tx = reader.bytes();
1397
+ break;
1398
+ default:
1399
+ reader.skipType(tag & 7);
1400
+ break;
1401
+ }
1402
+ }
1403
+ return message;
1404
+ },
1405
+
1406
+ fromJSON(object: any): RequestDeliverTx {
1407
+ return { tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array() };
1408
+ },
1409
+
1410
+ toJSON(message: RequestDeliverTx): unknown {
1411
+ const obj: any = {};
1412
+ message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array()));
1413
+ return obj;
1414
+ },
1415
+
1416
+ fromPartial<I extends Exact<DeepPartial<RequestDeliverTx>, I>>(object: I): RequestDeliverTx {
1417
+ const message = createBaseRequestDeliverTx();
1418
+ message.tx = object.tx ?? new Uint8Array();
1419
+ return message;
1420
+ },
1421
+ };
1422
+
1423
+ function createBaseRequestEndBlock(): RequestEndBlock {
1424
+ return { height: 0 };
1425
+ }
1426
+
1427
+ export const RequestEndBlock = {
1428
+ encode(message: RequestEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1429
+ if (message.height !== 0) {
1430
+ writer.uint32(8).int64(message.height);
1431
+ }
1432
+ return writer;
1433
+ },
1434
+
1435
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestEndBlock {
1436
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1437
+ let end = length === undefined ? reader.len : reader.pos + length;
1438
+ const message = createBaseRequestEndBlock();
1439
+ while (reader.pos < end) {
1440
+ const tag = reader.uint32();
1441
+ switch (tag >>> 3) {
1442
+ case 1:
1443
+ message.height = longToNumber(reader.int64() as Long);
1444
+ break;
1445
+ default:
1446
+ reader.skipType(tag & 7);
1447
+ break;
1448
+ }
1449
+ }
1450
+ return message;
1451
+ },
1452
+
1453
+ fromJSON(object: any): RequestEndBlock {
1454
+ return { height: isSet(object.height) ? Number(object.height) : 0 };
1455
+ },
1456
+
1457
+ toJSON(message: RequestEndBlock): unknown {
1458
+ const obj: any = {};
1459
+ message.height !== undefined && (obj.height = Math.round(message.height));
1460
+ return obj;
1461
+ },
1462
+
1463
+ fromPartial<I extends Exact<DeepPartial<RequestEndBlock>, I>>(object: I): RequestEndBlock {
1464
+ const message = createBaseRequestEndBlock();
1465
+ message.height = object.height ?? 0;
1466
+ return message;
1467
+ },
1468
+ };
1469
+
1470
+ function createBaseRequestCommit(): RequestCommit {
1471
+ return {};
1472
+ }
1473
+
1474
+ export const RequestCommit = {
1475
+ encode(_: RequestCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1476
+ return writer;
1477
+ },
1478
+
1479
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestCommit {
1480
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1481
+ let end = length === undefined ? reader.len : reader.pos + length;
1482
+ const message = createBaseRequestCommit();
1483
+ while (reader.pos < end) {
1484
+ const tag = reader.uint32();
1485
+ switch (tag >>> 3) {
1486
+ default:
1487
+ reader.skipType(tag & 7);
1488
+ break;
1489
+ }
1490
+ }
1491
+ return message;
1492
+ },
1493
+
1494
+ fromJSON(_: any): RequestCommit {
1495
+ return {};
1496
+ },
1497
+
1498
+ toJSON(_: RequestCommit): unknown {
1499
+ const obj: any = {};
1500
+ return obj;
1501
+ },
1502
+
1503
+ fromPartial<I extends Exact<DeepPartial<RequestCommit>, I>>(_: I): RequestCommit {
1504
+ const message = createBaseRequestCommit();
1505
+ return message;
1506
+ },
1507
+ };
1508
+
1509
+ function createBaseRequestListSnapshots(): RequestListSnapshots {
1510
+ return {};
1511
+ }
1512
+
1513
+ export const RequestListSnapshots = {
1514
+ encode(_: RequestListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1515
+ return writer;
1516
+ },
1517
+
1518
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestListSnapshots {
1519
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1520
+ let end = length === undefined ? reader.len : reader.pos + length;
1521
+ const message = createBaseRequestListSnapshots();
1522
+ while (reader.pos < end) {
1523
+ const tag = reader.uint32();
1524
+ switch (tag >>> 3) {
1525
+ default:
1526
+ reader.skipType(tag & 7);
1527
+ break;
1528
+ }
1529
+ }
1530
+ return message;
1531
+ },
1532
+
1533
+ fromJSON(_: any): RequestListSnapshots {
1534
+ return {};
1535
+ },
1536
+
1537
+ toJSON(_: RequestListSnapshots): unknown {
1538
+ const obj: any = {};
1539
+ return obj;
1540
+ },
1541
+
1542
+ fromPartial<I extends Exact<DeepPartial<RequestListSnapshots>, I>>(_: I): RequestListSnapshots {
1543
+ const message = createBaseRequestListSnapshots();
1544
+ return message;
1545
+ },
1546
+ };
1547
+
1548
+ function createBaseRequestOfferSnapshot(): RequestOfferSnapshot {
1549
+ return { snapshot: undefined, appHash: new Uint8Array() };
1550
+ }
1551
+
1552
+ export const RequestOfferSnapshot = {
1553
+ encode(message: RequestOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1554
+ if (message.snapshot !== undefined) {
1555
+ Snapshot.encode(message.snapshot, writer.uint32(10).fork()).ldelim();
1556
+ }
1557
+ if (message.appHash.length !== 0) {
1558
+ writer.uint32(18).bytes(message.appHash);
1559
+ }
1560
+ return writer;
1561
+ },
1562
+
1563
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestOfferSnapshot {
1564
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1565
+ let end = length === undefined ? reader.len : reader.pos + length;
1566
+ const message = createBaseRequestOfferSnapshot();
1567
+ while (reader.pos < end) {
1568
+ const tag = reader.uint32();
1569
+ switch (tag >>> 3) {
1570
+ case 1:
1571
+ message.snapshot = Snapshot.decode(reader, reader.uint32());
1572
+ break;
1573
+ case 2:
1574
+ message.appHash = reader.bytes();
1575
+ break;
1576
+ default:
1577
+ reader.skipType(tag & 7);
1578
+ break;
1579
+ }
1580
+ }
1581
+ return message;
1582
+ },
1583
+
1584
+ fromJSON(object: any): RequestOfferSnapshot {
1585
+ return {
1586
+ snapshot: isSet(object.snapshot) ? Snapshot.fromJSON(object.snapshot) : undefined,
1587
+ appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(),
1588
+ };
1589
+ },
1590
+
1591
+ toJSON(message: RequestOfferSnapshot): unknown {
1592
+ const obj: any = {};
1593
+ message.snapshot !== undefined && (obj.snapshot = message.snapshot ? Snapshot.toJSON(message.snapshot) : undefined);
1594
+ message.appHash !== undefined
1595
+ && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array()));
1596
+ return obj;
1597
+ },
1598
+
1599
+ fromPartial<I extends Exact<DeepPartial<RequestOfferSnapshot>, I>>(object: I): RequestOfferSnapshot {
1600
+ const message = createBaseRequestOfferSnapshot();
1601
+ message.snapshot = (object.snapshot !== undefined && object.snapshot !== null)
1602
+ ? Snapshot.fromPartial(object.snapshot)
1603
+ : undefined;
1604
+ message.appHash = object.appHash ?? new Uint8Array();
1605
+ return message;
1606
+ },
1607
+ };
1608
+
1609
+ function createBaseRequestLoadSnapshotChunk(): RequestLoadSnapshotChunk {
1610
+ return { height: 0, format: 0, chunk: 0 };
1611
+ }
1612
+
1613
+ export const RequestLoadSnapshotChunk = {
1614
+ encode(message: RequestLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1615
+ if (message.height !== 0) {
1616
+ writer.uint32(8).uint64(message.height);
1617
+ }
1618
+ if (message.format !== 0) {
1619
+ writer.uint32(16).uint32(message.format);
1620
+ }
1621
+ if (message.chunk !== 0) {
1622
+ writer.uint32(24).uint32(message.chunk);
1623
+ }
1624
+ return writer;
1625
+ },
1626
+
1627
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestLoadSnapshotChunk {
1628
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1629
+ let end = length === undefined ? reader.len : reader.pos + length;
1630
+ const message = createBaseRequestLoadSnapshotChunk();
1631
+ while (reader.pos < end) {
1632
+ const tag = reader.uint32();
1633
+ switch (tag >>> 3) {
1634
+ case 1:
1635
+ message.height = longToNumber(reader.uint64() as Long);
1636
+ break;
1637
+ case 2:
1638
+ message.format = reader.uint32();
1639
+ break;
1640
+ case 3:
1641
+ message.chunk = reader.uint32();
1642
+ break;
1643
+ default:
1644
+ reader.skipType(tag & 7);
1645
+ break;
1646
+ }
1647
+ }
1648
+ return message;
1649
+ },
1650
+
1651
+ fromJSON(object: any): RequestLoadSnapshotChunk {
1652
+ return {
1653
+ height: isSet(object.height) ? Number(object.height) : 0,
1654
+ format: isSet(object.format) ? Number(object.format) : 0,
1655
+ chunk: isSet(object.chunk) ? Number(object.chunk) : 0,
1656
+ };
1657
+ },
1658
+
1659
+ toJSON(message: RequestLoadSnapshotChunk): unknown {
1660
+ const obj: any = {};
1661
+ message.height !== undefined && (obj.height = Math.round(message.height));
1662
+ message.format !== undefined && (obj.format = Math.round(message.format));
1663
+ message.chunk !== undefined && (obj.chunk = Math.round(message.chunk));
1664
+ return obj;
1665
+ },
1666
+
1667
+ fromPartial<I extends Exact<DeepPartial<RequestLoadSnapshotChunk>, I>>(object: I): RequestLoadSnapshotChunk {
1668
+ const message = createBaseRequestLoadSnapshotChunk();
1669
+ message.height = object.height ?? 0;
1670
+ message.format = object.format ?? 0;
1671
+ message.chunk = object.chunk ?? 0;
1672
+ return message;
1673
+ },
1674
+ };
1675
+
1676
+ function createBaseRequestApplySnapshotChunk(): RequestApplySnapshotChunk {
1677
+ return { index: 0, chunk: new Uint8Array(), sender: "" };
1678
+ }
1679
+
1680
+ export const RequestApplySnapshotChunk = {
1681
+ encode(message: RequestApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1682
+ if (message.index !== 0) {
1683
+ writer.uint32(8).uint32(message.index);
1684
+ }
1685
+ if (message.chunk.length !== 0) {
1686
+ writer.uint32(18).bytes(message.chunk);
1687
+ }
1688
+ if (message.sender !== "") {
1689
+ writer.uint32(26).string(message.sender);
1690
+ }
1691
+ return writer;
1692
+ },
1693
+
1694
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestApplySnapshotChunk {
1695
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1696
+ let end = length === undefined ? reader.len : reader.pos + length;
1697
+ const message = createBaseRequestApplySnapshotChunk();
1698
+ while (reader.pos < end) {
1699
+ const tag = reader.uint32();
1700
+ switch (tag >>> 3) {
1701
+ case 1:
1702
+ message.index = reader.uint32();
1703
+ break;
1704
+ case 2:
1705
+ message.chunk = reader.bytes();
1706
+ break;
1707
+ case 3:
1708
+ message.sender = reader.string();
1709
+ break;
1710
+ default:
1711
+ reader.skipType(tag & 7);
1712
+ break;
1713
+ }
1714
+ }
1715
+ return message;
1716
+ },
1717
+
1718
+ fromJSON(object: any): RequestApplySnapshotChunk {
1719
+ return {
1720
+ index: isSet(object.index) ? Number(object.index) : 0,
1721
+ chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array(),
1722
+ sender: isSet(object.sender) ? String(object.sender) : "",
1723
+ };
1724
+ },
1725
+
1726
+ toJSON(message: RequestApplySnapshotChunk): unknown {
1727
+ const obj: any = {};
1728
+ message.index !== undefined && (obj.index = Math.round(message.index));
1729
+ message.chunk !== undefined
1730
+ && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array()));
1731
+ message.sender !== undefined && (obj.sender = message.sender);
1732
+ return obj;
1733
+ },
1734
+
1735
+ fromPartial<I extends Exact<DeepPartial<RequestApplySnapshotChunk>, I>>(object: I): RequestApplySnapshotChunk {
1736
+ const message = createBaseRequestApplySnapshotChunk();
1737
+ message.index = object.index ?? 0;
1738
+ message.chunk = object.chunk ?? new Uint8Array();
1739
+ message.sender = object.sender ?? "";
1740
+ return message;
1741
+ },
1742
+ };
1743
+
1744
+ function createBaseRequestPrepareProposal(): RequestPrepareProposal {
1745
+ return {
1746
+ maxTxBytes: 0,
1747
+ txs: [],
1748
+ localLastCommit: undefined,
1749
+ misbehavior: [],
1750
+ height: 0,
1751
+ time: undefined,
1752
+ nextValidatorsHash: new Uint8Array(),
1753
+ proposerAddress: new Uint8Array(),
1754
+ };
1755
+ }
1756
+
1757
+ export const RequestPrepareProposal = {
1758
+ encode(message: RequestPrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1759
+ if (message.maxTxBytes !== 0) {
1760
+ writer.uint32(8).int64(message.maxTxBytes);
1761
+ }
1762
+ for (const v of message.txs) {
1763
+ writer.uint32(18).bytes(v!);
1764
+ }
1765
+ if (message.localLastCommit !== undefined) {
1766
+ ExtendedCommitInfo.encode(message.localLastCommit, writer.uint32(26).fork()).ldelim();
1767
+ }
1768
+ for (const v of message.misbehavior) {
1769
+ Misbehavior.encode(v!, writer.uint32(34).fork()).ldelim();
1770
+ }
1771
+ if (message.height !== 0) {
1772
+ writer.uint32(40).int64(message.height);
1773
+ }
1774
+ if (message.time !== undefined) {
1775
+ Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim();
1776
+ }
1777
+ if (message.nextValidatorsHash.length !== 0) {
1778
+ writer.uint32(58).bytes(message.nextValidatorsHash);
1779
+ }
1780
+ if (message.proposerAddress.length !== 0) {
1781
+ writer.uint32(66).bytes(message.proposerAddress);
1782
+ }
1783
+ return writer;
1784
+ },
1785
+
1786
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestPrepareProposal {
1787
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1788
+ let end = length === undefined ? reader.len : reader.pos + length;
1789
+ const message = createBaseRequestPrepareProposal();
1790
+ while (reader.pos < end) {
1791
+ const tag = reader.uint32();
1792
+ switch (tag >>> 3) {
1793
+ case 1:
1794
+ message.maxTxBytes = longToNumber(reader.int64() as Long);
1795
+ break;
1796
+ case 2:
1797
+ message.txs.push(reader.bytes());
1798
+ break;
1799
+ case 3:
1800
+ message.localLastCommit = ExtendedCommitInfo.decode(reader, reader.uint32());
1801
+ break;
1802
+ case 4:
1803
+ message.misbehavior.push(Misbehavior.decode(reader, reader.uint32()));
1804
+ break;
1805
+ case 5:
1806
+ message.height = longToNumber(reader.int64() as Long);
1807
+ break;
1808
+ case 6:
1809
+ message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1810
+ break;
1811
+ case 7:
1812
+ message.nextValidatorsHash = reader.bytes();
1813
+ break;
1814
+ case 8:
1815
+ message.proposerAddress = reader.bytes();
1816
+ break;
1817
+ default:
1818
+ reader.skipType(tag & 7);
1819
+ break;
1820
+ }
1821
+ }
1822
+ return message;
1823
+ },
1824
+
1825
+ fromJSON(object: any): RequestPrepareProposal {
1826
+ return {
1827
+ maxTxBytes: isSet(object.maxTxBytes) ? Number(object.maxTxBytes) : 0,
1828
+ txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [],
1829
+ localLastCommit: isSet(object.localLastCommit) ? ExtendedCommitInfo.fromJSON(object.localLastCommit) : undefined,
1830
+ misbehavior: Array.isArray(object?.misbehavior)
1831
+ ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e))
1832
+ : [],
1833
+ height: isSet(object.height) ? Number(object.height) : 0,
1834
+ time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
1835
+ nextValidatorsHash: isSet(object.nextValidatorsHash)
1836
+ ? bytesFromBase64(object.nextValidatorsHash)
1837
+ : new Uint8Array(),
1838
+ proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(),
1839
+ };
1840
+ },
1841
+
1842
+ toJSON(message: RequestPrepareProposal): unknown {
1843
+ const obj: any = {};
1844
+ message.maxTxBytes !== undefined && (obj.maxTxBytes = Math.round(message.maxTxBytes));
1845
+ if (message.txs) {
1846
+ obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
1847
+ } else {
1848
+ obj.txs = [];
1849
+ }
1850
+ message.localLastCommit !== undefined
1851
+ && (obj.localLastCommit = message.localLastCommit
1852
+ ? ExtendedCommitInfo.toJSON(message.localLastCommit)
1853
+ : undefined);
1854
+ if (message.misbehavior) {
1855
+ obj.misbehavior = message.misbehavior.map((e) => e ? Misbehavior.toJSON(e) : undefined);
1856
+ } else {
1857
+ obj.misbehavior = [];
1858
+ }
1859
+ message.height !== undefined && (obj.height = Math.round(message.height));
1860
+ message.time !== undefined && (obj.time = message.time.toISOString());
1861
+ message.nextValidatorsHash !== undefined
1862
+ && (obj.nextValidatorsHash = base64FromBytes(
1863
+ message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(),
1864
+ ));
1865
+ message.proposerAddress !== undefined
1866
+ && (obj.proposerAddress = base64FromBytes(
1867
+ message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(),
1868
+ ));
1869
+ return obj;
1870
+ },
1871
+
1872
+ fromPartial<I extends Exact<DeepPartial<RequestPrepareProposal>, I>>(object: I): RequestPrepareProposal {
1873
+ const message = createBaseRequestPrepareProposal();
1874
+ message.maxTxBytes = object.maxTxBytes ?? 0;
1875
+ message.txs = object.txs?.map((e) => e) || [];
1876
+ message.localLastCommit = (object.localLastCommit !== undefined && object.localLastCommit !== null)
1877
+ ? ExtendedCommitInfo.fromPartial(object.localLastCommit)
1878
+ : undefined;
1879
+ message.misbehavior = object.misbehavior?.map((e) => Misbehavior.fromPartial(e)) || [];
1880
+ message.height = object.height ?? 0;
1881
+ message.time = object.time ?? undefined;
1882
+ message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array();
1883
+ message.proposerAddress = object.proposerAddress ?? new Uint8Array();
1884
+ return message;
1885
+ },
1886
+ };
1887
+
1888
+ function createBaseRequestProcessProposal(): RequestProcessProposal {
1889
+ return {
1890
+ txs: [],
1891
+ proposedLastCommit: undefined,
1892
+ misbehavior: [],
1893
+ hash: new Uint8Array(),
1894
+ height: 0,
1895
+ time: undefined,
1896
+ nextValidatorsHash: new Uint8Array(),
1897
+ proposerAddress: new Uint8Array(),
1898
+ };
1899
+ }
1900
+
1901
+ export const RequestProcessProposal = {
1902
+ encode(message: RequestProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
1903
+ for (const v of message.txs) {
1904
+ writer.uint32(10).bytes(v!);
1905
+ }
1906
+ if (message.proposedLastCommit !== undefined) {
1907
+ CommitInfo.encode(message.proposedLastCommit, writer.uint32(18).fork()).ldelim();
1908
+ }
1909
+ for (const v of message.misbehavior) {
1910
+ Misbehavior.encode(v!, writer.uint32(26).fork()).ldelim();
1911
+ }
1912
+ if (message.hash.length !== 0) {
1913
+ writer.uint32(34).bytes(message.hash);
1914
+ }
1915
+ if (message.height !== 0) {
1916
+ writer.uint32(40).int64(message.height);
1917
+ }
1918
+ if (message.time !== undefined) {
1919
+ Timestamp.encode(toTimestamp(message.time), writer.uint32(50).fork()).ldelim();
1920
+ }
1921
+ if (message.nextValidatorsHash.length !== 0) {
1922
+ writer.uint32(58).bytes(message.nextValidatorsHash);
1923
+ }
1924
+ if (message.proposerAddress.length !== 0) {
1925
+ writer.uint32(66).bytes(message.proposerAddress);
1926
+ }
1927
+ return writer;
1928
+ },
1929
+
1930
+ decode(input: _m0.Reader | Uint8Array, length?: number): RequestProcessProposal {
1931
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
1932
+ let end = length === undefined ? reader.len : reader.pos + length;
1933
+ const message = createBaseRequestProcessProposal();
1934
+ while (reader.pos < end) {
1935
+ const tag = reader.uint32();
1936
+ switch (tag >>> 3) {
1937
+ case 1:
1938
+ message.txs.push(reader.bytes());
1939
+ break;
1940
+ case 2:
1941
+ message.proposedLastCommit = CommitInfo.decode(reader, reader.uint32());
1942
+ break;
1943
+ case 3:
1944
+ message.misbehavior.push(Misbehavior.decode(reader, reader.uint32()));
1945
+ break;
1946
+ case 4:
1947
+ message.hash = reader.bytes();
1948
+ break;
1949
+ case 5:
1950
+ message.height = longToNumber(reader.int64() as Long);
1951
+ break;
1952
+ case 6:
1953
+ message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
1954
+ break;
1955
+ case 7:
1956
+ message.nextValidatorsHash = reader.bytes();
1957
+ break;
1958
+ case 8:
1959
+ message.proposerAddress = reader.bytes();
1960
+ break;
1961
+ default:
1962
+ reader.skipType(tag & 7);
1963
+ break;
1964
+ }
1965
+ }
1966
+ return message;
1967
+ },
1968
+
1969
+ fromJSON(object: any): RequestProcessProposal {
1970
+ return {
1971
+ txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [],
1972
+ proposedLastCommit: isSet(object.proposedLastCommit) ? CommitInfo.fromJSON(object.proposedLastCommit) : undefined,
1973
+ misbehavior: Array.isArray(object?.misbehavior)
1974
+ ? object.misbehavior.map((e: any) => Misbehavior.fromJSON(e))
1975
+ : [],
1976
+ hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(),
1977
+ height: isSet(object.height) ? Number(object.height) : 0,
1978
+ time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
1979
+ nextValidatorsHash: isSet(object.nextValidatorsHash)
1980
+ ? bytesFromBase64(object.nextValidatorsHash)
1981
+ : new Uint8Array(),
1982
+ proposerAddress: isSet(object.proposerAddress) ? bytesFromBase64(object.proposerAddress) : new Uint8Array(),
1983
+ };
1984
+ },
1985
+
1986
+ toJSON(message: RequestProcessProposal): unknown {
1987
+ const obj: any = {};
1988
+ if (message.txs) {
1989
+ obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
1990
+ } else {
1991
+ obj.txs = [];
1992
+ }
1993
+ message.proposedLastCommit !== undefined && (obj.proposedLastCommit = message.proposedLastCommit
1994
+ ? CommitInfo.toJSON(message.proposedLastCommit)
1995
+ : undefined);
1996
+ if (message.misbehavior) {
1997
+ obj.misbehavior = message.misbehavior.map((e) => e ? Misbehavior.toJSON(e) : undefined);
1998
+ } else {
1999
+ obj.misbehavior = [];
2000
+ }
2001
+ message.hash !== undefined
2002
+ && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
2003
+ message.height !== undefined && (obj.height = Math.round(message.height));
2004
+ message.time !== undefined && (obj.time = message.time.toISOString());
2005
+ message.nextValidatorsHash !== undefined
2006
+ && (obj.nextValidatorsHash = base64FromBytes(
2007
+ message.nextValidatorsHash !== undefined ? message.nextValidatorsHash : new Uint8Array(),
2008
+ ));
2009
+ message.proposerAddress !== undefined
2010
+ && (obj.proposerAddress = base64FromBytes(
2011
+ message.proposerAddress !== undefined ? message.proposerAddress : new Uint8Array(),
2012
+ ));
2013
+ return obj;
2014
+ },
2015
+
2016
+ fromPartial<I extends Exact<DeepPartial<RequestProcessProposal>, I>>(object: I): RequestProcessProposal {
2017
+ const message = createBaseRequestProcessProposal();
2018
+ message.txs = object.txs?.map((e) => e) || [];
2019
+ message.proposedLastCommit = (object.proposedLastCommit !== undefined && object.proposedLastCommit !== null)
2020
+ ? CommitInfo.fromPartial(object.proposedLastCommit)
2021
+ : undefined;
2022
+ message.misbehavior = object.misbehavior?.map((e) => Misbehavior.fromPartial(e)) || [];
2023
+ message.hash = object.hash ?? new Uint8Array();
2024
+ message.height = object.height ?? 0;
2025
+ message.time = object.time ?? undefined;
2026
+ message.nextValidatorsHash = object.nextValidatorsHash ?? new Uint8Array();
2027
+ message.proposerAddress = object.proposerAddress ?? new Uint8Array();
2028
+ return message;
2029
+ },
2030
+ };
2031
+
2032
+ function createBaseResponse(): Response {
2033
+ return {
2034
+ exception: undefined,
2035
+ echo: undefined,
2036
+ flush: undefined,
2037
+ info: undefined,
2038
+ initChain: undefined,
2039
+ query: undefined,
2040
+ beginBlock: undefined,
2041
+ checkTx: undefined,
2042
+ deliverTx: undefined,
2043
+ endBlock: undefined,
2044
+ commit: undefined,
2045
+ listSnapshots: undefined,
2046
+ offerSnapshot: undefined,
2047
+ loadSnapshotChunk: undefined,
2048
+ applySnapshotChunk: undefined,
2049
+ prepareProposal: undefined,
2050
+ processProposal: undefined,
2051
+ };
2052
+ }
2053
+
2054
+ export const Response = {
2055
+ encode(message: Response, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2056
+ if (message.exception !== undefined) {
2057
+ ResponseException.encode(message.exception, writer.uint32(10).fork()).ldelim();
2058
+ }
2059
+ if (message.echo !== undefined) {
2060
+ ResponseEcho.encode(message.echo, writer.uint32(18).fork()).ldelim();
2061
+ }
2062
+ if (message.flush !== undefined) {
2063
+ ResponseFlush.encode(message.flush, writer.uint32(26).fork()).ldelim();
2064
+ }
2065
+ if (message.info !== undefined) {
2066
+ ResponseInfo.encode(message.info, writer.uint32(34).fork()).ldelim();
2067
+ }
2068
+ if (message.initChain !== undefined) {
2069
+ ResponseInitChain.encode(message.initChain, writer.uint32(50).fork()).ldelim();
2070
+ }
2071
+ if (message.query !== undefined) {
2072
+ ResponseQuery.encode(message.query, writer.uint32(58).fork()).ldelim();
2073
+ }
2074
+ if (message.beginBlock !== undefined) {
2075
+ ResponseBeginBlock.encode(message.beginBlock, writer.uint32(66).fork()).ldelim();
2076
+ }
2077
+ if (message.checkTx !== undefined) {
2078
+ ResponseCheckTx.encode(message.checkTx, writer.uint32(74).fork()).ldelim();
2079
+ }
2080
+ if (message.deliverTx !== undefined) {
2081
+ ResponseDeliverTx.encode(message.deliverTx, writer.uint32(82).fork()).ldelim();
2082
+ }
2083
+ if (message.endBlock !== undefined) {
2084
+ ResponseEndBlock.encode(message.endBlock, writer.uint32(90).fork()).ldelim();
2085
+ }
2086
+ if (message.commit !== undefined) {
2087
+ ResponseCommit.encode(message.commit, writer.uint32(98).fork()).ldelim();
2088
+ }
2089
+ if (message.listSnapshots !== undefined) {
2090
+ ResponseListSnapshots.encode(message.listSnapshots, writer.uint32(106).fork()).ldelim();
2091
+ }
2092
+ if (message.offerSnapshot !== undefined) {
2093
+ ResponseOfferSnapshot.encode(message.offerSnapshot, writer.uint32(114).fork()).ldelim();
2094
+ }
2095
+ if (message.loadSnapshotChunk !== undefined) {
2096
+ ResponseLoadSnapshotChunk.encode(message.loadSnapshotChunk, writer.uint32(122).fork()).ldelim();
2097
+ }
2098
+ if (message.applySnapshotChunk !== undefined) {
2099
+ ResponseApplySnapshotChunk.encode(message.applySnapshotChunk, writer.uint32(130).fork()).ldelim();
2100
+ }
2101
+ if (message.prepareProposal !== undefined) {
2102
+ ResponsePrepareProposal.encode(message.prepareProposal, writer.uint32(138).fork()).ldelim();
2103
+ }
2104
+ if (message.processProposal !== undefined) {
2105
+ ResponseProcessProposal.encode(message.processProposal, writer.uint32(146).fork()).ldelim();
2106
+ }
2107
+ return writer;
2108
+ },
2109
+
2110
+ decode(input: _m0.Reader | Uint8Array, length?: number): Response {
2111
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2112
+ let end = length === undefined ? reader.len : reader.pos + length;
2113
+ const message = createBaseResponse();
2114
+ while (reader.pos < end) {
2115
+ const tag = reader.uint32();
2116
+ switch (tag >>> 3) {
2117
+ case 1:
2118
+ message.exception = ResponseException.decode(reader, reader.uint32());
2119
+ break;
2120
+ case 2:
2121
+ message.echo = ResponseEcho.decode(reader, reader.uint32());
2122
+ break;
2123
+ case 3:
2124
+ message.flush = ResponseFlush.decode(reader, reader.uint32());
2125
+ break;
2126
+ case 4:
2127
+ message.info = ResponseInfo.decode(reader, reader.uint32());
2128
+ break;
2129
+ case 6:
2130
+ message.initChain = ResponseInitChain.decode(reader, reader.uint32());
2131
+ break;
2132
+ case 7:
2133
+ message.query = ResponseQuery.decode(reader, reader.uint32());
2134
+ break;
2135
+ case 8:
2136
+ message.beginBlock = ResponseBeginBlock.decode(reader, reader.uint32());
2137
+ break;
2138
+ case 9:
2139
+ message.checkTx = ResponseCheckTx.decode(reader, reader.uint32());
2140
+ break;
2141
+ case 10:
2142
+ message.deliverTx = ResponseDeliverTx.decode(reader, reader.uint32());
2143
+ break;
2144
+ case 11:
2145
+ message.endBlock = ResponseEndBlock.decode(reader, reader.uint32());
2146
+ break;
2147
+ case 12:
2148
+ message.commit = ResponseCommit.decode(reader, reader.uint32());
2149
+ break;
2150
+ case 13:
2151
+ message.listSnapshots = ResponseListSnapshots.decode(reader, reader.uint32());
2152
+ break;
2153
+ case 14:
2154
+ message.offerSnapshot = ResponseOfferSnapshot.decode(reader, reader.uint32());
2155
+ break;
2156
+ case 15:
2157
+ message.loadSnapshotChunk = ResponseLoadSnapshotChunk.decode(reader, reader.uint32());
2158
+ break;
2159
+ case 16:
2160
+ message.applySnapshotChunk = ResponseApplySnapshotChunk.decode(reader, reader.uint32());
2161
+ break;
2162
+ case 17:
2163
+ message.prepareProposal = ResponsePrepareProposal.decode(reader, reader.uint32());
2164
+ break;
2165
+ case 18:
2166
+ message.processProposal = ResponseProcessProposal.decode(reader, reader.uint32());
2167
+ break;
2168
+ default:
2169
+ reader.skipType(tag & 7);
2170
+ break;
2171
+ }
2172
+ }
2173
+ return message;
2174
+ },
2175
+
2176
+ fromJSON(object: any): Response {
2177
+ return {
2178
+ exception: isSet(object.exception) ? ResponseException.fromJSON(object.exception) : undefined,
2179
+ echo: isSet(object.echo) ? ResponseEcho.fromJSON(object.echo) : undefined,
2180
+ flush: isSet(object.flush) ? ResponseFlush.fromJSON(object.flush) : undefined,
2181
+ info: isSet(object.info) ? ResponseInfo.fromJSON(object.info) : undefined,
2182
+ initChain: isSet(object.initChain) ? ResponseInitChain.fromJSON(object.initChain) : undefined,
2183
+ query: isSet(object.query) ? ResponseQuery.fromJSON(object.query) : undefined,
2184
+ beginBlock: isSet(object.beginBlock) ? ResponseBeginBlock.fromJSON(object.beginBlock) : undefined,
2185
+ checkTx: isSet(object.checkTx) ? ResponseCheckTx.fromJSON(object.checkTx) : undefined,
2186
+ deliverTx: isSet(object.deliverTx) ? ResponseDeliverTx.fromJSON(object.deliverTx) : undefined,
2187
+ endBlock: isSet(object.endBlock) ? ResponseEndBlock.fromJSON(object.endBlock) : undefined,
2188
+ commit: isSet(object.commit) ? ResponseCommit.fromJSON(object.commit) : undefined,
2189
+ listSnapshots: isSet(object.listSnapshots) ? ResponseListSnapshots.fromJSON(object.listSnapshots) : undefined,
2190
+ offerSnapshot: isSet(object.offerSnapshot) ? ResponseOfferSnapshot.fromJSON(object.offerSnapshot) : undefined,
2191
+ loadSnapshotChunk: isSet(object.loadSnapshotChunk)
2192
+ ? ResponseLoadSnapshotChunk.fromJSON(object.loadSnapshotChunk)
2193
+ : undefined,
2194
+ applySnapshotChunk: isSet(object.applySnapshotChunk)
2195
+ ? ResponseApplySnapshotChunk.fromJSON(object.applySnapshotChunk)
2196
+ : undefined,
2197
+ prepareProposal: isSet(object.prepareProposal)
2198
+ ? ResponsePrepareProposal.fromJSON(object.prepareProposal)
2199
+ : undefined,
2200
+ processProposal: isSet(object.processProposal)
2201
+ ? ResponseProcessProposal.fromJSON(object.processProposal)
2202
+ : undefined,
2203
+ };
2204
+ },
2205
+
2206
+ toJSON(message: Response): unknown {
2207
+ const obj: any = {};
2208
+ message.exception !== undefined
2209
+ && (obj.exception = message.exception ? ResponseException.toJSON(message.exception) : undefined);
2210
+ message.echo !== undefined && (obj.echo = message.echo ? ResponseEcho.toJSON(message.echo) : undefined);
2211
+ message.flush !== undefined && (obj.flush = message.flush ? ResponseFlush.toJSON(message.flush) : undefined);
2212
+ message.info !== undefined && (obj.info = message.info ? ResponseInfo.toJSON(message.info) : undefined);
2213
+ message.initChain !== undefined
2214
+ && (obj.initChain = message.initChain ? ResponseInitChain.toJSON(message.initChain) : undefined);
2215
+ message.query !== undefined && (obj.query = message.query ? ResponseQuery.toJSON(message.query) : undefined);
2216
+ message.beginBlock !== undefined
2217
+ && (obj.beginBlock = message.beginBlock ? ResponseBeginBlock.toJSON(message.beginBlock) : undefined);
2218
+ message.checkTx !== undefined
2219
+ && (obj.checkTx = message.checkTx ? ResponseCheckTx.toJSON(message.checkTx) : undefined);
2220
+ message.deliverTx !== undefined
2221
+ && (obj.deliverTx = message.deliverTx ? ResponseDeliverTx.toJSON(message.deliverTx) : undefined);
2222
+ message.endBlock !== undefined
2223
+ && (obj.endBlock = message.endBlock ? ResponseEndBlock.toJSON(message.endBlock) : undefined);
2224
+ message.commit !== undefined && (obj.commit = message.commit ? ResponseCommit.toJSON(message.commit) : undefined);
2225
+ message.listSnapshots !== undefined
2226
+ && (obj.listSnapshots = message.listSnapshots ? ResponseListSnapshots.toJSON(message.listSnapshots) : undefined);
2227
+ message.offerSnapshot !== undefined
2228
+ && (obj.offerSnapshot = message.offerSnapshot ? ResponseOfferSnapshot.toJSON(message.offerSnapshot) : undefined);
2229
+ message.loadSnapshotChunk !== undefined && (obj.loadSnapshotChunk = message.loadSnapshotChunk
2230
+ ? ResponseLoadSnapshotChunk.toJSON(message.loadSnapshotChunk)
2231
+ : undefined);
2232
+ message.applySnapshotChunk !== undefined && (obj.applySnapshotChunk = message.applySnapshotChunk
2233
+ ? ResponseApplySnapshotChunk.toJSON(message.applySnapshotChunk)
2234
+ : undefined);
2235
+ message.prepareProposal !== undefined && (obj.prepareProposal = message.prepareProposal
2236
+ ? ResponsePrepareProposal.toJSON(message.prepareProposal)
2237
+ : undefined);
2238
+ message.processProposal !== undefined && (obj.processProposal = message.processProposal
2239
+ ? ResponseProcessProposal.toJSON(message.processProposal)
2240
+ : undefined);
2241
+ return obj;
2242
+ },
2243
+
2244
+ fromPartial<I extends Exact<DeepPartial<Response>, I>>(object: I): Response {
2245
+ const message = createBaseResponse();
2246
+ message.exception = (object.exception !== undefined && object.exception !== null)
2247
+ ? ResponseException.fromPartial(object.exception)
2248
+ : undefined;
2249
+ message.echo = (object.echo !== undefined && object.echo !== null)
2250
+ ? ResponseEcho.fromPartial(object.echo)
2251
+ : undefined;
2252
+ message.flush = (object.flush !== undefined && object.flush !== null)
2253
+ ? ResponseFlush.fromPartial(object.flush)
2254
+ : undefined;
2255
+ message.info = (object.info !== undefined && object.info !== null)
2256
+ ? ResponseInfo.fromPartial(object.info)
2257
+ : undefined;
2258
+ message.initChain = (object.initChain !== undefined && object.initChain !== null)
2259
+ ? ResponseInitChain.fromPartial(object.initChain)
2260
+ : undefined;
2261
+ message.query = (object.query !== undefined && object.query !== null)
2262
+ ? ResponseQuery.fromPartial(object.query)
2263
+ : undefined;
2264
+ message.beginBlock = (object.beginBlock !== undefined && object.beginBlock !== null)
2265
+ ? ResponseBeginBlock.fromPartial(object.beginBlock)
2266
+ : undefined;
2267
+ message.checkTx = (object.checkTx !== undefined && object.checkTx !== null)
2268
+ ? ResponseCheckTx.fromPartial(object.checkTx)
2269
+ : undefined;
2270
+ message.deliverTx = (object.deliverTx !== undefined && object.deliverTx !== null)
2271
+ ? ResponseDeliverTx.fromPartial(object.deliverTx)
2272
+ : undefined;
2273
+ message.endBlock = (object.endBlock !== undefined && object.endBlock !== null)
2274
+ ? ResponseEndBlock.fromPartial(object.endBlock)
2275
+ : undefined;
2276
+ message.commit = (object.commit !== undefined && object.commit !== null)
2277
+ ? ResponseCommit.fromPartial(object.commit)
2278
+ : undefined;
2279
+ message.listSnapshots = (object.listSnapshots !== undefined && object.listSnapshots !== null)
2280
+ ? ResponseListSnapshots.fromPartial(object.listSnapshots)
2281
+ : undefined;
2282
+ message.offerSnapshot = (object.offerSnapshot !== undefined && object.offerSnapshot !== null)
2283
+ ? ResponseOfferSnapshot.fromPartial(object.offerSnapshot)
2284
+ : undefined;
2285
+ message.loadSnapshotChunk = (object.loadSnapshotChunk !== undefined && object.loadSnapshotChunk !== null)
2286
+ ? ResponseLoadSnapshotChunk.fromPartial(object.loadSnapshotChunk)
2287
+ : undefined;
2288
+ message.applySnapshotChunk = (object.applySnapshotChunk !== undefined && object.applySnapshotChunk !== null)
2289
+ ? ResponseApplySnapshotChunk.fromPartial(object.applySnapshotChunk)
2290
+ : undefined;
2291
+ message.prepareProposal = (object.prepareProposal !== undefined && object.prepareProposal !== null)
2292
+ ? ResponsePrepareProposal.fromPartial(object.prepareProposal)
2293
+ : undefined;
2294
+ message.processProposal = (object.processProposal !== undefined && object.processProposal !== null)
2295
+ ? ResponseProcessProposal.fromPartial(object.processProposal)
2296
+ : undefined;
2297
+ return message;
2298
+ },
2299
+ };
2300
+
2301
+ function createBaseResponseException(): ResponseException {
2302
+ return { error: "" };
2303
+ }
2304
+
2305
+ export const ResponseException = {
2306
+ encode(message: ResponseException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2307
+ if (message.error !== "") {
2308
+ writer.uint32(10).string(message.error);
2309
+ }
2310
+ return writer;
2311
+ },
2312
+
2313
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseException {
2314
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2315
+ let end = length === undefined ? reader.len : reader.pos + length;
2316
+ const message = createBaseResponseException();
2317
+ while (reader.pos < end) {
2318
+ const tag = reader.uint32();
2319
+ switch (tag >>> 3) {
2320
+ case 1:
2321
+ message.error = reader.string();
2322
+ break;
2323
+ default:
2324
+ reader.skipType(tag & 7);
2325
+ break;
2326
+ }
2327
+ }
2328
+ return message;
2329
+ },
2330
+
2331
+ fromJSON(object: any): ResponseException {
2332
+ return { error: isSet(object.error) ? String(object.error) : "" };
2333
+ },
2334
+
2335
+ toJSON(message: ResponseException): unknown {
2336
+ const obj: any = {};
2337
+ message.error !== undefined && (obj.error = message.error);
2338
+ return obj;
2339
+ },
2340
+
2341
+ fromPartial<I extends Exact<DeepPartial<ResponseException>, I>>(object: I): ResponseException {
2342
+ const message = createBaseResponseException();
2343
+ message.error = object.error ?? "";
2344
+ return message;
2345
+ },
2346
+ };
2347
+
2348
+ function createBaseResponseEcho(): ResponseEcho {
2349
+ return { message: "" };
2350
+ }
2351
+
2352
+ export const ResponseEcho = {
2353
+ encode(message: ResponseEcho, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2354
+ if (message.message !== "") {
2355
+ writer.uint32(10).string(message.message);
2356
+ }
2357
+ return writer;
2358
+ },
2359
+
2360
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEcho {
2361
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2362
+ let end = length === undefined ? reader.len : reader.pos + length;
2363
+ const message = createBaseResponseEcho();
2364
+ while (reader.pos < end) {
2365
+ const tag = reader.uint32();
2366
+ switch (tag >>> 3) {
2367
+ case 1:
2368
+ message.message = reader.string();
2369
+ break;
2370
+ default:
2371
+ reader.skipType(tag & 7);
2372
+ break;
2373
+ }
2374
+ }
2375
+ return message;
2376
+ },
2377
+
2378
+ fromJSON(object: any): ResponseEcho {
2379
+ return { message: isSet(object.message) ? String(object.message) : "" };
2380
+ },
2381
+
2382
+ toJSON(message: ResponseEcho): unknown {
2383
+ const obj: any = {};
2384
+ message.message !== undefined && (obj.message = message.message);
2385
+ return obj;
2386
+ },
2387
+
2388
+ fromPartial<I extends Exact<DeepPartial<ResponseEcho>, I>>(object: I): ResponseEcho {
2389
+ const message = createBaseResponseEcho();
2390
+ message.message = object.message ?? "";
2391
+ return message;
2392
+ },
2393
+ };
2394
+
2395
+ function createBaseResponseFlush(): ResponseFlush {
2396
+ return {};
2397
+ }
2398
+
2399
+ export const ResponseFlush = {
2400
+ encode(_: ResponseFlush, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2401
+ return writer;
2402
+ },
2403
+
2404
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseFlush {
2405
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2406
+ let end = length === undefined ? reader.len : reader.pos + length;
2407
+ const message = createBaseResponseFlush();
2408
+ while (reader.pos < end) {
2409
+ const tag = reader.uint32();
2410
+ switch (tag >>> 3) {
2411
+ default:
2412
+ reader.skipType(tag & 7);
2413
+ break;
2414
+ }
2415
+ }
2416
+ return message;
2417
+ },
2418
+
2419
+ fromJSON(_: any): ResponseFlush {
2420
+ return {};
2421
+ },
2422
+
2423
+ toJSON(_: ResponseFlush): unknown {
2424
+ const obj: any = {};
2425
+ return obj;
2426
+ },
2427
+
2428
+ fromPartial<I extends Exact<DeepPartial<ResponseFlush>, I>>(_: I): ResponseFlush {
2429
+ const message = createBaseResponseFlush();
2430
+ return message;
2431
+ },
2432
+ };
2433
+
2434
+ function createBaseResponseInfo(): ResponseInfo {
2435
+ return { data: "", version: "", appVersion: 0, lastBlockHeight: 0, lastBlockAppHash: new Uint8Array() };
2436
+ }
2437
+
2438
+ export const ResponseInfo = {
2439
+ encode(message: ResponseInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2440
+ if (message.data !== "") {
2441
+ writer.uint32(10).string(message.data);
2442
+ }
2443
+ if (message.version !== "") {
2444
+ writer.uint32(18).string(message.version);
2445
+ }
2446
+ if (message.appVersion !== 0) {
2447
+ writer.uint32(24).uint64(message.appVersion);
2448
+ }
2449
+ if (message.lastBlockHeight !== 0) {
2450
+ writer.uint32(32).int64(message.lastBlockHeight);
2451
+ }
2452
+ if (message.lastBlockAppHash.length !== 0) {
2453
+ writer.uint32(42).bytes(message.lastBlockAppHash);
2454
+ }
2455
+ return writer;
2456
+ },
2457
+
2458
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInfo {
2459
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2460
+ let end = length === undefined ? reader.len : reader.pos + length;
2461
+ const message = createBaseResponseInfo();
2462
+ while (reader.pos < end) {
2463
+ const tag = reader.uint32();
2464
+ switch (tag >>> 3) {
2465
+ case 1:
2466
+ message.data = reader.string();
2467
+ break;
2468
+ case 2:
2469
+ message.version = reader.string();
2470
+ break;
2471
+ case 3:
2472
+ message.appVersion = longToNumber(reader.uint64() as Long);
2473
+ break;
2474
+ case 4:
2475
+ message.lastBlockHeight = longToNumber(reader.int64() as Long);
2476
+ break;
2477
+ case 5:
2478
+ message.lastBlockAppHash = reader.bytes();
2479
+ break;
2480
+ default:
2481
+ reader.skipType(tag & 7);
2482
+ break;
2483
+ }
2484
+ }
2485
+ return message;
2486
+ },
2487
+
2488
+ fromJSON(object: any): ResponseInfo {
2489
+ return {
2490
+ data: isSet(object.data) ? String(object.data) : "",
2491
+ version: isSet(object.version) ? String(object.version) : "",
2492
+ appVersion: isSet(object.appVersion) ? Number(object.appVersion) : 0,
2493
+ lastBlockHeight: isSet(object.lastBlockHeight) ? Number(object.lastBlockHeight) : 0,
2494
+ lastBlockAppHash: isSet(object.lastBlockAppHash) ? bytesFromBase64(object.lastBlockAppHash) : new Uint8Array(),
2495
+ };
2496
+ },
2497
+
2498
+ toJSON(message: ResponseInfo): unknown {
2499
+ const obj: any = {};
2500
+ message.data !== undefined && (obj.data = message.data);
2501
+ message.version !== undefined && (obj.version = message.version);
2502
+ message.appVersion !== undefined && (obj.appVersion = Math.round(message.appVersion));
2503
+ message.lastBlockHeight !== undefined && (obj.lastBlockHeight = Math.round(message.lastBlockHeight));
2504
+ message.lastBlockAppHash !== undefined
2505
+ && (obj.lastBlockAppHash = base64FromBytes(
2506
+ message.lastBlockAppHash !== undefined ? message.lastBlockAppHash : new Uint8Array(),
2507
+ ));
2508
+ return obj;
2509
+ },
2510
+
2511
+ fromPartial<I extends Exact<DeepPartial<ResponseInfo>, I>>(object: I): ResponseInfo {
2512
+ const message = createBaseResponseInfo();
2513
+ message.data = object.data ?? "";
2514
+ message.version = object.version ?? "";
2515
+ message.appVersion = object.appVersion ?? 0;
2516
+ message.lastBlockHeight = object.lastBlockHeight ?? 0;
2517
+ message.lastBlockAppHash = object.lastBlockAppHash ?? new Uint8Array();
2518
+ return message;
2519
+ },
2520
+ };
2521
+
2522
+ function createBaseResponseInitChain(): ResponseInitChain {
2523
+ return { consensusParams: undefined, validators: [], appHash: new Uint8Array() };
2524
+ }
2525
+
2526
+ export const ResponseInitChain = {
2527
+ encode(message: ResponseInitChain, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2528
+ if (message.consensusParams !== undefined) {
2529
+ ConsensusParams.encode(message.consensusParams, writer.uint32(10).fork()).ldelim();
2530
+ }
2531
+ for (const v of message.validators) {
2532
+ ValidatorUpdate.encode(v!, writer.uint32(18).fork()).ldelim();
2533
+ }
2534
+ if (message.appHash.length !== 0) {
2535
+ writer.uint32(26).bytes(message.appHash);
2536
+ }
2537
+ return writer;
2538
+ },
2539
+
2540
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseInitChain {
2541
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2542
+ let end = length === undefined ? reader.len : reader.pos + length;
2543
+ const message = createBaseResponseInitChain();
2544
+ while (reader.pos < end) {
2545
+ const tag = reader.uint32();
2546
+ switch (tag >>> 3) {
2547
+ case 1:
2548
+ message.consensusParams = ConsensusParams.decode(reader, reader.uint32());
2549
+ break;
2550
+ case 2:
2551
+ message.validators.push(ValidatorUpdate.decode(reader, reader.uint32()));
2552
+ break;
2553
+ case 3:
2554
+ message.appHash = reader.bytes();
2555
+ break;
2556
+ default:
2557
+ reader.skipType(tag & 7);
2558
+ break;
2559
+ }
2560
+ }
2561
+ return message;
2562
+ },
2563
+
2564
+ fromJSON(object: any): ResponseInitChain {
2565
+ return {
2566
+ consensusParams: isSet(object.consensusParams) ? ConsensusParams.fromJSON(object.consensusParams) : undefined,
2567
+ validators: Array.isArray(object?.validators)
2568
+ ? object.validators.map((e: any) => ValidatorUpdate.fromJSON(e))
2569
+ : [],
2570
+ appHash: isSet(object.appHash) ? bytesFromBase64(object.appHash) : new Uint8Array(),
2571
+ };
2572
+ },
2573
+
2574
+ toJSON(message: ResponseInitChain): unknown {
2575
+ const obj: any = {};
2576
+ message.consensusParams !== undefined
2577
+ && (obj.consensusParams = message.consensusParams ? ConsensusParams.toJSON(message.consensusParams) : undefined);
2578
+ if (message.validators) {
2579
+ obj.validators = message.validators.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined);
2580
+ } else {
2581
+ obj.validators = [];
2582
+ }
2583
+ message.appHash !== undefined
2584
+ && (obj.appHash = base64FromBytes(message.appHash !== undefined ? message.appHash : new Uint8Array()));
2585
+ return obj;
2586
+ },
2587
+
2588
+ fromPartial<I extends Exact<DeepPartial<ResponseInitChain>, I>>(object: I): ResponseInitChain {
2589
+ const message = createBaseResponseInitChain();
2590
+ message.consensusParams = (object.consensusParams !== undefined && object.consensusParams !== null)
2591
+ ? ConsensusParams.fromPartial(object.consensusParams)
2592
+ : undefined;
2593
+ message.validators = object.validators?.map((e) => ValidatorUpdate.fromPartial(e)) || [];
2594
+ message.appHash = object.appHash ?? new Uint8Array();
2595
+ return message;
2596
+ },
2597
+ };
2598
+
2599
+ function createBaseResponseQuery(): ResponseQuery {
2600
+ return {
2601
+ code: 0,
2602
+ log: "",
2603
+ info: "",
2604
+ index: 0,
2605
+ key: new Uint8Array(),
2606
+ value: new Uint8Array(),
2607
+ proofOps: undefined,
2608
+ height: 0,
2609
+ codespace: "",
2610
+ };
2611
+ }
2612
+
2613
+ export const ResponseQuery = {
2614
+ encode(message: ResponseQuery, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2615
+ if (message.code !== 0) {
2616
+ writer.uint32(8).uint32(message.code);
2617
+ }
2618
+ if (message.log !== "") {
2619
+ writer.uint32(26).string(message.log);
2620
+ }
2621
+ if (message.info !== "") {
2622
+ writer.uint32(34).string(message.info);
2623
+ }
2624
+ if (message.index !== 0) {
2625
+ writer.uint32(40).int64(message.index);
2626
+ }
2627
+ if (message.key.length !== 0) {
2628
+ writer.uint32(50).bytes(message.key);
2629
+ }
2630
+ if (message.value.length !== 0) {
2631
+ writer.uint32(58).bytes(message.value);
2632
+ }
2633
+ if (message.proofOps !== undefined) {
2634
+ ProofOps.encode(message.proofOps, writer.uint32(66).fork()).ldelim();
2635
+ }
2636
+ if (message.height !== 0) {
2637
+ writer.uint32(72).int64(message.height);
2638
+ }
2639
+ if (message.codespace !== "") {
2640
+ writer.uint32(82).string(message.codespace);
2641
+ }
2642
+ return writer;
2643
+ },
2644
+
2645
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseQuery {
2646
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2647
+ let end = length === undefined ? reader.len : reader.pos + length;
2648
+ const message = createBaseResponseQuery();
2649
+ while (reader.pos < end) {
2650
+ const tag = reader.uint32();
2651
+ switch (tag >>> 3) {
2652
+ case 1:
2653
+ message.code = reader.uint32();
2654
+ break;
2655
+ case 3:
2656
+ message.log = reader.string();
2657
+ break;
2658
+ case 4:
2659
+ message.info = reader.string();
2660
+ break;
2661
+ case 5:
2662
+ message.index = longToNumber(reader.int64() as Long);
2663
+ break;
2664
+ case 6:
2665
+ message.key = reader.bytes();
2666
+ break;
2667
+ case 7:
2668
+ message.value = reader.bytes();
2669
+ break;
2670
+ case 8:
2671
+ message.proofOps = ProofOps.decode(reader, reader.uint32());
2672
+ break;
2673
+ case 9:
2674
+ message.height = longToNumber(reader.int64() as Long);
2675
+ break;
2676
+ case 10:
2677
+ message.codespace = reader.string();
2678
+ break;
2679
+ default:
2680
+ reader.skipType(tag & 7);
2681
+ break;
2682
+ }
2683
+ }
2684
+ return message;
2685
+ },
2686
+
2687
+ fromJSON(object: any): ResponseQuery {
2688
+ return {
2689
+ code: isSet(object.code) ? Number(object.code) : 0,
2690
+ log: isSet(object.log) ? String(object.log) : "",
2691
+ info: isSet(object.info) ? String(object.info) : "",
2692
+ index: isSet(object.index) ? Number(object.index) : 0,
2693
+ key: isSet(object.key) ? bytesFromBase64(object.key) : new Uint8Array(),
2694
+ value: isSet(object.value) ? bytesFromBase64(object.value) : new Uint8Array(),
2695
+ proofOps: isSet(object.proofOps) ? ProofOps.fromJSON(object.proofOps) : undefined,
2696
+ height: isSet(object.height) ? Number(object.height) : 0,
2697
+ codespace: isSet(object.codespace) ? String(object.codespace) : "",
2698
+ };
2699
+ },
2700
+
2701
+ toJSON(message: ResponseQuery): unknown {
2702
+ const obj: any = {};
2703
+ message.code !== undefined && (obj.code = Math.round(message.code));
2704
+ message.log !== undefined && (obj.log = message.log);
2705
+ message.info !== undefined && (obj.info = message.info);
2706
+ message.index !== undefined && (obj.index = Math.round(message.index));
2707
+ message.key !== undefined
2708
+ && (obj.key = base64FromBytes(message.key !== undefined ? message.key : new Uint8Array()));
2709
+ message.value !== undefined
2710
+ && (obj.value = base64FromBytes(message.value !== undefined ? message.value : new Uint8Array()));
2711
+ message.proofOps !== undefined && (obj.proofOps = message.proofOps ? ProofOps.toJSON(message.proofOps) : undefined);
2712
+ message.height !== undefined && (obj.height = Math.round(message.height));
2713
+ message.codespace !== undefined && (obj.codespace = message.codespace);
2714
+ return obj;
2715
+ },
2716
+
2717
+ fromPartial<I extends Exact<DeepPartial<ResponseQuery>, I>>(object: I): ResponseQuery {
2718
+ const message = createBaseResponseQuery();
2719
+ message.code = object.code ?? 0;
2720
+ message.log = object.log ?? "";
2721
+ message.info = object.info ?? "";
2722
+ message.index = object.index ?? 0;
2723
+ message.key = object.key ?? new Uint8Array();
2724
+ message.value = object.value ?? new Uint8Array();
2725
+ message.proofOps = (object.proofOps !== undefined && object.proofOps !== null)
2726
+ ? ProofOps.fromPartial(object.proofOps)
2727
+ : undefined;
2728
+ message.height = object.height ?? 0;
2729
+ message.codespace = object.codespace ?? "";
2730
+ return message;
2731
+ },
2732
+ };
2733
+
2734
+ function createBaseResponseBeginBlock(): ResponseBeginBlock {
2735
+ return { events: [] };
2736
+ }
2737
+
2738
+ export const ResponseBeginBlock = {
2739
+ encode(message: ResponseBeginBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2740
+ for (const v of message.events) {
2741
+ Event.encode(v!, writer.uint32(10).fork()).ldelim();
2742
+ }
2743
+ return writer;
2744
+ },
2745
+
2746
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseBeginBlock {
2747
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2748
+ let end = length === undefined ? reader.len : reader.pos + length;
2749
+ const message = createBaseResponseBeginBlock();
2750
+ while (reader.pos < end) {
2751
+ const tag = reader.uint32();
2752
+ switch (tag >>> 3) {
2753
+ case 1:
2754
+ message.events.push(Event.decode(reader, reader.uint32()));
2755
+ break;
2756
+ default:
2757
+ reader.skipType(tag & 7);
2758
+ break;
2759
+ }
2760
+ }
2761
+ return message;
2762
+ },
2763
+
2764
+ fromJSON(object: any): ResponseBeginBlock {
2765
+ return { events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [] };
2766
+ },
2767
+
2768
+ toJSON(message: ResponseBeginBlock): unknown {
2769
+ const obj: any = {};
2770
+ if (message.events) {
2771
+ obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined);
2772
+ } else {
2773
+ obj.events = [];
2774
+ }
2775
+ return obj;
2776
+ },
2777
+
2778
+ fromPartial<I extends Exact<DeepPartial<ResponseBeginBlock>, I>>(object: I): ResponseBeginBlock {
2779
+ const message = createBaseResponseBeginBlock();
2780
+ message.events = object.events?.map((e) => Event.fromPartial(e)) || [];
2781
+ return message;
2782
+ },
2783
+ };
2784
+
2785
+ function createBaseResponseCheckTx(): ResponseCheckTx {
2786
+ return {
2787
+ code: 0,
2788
+ data: new Uint8Array(),
2789
+ log: "",
2790
+ info: "",
2791
+ gasWanted: 0,
2792
+ gasUsed: 0,
2793
+ events: [],
2794
+ codespace: "",
2795
+ sender: "",
2796
+ priority: 0,
2797
+ mempoolError: "",
2798
+ };
2799
+ }
2800
+
2801
+ export const ResponseCheckTx = {
2802
+ encode(message: ResponseCheckTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2803
+ if (message.code !== 0) {
2804
+ writer.uint32(8).uint32(message.code);
2805
+ }
2806
+ if (message.data.length !== 0) {
2807
+ writer.uint32(18).bytes(message.data);
2808
+ }
2809
+ if (message.log !== "") {
2810
+ writer.uint32(26).string(message.log);
2811
+ }
2812
+ if (message.info !== "") {
2813
+ writer.uint32(34).string(message.info);
2814
+ }
2815
+ if (message.gasWanted !== 0) {
2816
+ writer.uint32(40).int64(message.gasWanted);
2817
+ }
2818
+ if (message.gasUsed !== 0) {
2819
+ writer.uint32(48).int64(message.gasUsed);
2820
+ }
2821
+ for (const v of message.events) {
2822
+ Event.encode(v!, writer.uint32(58).fork()).ldelim();
2823
+ }
2824
+ if (message.codespace !== "") {
2825
+ writer.uint32(66).string(message.codespace);
2826
+ }
2827
+ if (message.sender !== "") {
2828
+ writer.uint32(74).string(message.sender);
2829
+ }
2830
+ if (message.priority !== 0) {
2831
+ writer.uint32(80).int64(message.priority);
2832
+ }
2833
+ if (message.mempoolError !== "") {
2834
+ writer.uint32(90).string(message.mempoolError);
2835
+ }
2836
+ return writer;
2837
+ },
2838
+
2839
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCheckTx {
2840
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2841
+ let end = length === undefined ? reader.len : reader.pos + length;
2842
+ const message = createBaseResponseCheckTx();
2843
+ while (reader.pos < end) {
2844
+ const tag = reader.uint32();
2845
+ switch (tag >>> 3) {
2846
+ case 1:
2847
+ message.code = reader.uint32();
2848
+ break;
2849
+ case 2:
2850
+ message.data = reader.bytes();
2851
+ break;
2852
+ case 3:
2853
+ message.log = reader.string();
2854
+ break;
2855
+ case 4:
2856
+ message.info = reader.string();
2857
+ break;
2858
+ case 5:
2859
+ message.gasWanted = longToNumber(reader.int64() as Long);
2860
+ break;
2861
+ case 6:
2862
+ message.gasUsed = longToNumber(reader.int64() as Long);
2863
+ break;
2864
+ case 7:
2865
+ message.events.push(Event.decode(reader, reader.uint32()));
2866
+ break;
2867
+ case 8:
2868
+ message.codespace = reader.string();
2869
+ break;
2870
+ case 9:
2871
+ message.sender = reader.string();
2872
+ break;
2873
+ case 10:
2874
+ message.priority = longToNumber(reader.int64() as Long);
2875
+ break;
2876
+ case 11:
2877
+ message.mempoolError = reader.string();
2878
+ break;
2879
+ default:
2880
+ reader.skipType(tag & 7);
2881
+ break;
2882
+ }
2883
+ }
2884
+ return message;
2885
+ },
2886
+
2887
+ fromJSON(object: any): ResponseCheckTx {
2888
+ return {
2889
+ code: isSet(object.code) ? Number(object.code) : 0,
2890
+ data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
2891
+ log: isSet(object.log) ? String(object.log) : "",
2892
+ info: isSet(object.info) ? String(object.info) : "",
2893
+ gasWanted: isSet(object.gas_wanted) ? Number(object.gas_wanted) : 0,
2894
+ gasUsed: isSet(object.gas_used) ? Number(object.gas_used) : 0,
2895
+ events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [],
2896
+ codespace: isSet(object.codespace) ? String(object.codespace) : "",
2897
+ sender: isSet(object.sender) ? String(object.sender) : "",
2898
+ priority: isSet(object.priority) ? Number(object.priority) : 0,
2899
+ mempoolError: isSet(object.mempoolError) ? String(object.mempoolError) : "",
2900
+ };
2901
+ },
2902
+
2903
+ toJSON(message: ResponseCheckTx): unknown {
2904
+ const obj: any = {};
2905
+ message.code !== undefined && (obj.code = Math.round(message.code));
2906
+ message.data !== undefined
2907
+ && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
2908
+ message.log !== undefined && (obj.log = message.log);
2909
+ message.info !== undefined && (obj.info = message.info);
2910
+ message.gasWanted !== undefined && (obj.gas_wanted = Math.round(message.gasWanted));
2911
+ message.gasUsed !== undefined && (obj.gas_used = Math.round(message.gasUsed));
2912
+ if (message.events) {
2913
+ obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined);
2914
+ } else {
2915
+ obj.events = [];
2916
+ }
2917
+ message.codespace !== undefined && (obj.codespace = message.codespace);
2918
+ message.sender !== undefined && (obj.sender = message.sender);
2919
+ message.priority !== undefined && (obj.priority = Math.round(message.priority));
2920
+ message.mempoolError !== undefined && (obj.mempoolError = message.mempoolError);
2921
+ return obj;
2922
+ },
2923
+
2924
+ fromPartial<I extends Exact<DeepPartial<ResponseCheckTx>, I>>(object: I): ResponseCheckTx {
2925
+ const message = createBaseResponseCheckTx();
2926
+ message.code = object.code ?? 0;
2927
+ message.data = object.data ?? new Uint8Array();
2928
+ message.log = object.log ?? "";
2929
+ message.info = object.info ?? "";
2930
+ message.gasWanted = object.gasWanted ?? 0;
2931
+ message.gasUsed = object.gasUsed ?? 0;
2932
+ message.events = object.events?.map((e) => Event.fromPartial(e)) || [];
2933
+ message.codespace = object.codespace ?? "";
2934
+ message.sender = object.sender ?? "";
2935
+ message.priority = object.priority ?? 0;
2936
+ message.mempoolError = object.mempoolError ?? "";
2937
+ return message;
2938
+ },
2939
+ };
2940
+
2941
+ function createBaseResponseDeliverTx(): ResponseDeliverTx {
2942
+ return { code: 0, data: new Uint8Array(), log: "", info: "", gasWanted: 0, gasUsed: 0, events: [], codespace: "" };
2943
+ }
2944
+
2945
+ export const ResponseDeliverTx = {
2946
+ encode(message: ResponseDeliverTx, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
2947
+ if (message.code !== 0) {
2948
+ writer.uint32(8).uint32(message.code);
2949
+ }
2950
+ if (message.data.length !== 0) {
2951
+ writer.uint32(18).bytes(message.data);
2952
+ }
2953
+ if (message.log !== "") {
2954
+ writer.uint32(26).string(message.log);
2955
+ }
2956
+ if (message.info !== "") {
2957
+ writer.uint32(34).string(message.info);
2958
+ }
2959
+ if (message.gasWanted !== 0) {
2960
+ writer.uint32(40).int64(message.gasWanted);
2961
+ }
2962
+ if (message.gasUsed !== 0) {
2963
+ writer.uint32(48).int64(message.gasUsed);
2964
+ }
2965
+ for (const v of message.events) {
2966
+ Event.encode(v!, writer.uint32(58).fork()).ldelim();
2967
+ }
2968
+ if (message.codespace !== "") {
2969
+ writer.uint32(66).string(message.codespace);
2970
+ }
2971
+ return writer;
2972
+ },
2973
+
2974
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseDeliverTx {
2975
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
2976
+ let end = length === undefined ? reader.len : reader.pos + length;
2977
+ const message = createBaseResponseDeliverTx();
2978
+ while (reader.pos < end) {
2979
+ const tag = reader.uint32();
2980
+ switch (tag >>> 3) {
2981
+ case 1:
2982
+ message.code = reader.uint32();
2983
+ break;
2984
+ case 2:
2985
+ message.data = reader.bytes();
2986
+ break;
2987
+ case 3:
2988
+ message.log = reader.string();
2989
+ break;
2990
+ case 4:
2991
+ message.info = reader.string();
2992
+ break;
2993
+ case 5:
2994
+ message.gasWanted = longToNumber(reader.int64() as Long);
2995
+ break;
2996
+ case 6:
2997
+ message.gasUsed = longToNumber(reader.int64() as Long);
2998
+ break;
2999
+ case 7:
3000
+ message.events.push(Event.decode(reader, reader.uint32()));
3001
+ break;
3002
+ case 8:
3003
+ message.codespace = reader.string();
3004
+ break;
3005
+ default:
3006
+ reader.skipType(tag & 7);
3007
+ break;
3008
+ }
3009
+ }
3010
+ return message;
3011
+ },
3012
+
3013
+ fromJSON(object: any): ResponseDeliverTx {
3014
+ return {
3015
+ code: isSet(object.code) ? Number(object.code) : 0,
3016
+ data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
3017
+ log: isSet(object.log) ? String(object.log) : "",
3018
+ info: isSet(object.info) ? String(object.info) : "",
3019
+ gasWanted: isSet(object.gas_wanted) ? Number(object.gas_wanted) : 0,
3020
+ gasUsed: isSet(object.gas_used) ? Number(object.gas_used) : 0,
3021
+ events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [],
3022
+ codespace: isSet(object.codespace) ? String(object.codespace) : "",
3023
+ };
3024
+ },
3025
+
3026
+ toJSON(message: ResponseDeliverTx): unknown {
3027
+ const obj: any = {};
3028
+ message.code !== undefined && (obj.code = Math.round(message.code));
3029
+ message.data !== undefined
3030
+ && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
3031
+ message.log !== undefined && (obj.log = message.log);
3032
+ message.info !== undefined && (obj.info = message.info);
3033
+ message.gasWanted !== undefined && (obj.gas_wanted = Math.round(message.gasWanted));
3034
+ message.gasUsed !== undefined && (obj.gas_used = Math.round(message.gasUsed));
3035
+ if (message.events) {
3036
+ obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined);
3037
+ } else {
3038
+ obj.events = [];
3039
+ }
3040
+ message.codespace !== undefined && (obj.codespace = message.codespace);
3041
+ return obj;
3042
+ },
3043
+
3044
+ fromPartial<I extends Exact<DeepPartial<ResponseDeliverTx>, I>>(object: I): ResponseDeliverTx {
3045
+ const message = createBaseResponseDeliverTx();
3046
+ message.code = object.code ?? 0;
3047
+ message.data = object.data ?? new Uint8Array();
3048
+ message.log = object.log ?? "";
3049
+ message.info = object.info ?? "";
3050
+ message.gasWanted = object.gasWanted ?? 0;
3051
+ message.gasUsed = object.gasUsed ?? 0;
3052
+ message.events = object.events?.map((e) => Event.fromPartial(e)) || [];
3053
+ message.codespace = object.codespace ?? "";
3054
+ return message;
3055
+ },
3056
+ };
3057
+
3058
+ function createBaseResponseEndBlock(): ResponseEndBlock {
3059
+ return { validatorUpdates: [], consensusParamUpdates: undefined, events: [] };
3060
+ }
3061
+
3062
+ export const ResponseEndBlock = {
3063
+ encode(message: ResponseEndBlock, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3064
+ for (const v of message.validatorUpdates) {
3065
+ ValidatorUpdate.encode(v!, writer.uint32(10).fork()).ldelim();
3066
+ }
3067
+ if (message.consensusParamUpdates !== undefined) {
3068
+ ConsensusParams.encode(message.consensusParamUpdates, writer.uint32(18).fork()).ldelim();
3069
+ }
3070
+ for (const v of message.events) {
3071
+ Event.encode(v!, writer.uint32(26).fork()).ldelim();
3072
+ }
3073
+ return writer;
3074
+ },
3075
+
3076
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseEndBlock {
3077
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3078
+ let end = length === undefined ? reader.len : reader.pos + length;
3079
+ const message = createBaseResponseEndBlock();
3080
+ while (reader.pos < end) {
3081
+ const tag = reader.uint32();
3082
+ switch (tag >>> 3) {
3083
+ case 1:
3084
+ message.validatorUpdates.push(ValidatorUpdate.decode(reader, reader.uint32()));
3085
+ break;
3086
+ case 2:
3087
+ message.consensusParamUpdates = ConsensusParams.decode(reader, reader.uint32());
3088
+ break;
3089
+ case 3:
3090
+ message.events.push(Event.decode(reader, reader.uint32()));
3091
+ break;
3092
+ default:
3093
+ reader.skipType(tag & 7);
3094
+ break;
3095
+ }
3096
+ }
3097
+ return message;
3098
+ },
3099
+
3100
+ fromJSON(object: any): ResponseEndBlock {
3101
+ return {
3102
+ validatorUpdates: Array.isArray(object?.validatorUpdates)
3103
+ ? object.validatorUpdates.map((e: any) => ValidatorUpdate.fromJSON(e))
3104
+ : [],
3105
+ consensusParamUpdates: isSet(object.consensusParamUpdates)
3106
+ ? ConsensusParams.fromJSON(object.consensusParamUpdates)
3107
+ : undefined,
3108
+ events: Array.isArray(object?.events) ? object.events.map((e: any) => Event.fromJSON(e)) : [],
3109
+ };
3110
+ },
3111
+
3112
+ toJSON(message: ResponseEndBlock): unknown {
3113
+ const obj: any = {};
3114
+ if (message.validatorUpdates) {
3115
+ obj.validatorUpdates = message.validatorUpdates.map((e) => e ? ValidatorUpdate.toJSON(e) : undefined);
3116
+ } else {
3117
+ obj.validatorUpdates = [];
3118
+ }
3119
+ message.consensusParamUpdates !== undefined && (obj.consensusParamUpdates = message.consensusParamUpdates
3120
+ ? ConsensusParams.toJSON(message.consensusParamUpdates)
3121
+ : undefined);
3122
+ if (message.events) {
3123
+ obj.events = message.events.map((e) => e ? Event.toJSON(e) : undefined);
3124
+ } else {
3125
+ obj.events = [];
3126
+ }
3127
+ return obj;
3128
+ },
3129
+
3130
+ fromPartial<I extends Exact<DeepPartial<ResponseEndBlock>, I>>(object: I): ResponseEndBlock {
3131
+ const message = createBaseResponseEndBlock();
3132
+ message.validatorUpdates = object.validatorUpdates?.map((e) => ValidatorUpdate.fromPartial(e)) || [];
3133
+ message.consensusParamUpdates =
3134
+ (object.consensusParamUpdates !== undefined && object.consensusParamUpdates !== null)
3135
+ ? ConsensusParams.fromPartial(object.consensusParamUpdates)
3136
+ : undefined;
3137
+ message.events = object.events?.map((e) => Event.fromPartial(e)) || [];
3138
+ return message;
3139
+ },
3140
+ };
3141
+
3142
+ function createBaseResponseCommit(): ResponseCommit {
3143
+ return { data: new Uint8Array(), retainHeight: 0 };
3144
+ }
3145
+
3146
+ export const ResponseCommit = {
3147
+ encode(message: ResponseCommit, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3148
+ if (message.data.length !== 0) {
3149
+ writer.uint32(18).bytes(message.data);
3150
+ }
3151
+ if (message.retainHeight !== 0) {
3152
+ writer.uint32(24).int64(message.retainHeight);
3153
+ }
3154
+ return writer;
3155
+ },
3156
+
3157
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseCommit {
3158
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3159
+ let end = length === undefined ? reader.len : reader.pos + length;
3160
+ const message = createBaseResponseCommit();
3161
+ while (reader.pos < end) {
3162
+ const tag = reader.uint32();
3163
+ switch (tag >>> 3) {
3164
+ case 2:
3165
+ message.data = reader.bytes();
3166
+ break;
3167
+ case 3:
3168
+ message.retainHeight = longToNumber(reader.int64() as Long);
3169
+ break;
3170
+ default:
3171
+ reader.skipType(tag & 7);
3172
+ break;
3173
+ }
3174
+ }
3175
+ return message;
3176
+ },
3177
+
3178
+ fromJSON(object: any): ResponseCommit {
3179
+ return {
3180
+ data: isSet(object.data) ? bytesFromBase64(object.data) : new Uint8Array(),
3181
+ retainHeight: isSet(object.retainHeight) ? Number(object.retainHeight) : 0,
3182
+ };
3183
+ },
3184
+
3185
+ toJSON(message: ResponseCommit): unknown {
3186
+ const obj: any = {};
3187
+ message.data !== undefined
3188
+ && (obj.data = base64FromBytes(message.data !== undefined ? message.data : new Uint8Array()));
3189
+ message.retainHeight !== undefined && (obj.retainHeight = Math.round(message.retainHeight));
3190
+ return obj;
3191
+ },
3192
+
3193
+ fromPartial<I extends Exact<DeepPartial<ResponseCommit>, I>>(object: I): ResponseCommit {
3194
+ const message = createBaseResponseCommit();
3195
+ message.data = object.data ?? new Uint8Array();
3196
+ message.retainHeight = object.retainHeight ?? 0;
3197
+ return message;
3198
+ },
3199
+ };
3200
+
3201
+ function createBaseResponseListSnapshots(): ResponseListSnapshots {
3202
+ return { snapshots: [] };
3203
+ }
3204
+
3205
+ export const ResponseListSnapshots = {
3206
+ encode(message: ResponseListSnapshots, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3207
+ for (const v of message.snapshots) {
3208
+ Snapshot.encode(v!, writer.uint32(10).fork()).ldelim();
3209
+ }
3210
+ return writer;
3211
+ },
3212
+
3213
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseListSnapshots {
3214
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3215
+ let end = length === undefined ? reader.len : reader.pos + length;
3216
+ const message = createBaseResponseListSnapshots();
3217
+ while (reader.pos < end) {
3218
+ const tag = reader.uint32();
3219
+ switch (tag >>> 3) {
3220
+ case 1:
3221
+ message.snapshots.push(Snapshot.decode(reader, reader.uint32()));
3222
+ break;
3223
+ default:
3224
+ reader.skipType(tag & 7);
3225
+ break;
3226
+ }
3227
+ }
3228
+ return message;
3229
+ },
3230
+
3231
+ fromJSON(object: any): ResponseListSnapshots {
3232
+ return {
3233
+ snapshots: Array.isArray(object?.snapshots) ? object.snapshots.map((e: any) => Snapshot.fromJSON(e)) : [],
3234
+ };
3235
+ },
3236
+
3237
+ toJSON(message: ResponseListSnapshots): unknown {
3238
+ const obj: any = {};
3239
+ if (message.snapshots) {
3240
+ obj.snapshots = message.snapshots.map((e) => e ? Snapshot.toJSON(e) : undefined);
3241
+ } else {
3242
+ obj.snapshots = [];
3243
+ }
3244
+ return obj;
3245
+ },
3246
+
3247
+ fromPartial<I extends Exact<DeepPartial<ResponseListSnapshots>, I>>(object: I): ResponseListSnapshots {
3248
+ const message = createBaseResponseListSnapshots();
3249
+ message.snapshots = object.snapshots?.map((e) => Snapshot.fromPartial(e)) || [];
3250
+ return message;
3251
+ },
3252
+ };
3253
+
3254
+ function createBaseResponseOfferSnapshot(): ResponseOfferSnapshot {
3255
+ return { result: 0 };
3256
+ }
3257
+
3258
+ export const ResponseOfferSnapshot = {
3259
+ encode(message: ResponseOfferSnapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3260
+ if (message.result !== 0) {
3261
+ writer.uint32(8).int32(message.result);
3262
+ }
3263
+ return writer;
3264
+ },
3265
+
3266
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseOfferSnapshot {
3267
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3268
+ let end = length === undefined ? reader.len : reader.pos + length;
3269
+ const message = createBaseResponseOfferSnapshot();
3270
+ while (reader.pos < end) {
3271
+ const tag = reader.uint32();
3272
+ switch (tag >>> 3) {
3273
+ case 1:
3274
+ message.result = reader.int32() as any;
3275
+ break;
3276
+ default:
3277
+ reader.skipType(tag & 7);
3278
+ break;
3279
+ }
3280
+ }
3281
+ return message;
3282
+ },
3283
+
3284
+ fromJSON(object: any): ResponseOfferSnapshot {
3285
+ return { result: isSet(object.result) ? responseOfferSnapshot_ResultFromJSON(object.result) : 0 };
3286
+ },
3287
+
3288
+ toJSON(message: ResponseOfferSnapshot): unknown {
3289
+ const obj: any = {};
3290
+ message.result !== undefined && (obj.result = responseOfferSnapshot_ResultToJSON(message.result));
3291
+ return obj;
3292
+ },
3293
+
3294
+ fromPartial<I extends Exact<DeepPartial<ResponseOfferSnapshot>, I>>(object: I): ResponseOfferSnapshot {
3295
+ const message = createBaseResponseOfferSnapshot();
3296
+ message.result = object.result ?? 0;
3297
+ return message;
3298
+ },
3299
+ };
3300
+
3301
+ function createBaseResponseLoadSnapshotChunk(): ResponseLoadSnapshotChunk {
3302
+ return { chunk: new Uint8Array() };
3303
+ }
3304
+
3305
+ export const ResponseLoadSnapshotChunk = {
3306
+ encode(message: ResponseLoadSnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3307
+ if (message.chunk.length !== 0) {
3308
+ writer.uint32(10).bytes(message.chunk);
3309
+ }
3310
+ return writer;
3311
+ },
3312
+
3313
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseLoadSnapshotChunk {
3314
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3315
+ let end = length === undefined ? reader.len : reader.pos + length;
3316
+ const message = createBaseResponseLoadSnapshotChunk();
3317
+ while (reader.pos < end) {
3318
+ const tag = reader.uint32();
3319
+ switch (tag >>> 3) {
3320
+ case 1:
3321
+ message.chunk = reader.bytes();
3322
+ break;
3323
+ default:
3324
+ reader.skipType(tag & 7);
3325
+ break;
3326
+ }
3327
+ }
3328
+ return message;
3329
+ },
3330
+
3331
+ fromJSON(object: any): ResponseLoadSnapshotChunk {
3332
+ return { chunk: isSet(object.chunk) ? bytesFromBase64(object.chunk) : new Uint8Array() };
3333
+ },
3334
+
3335
+ toJSON(message: ResponseLoadSnapshotChunk): unknown {
3336
+ const obj: any = {};
3337
+ message.chunk !== undefined
3338
+ && (obj.chunk = base64FromBytes(message.chunk !== undefined ? message.chunk : new Uint8Array()));
3339
+ return obj;
3340
+ },
3341
+
3342
+ fromPartial<I extends Exact<DeepPartial<ResponseLoadSnapshotChunk>, I>>(object: I): ResponseLoadSnapshotChunk {
3343
+ const message = createBaseResponseLoadSnapshotChunk();
3344
+ message.chunk = object.chunk ?? new Uint8Array();
3345
+ return message;
3346
+ },
3347
+ };
3348
+
3349
+ function createBaseResponseApplySnapshotChunk(): ResponseApplySnapshotChunk {
3350
+ return { result: 0, refetchChunks: [], rejectSenders: [] };
3351
+ }
3352
+
3353
+ export const ResponseApplySnapshotChunk = {
3354
+ encode(message: ResponseApplySnapshotChunk, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3355
+ if (message.result !== 0) {
3356
+ writer.uint32(8).int32(message.result);
3357
+ }
3358
+ writer.uint32(18).fork();
3359
+ for (const v of message.refetchChunks) {
3360
+ writer.uint32(v);
3361
+ }
3362
+ writer.ldelim();
3363
+ for (const v of message.rejectSenders) {
3364
+ writer.uint32(26).string(v!);
3365
+ }
3366
+ return writer;
3367
+ },
3368
+
3369
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseApplySnapshotChunk {
3370
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3371
+ let end = length === undefined ? reader.len : reader.pos + length;
3372
+ const message = createBaseResponseApplySnapshotChunk();
3373
+ while (reader.pos < end) {
3374
+ const tag = reader.uint32();
3375
+ switch (tag >>> 3) {
3376
+ case 1:
3377
+ message.result = reader.int32() as any;
3378
+ break;
3379
+ case 2:
3380
+ if ((tag & 7) === 2) {
3381
+ const end2 = reader.uint32() + reader.pos;
3382
+ while (reader.pos < end2) {
3383
+ message.refetchChunks.push(reader.uint32());
3384
+ }
3385
+ } else {
3386
+ message.refetchChunks.push(reader.uint32());
3387
+ }
3388
+ break;
3389
+ case 3:
3390
+ message.rejectSenders.push(reader.string());
3391
+ break;
3392
+ default:
3393
+ reader.skipType(tag & 7);
3394
+ break;
3395
+ }
3396
+ }
3397
+ return message;
3398
+ },
3399
+
3400
+ fromJSON(object: any): ResponseApplySnapshotChunk {
3401
+ return {
3402
+ result: isSet(object.result) ? responseApplySnapshotChunk_ResultFromJSON(object.result) : 0,
3403
+ refetchChunks: Array.isArray(object?.refetchChunks) ? object.refetchChunks.map((e: any) => Number(e)) : [],
3404
+ rejectSenders: Array.isArray(object?.rejectSenders) ? object.rejectSenders.map((e: any) => String(e)) : [],
3405
+ };
3406
+ },
3407
+
3408
+ toJSON(message: ResponseApplySnapshotChunk): unknown {
3409
+ const obj: any = {};
3410
+ message.result !== undefined && (obj.result = responseApplySnapshotChunk_ResultToJSON(message.result));
3411
+ if (message.refetchChunks) {
3412
+ obj.refetchChunks = message.refetchChunks.map((e) => Math.round(e));
3413
+ } else {
3414
+ obj.refetchChunks = [];
3415
+ }
3416
+ if (message.rejectSenders) {
3417
+ obj.rejectSenders = message.rejectSenders.map((e) => e);
3418
+ } else {
3419
+ obj.rejectSenders = [];
3420
+ }
3421
+ return obj;
3422
+ },
3423
+
3424
+ fromPartial<I extends Exact<DeepPartial<ResponseApplySnapshotChunk>, I>>(object: I): ResponseApplySnapshotChunk {
3425
+ const message = createBaseResponseApplySnapshotChunk();
3426
+ message.result = object.result ?? 0;
3427
+ message.refetchChunks = object.refetchChunks?.map((e) => e) || [];
3428
+ message.rejectSenders = object.rejectSenders?.map((e) => e) || [];
3429
+ return message;
3430
+ },
3431
+ };
3432
+
3433
+ function createBaseResponsePrepareProposal(): ResponsePrepareProposal {
3434
+ return { txs: [] };
3435
+ }
3436
+
3437
+ export const ResponsePrepareProposal = {
3438
+ encode(message: ResponsePrepareProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3439
+ for (const v of message.txs) {
3440
+ writer.uint32(10).bytes(v!);
3441
+ }
3442
+ return writer;
3443
+ },
3444
+
3445
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponsePrepareProposal {
3446
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3447
+ let end = length === undefined ? reader.len : reader.pos + length;
3448
+ const message = createBaseResponsePrepareProposal();
3449
+ while (reader.pos < end) {
3450
+ const tag = reader.uint32();
3451
+ switch (tag >>> 3) {
3452
+ case 1:
3453
+ message.txs.push(reader.bytes());
3454
+ break;
3455
+ default:
3456
+ reader.skipType(tag & 7);
3457
+ break;
3458
+ }
3459
+ }
3460
+ return message;
3461
+ },
3462
+
3463
+ fromJSON(object: any): ResponsePrepareProposal {
3464
+ return { txs: Array.isArray(object?.txs) ? object.txs.map((e: any) => bytesFromBase64(e)) : [] };
3465
+ },
3466
+
3467
+ toJSON(message: ResponsePrepareProposal): unknown {
3468
+ const obj: any = {};
3469
+ if (message.txs) {
3470
+ obj.txs = message.txs.map((e) => base64FromBytes(e !== undefined ? e : new Uint8Array()));
3471
+ } else {
3472
+ obj.txs = [];
3473
+ }
3474
+ return obj;
3475
+ },
3476
+
3477
+ fromPartial<I extends Exact<DeepPartial<ResponsePrepareProposal>, I>>(object: I): ResponsePrepareProposal {
3478
+ const message = createBaseResponsePrepareProposal();
3479
+ message.txs = object.txs?.map((e) => e) || [];
3480
+ return message;
3481
+ },
3482
+ };
3483
+
3484
+ function createBaseResponseProcessProposal(): ResponseProcessProposal {
3485
+ return { status: 0 };
3486
+ }
3487
+
3488
+ export const ResponseProcessProposal = {
3489
+ encode(message: ResponseProcessProposal, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3490
+ if (message.status !== 0) {
3491
+ writer.uint32(8).int32(message.status);
3492
+ }
3493
+ return writer;
3494
+ },
3495
+
3496
+ decode(input: _m0.Reader | Uint8Array, length?: number): ResponseProcessProposal {
3497
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3498
+ let end = length === undefined ? reader.len : reader.pos + length;
3499
+ const message = createBaseResponseProcessProposal();
3500
+ while (reader.pos < end) {
3501
+ const tag = reader.uint32();
3502
+ switch (tag >>> 3) {
3503
+ case 1:
3504
+ message.status = reader.int32() as any;
3505
+ break;
3506
+ default:
3507
+ reader.skipType(tag & 7);
3508
+ break;
3509
+ }
3510
+ }
3511
+ return message;
3512
+ },
3513
+
3514
+ fromJSON(object: any): ResponseProcessProposal {
3515
+ return { status: isSet(object.status) ? responseProcessProposal_ProposalStatusFromJSON(object.status) : 0 };
3516
+ },
3517
+
3518
+ toJSON(message: ResponseProcessProposal): unknown {
3519
+ const obj: any = {};
3520
+ message.status !== undefined && (obj.status = responseProcessProposal_ProposalStatusToJSON(message.status));
3521
+ return obj;
3522
+ },
3523
+
3524
+ fromPartial<I extends Exact<DeepPartial<ResponseProcessProposal>, I>>(object: I): ResponseProcessProposal {
3525
+ const message = createBaseResponseProcessProposal();
3526
+ message.status = object.status ?? 0;
3527
+ return message;
3528
+ },
3529
+ };
3530
+
3531
+ function createBaseCommitInfo(): CommitInfo {
3532
+ return { round: 0, votes: [] };
3533
+ }
3534
+
3535
+ export const CommitInfo = {
3536
+ encode(message: CommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3537
+ if (message.round !== 0) {
3538
+ writer.uint32(8).int32(message.round);
3539
+ }
3540
+ for (const v of message.votes) {
3541
+ VoteInfo.encode(v!, writer.uint32(18).fork()).ldelim();
3542
+ }
3543
+ return writer;
3544
+ },
3545
+
3546
+ decode(input: _m0.Reader | Uint8Array, length?: number): CommitInfo {
3547
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3548
+ let end = length === undefined ? reader.len : reader.pos + length;
3549
+ const message = createBaseCommitInfo();
3550
+ while (reader.pos < end) {
3551
+ const tag = reader.uint32();
3552
+ switch (tag >>> 3) {
3553
+ case 1:
3554
+ message.round = reader.int32();
3555
+ break;
3556
+ case 2:
3557
+ message.votes.push(VoteInfo.decode(reader, reader.uint32()));
3558
+ break;
3559
+ default:
3560
+ reader.skipType(tag & 7);
3561
+ break;
3562
+ }
3563
+ }
3564
+ return message;
3565
+ },
3566
+
3567
+ fromJSON(object: any): CommitInfo {
3568
+ return {
3569
+ round: isSet(object.round) ? Number(object.round) : 0,
3570
+ votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => VoteInfo.fromJSON(e)) : [],
3571
+ };
3572
+ },
3573
+
3574
+ toJSON(message: CommitInfo): unknown {
3575
+ const obj: any = {};
3576
+ message.round !== undefined && (obj.round = Math.round(message.round));
3577
+ if (message.votes) {
3578
+ obj.votes = message.votes.map((e) => e ? VoteInfo.toJSON(e) : undefined);
3579
+ } else {
3580
+ obj.votes = [];
3581
+ }
3582
+ return obj;
3583
+ },
3584
+
3585
+ fromPartial<I extends Exact<DeepPartial<CommitInfo>, I>>(object: I): CommitInfo {
3586
+ const message = createBaseCommitInfo();
3587
+ message.round = object.round ?? 0;
3588
+ message.votes = object.votes?.map((e) => VoteInfo.fromPartial(e)) || [];
3589
+ return message;
3590
+ },
3591
+ };
3592
+
3593
+ function createBaseExtendedCommitInfo(): ExtendedCommitInfo {
3594
+ return { round: 0, votes: [] };
3595
+ }
3596
+
3597
+ export const ExtendedCommitInfo = {
3598
+ encode(message: ExtendedCommitInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3599
+ if (message.round !== 0) {
3600
+ writer.uint32(8).int32(message.round);
3601
+ }
3602
+ for (const v of message.votes) {
3603
+ ExtendedVoteInfo.encode(v!, writer.uint32(18).fork()).ldelim();
3604
+ }
3605
+ return writer;
3606
+ },
3607
+
3608
+ decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedCommitInfo {
3609
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3610
+ let end = length === undefined ? reader.len : reader.pos + length;
3611
+ const message = createBaseExtendedCommitInfo();
3612
+ while (reader.pos < end) {
3613
+ const tag = reader.uint32();
3614
+ switch (tag >>> 3) {
3615
+ case 1:
3616
+ message.round = reader.int32();
3617
+ break;
3618
+ case 2:
3619
+ message.votes.push(ExtendedVoteInfo.decode(reader, reader.uint32()));
3620
+ break;
3621
+ default:
3622
+ reader.skipType(tag & 7);
3623
+ break;
3624
+ }
3625
+ }
3626
+ return message;
3627
+ },
3628
+
3629
+ fromJSON(object: any): ExtendedCommitInfo {
3630
+ return {
3631
+ round: isSet(object.round) ? Number(object.round) : 0,
3632
+ votes: Array.isArray(object?.votes) ? object.votes.map((e: any) => ExtendedVoteInfo.fromJSON(e)) : [],
3633
+ };
3634
+ },
3635
+
3636
+ toJSON(message: ExtendedCommitInfo): unknown {
3637
+ const obj: any = {};
3638
+ message.round !== undefined && (obj.round = Math.round(message.round));
3639
+ if (message.votes) {
3640
+ obj.votes = message.votes.map((e) => e ? ExtendedVoteInfo.toJSON(e) : undefined);
3641
+ } else {
3642
+ obj.votes = [];
3643
+ }
3644
+ return obj;
3645
+ },
3646
+
3647
+ fromPartial<I extends Exact<DeepPartial<ExtendedCommitInfo>, I>>(object: I): ExtendedCommitInfo {
3648
+ const message = createBaseExtendedCommitInfo();
3649
+ message.round = object.round ?? 0;
3650
+ message.votes = object.votes?.map((e) => ExtendedVoteInfo.fromPartial(e)) || [];
3651
+ return message;
3652
+ },
3653
+ };
3654
+
3655
+ function createBaseEvent(): Event {
3656
+ return { type: "", attributes: [] };
3657
+ }
3658
+
3659
+ export const Event = {
3660
+ encode(message: Event, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3661
+ if (message.type !== "") {
3662
+ writer.uint32(10).string(message.type);
3663
+ }
3664
+ for (const v of message.attributes) {
3665
+ EventAttribute.encode(v!, writer.uint32(18).fork()).ldelim();
3666
+ }
3667
+ return writer;
3668
+ },
3669
+
3670
+ decode(input: _m0.Reader | Uint8Array, length?: number): Event {
3671
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3672
+ let end = length === undefined ? reader.len : reader.pos + length;
3673
+ const message = createBaseEvent();
3674
+ while (reader.pos < end) {
3675
+ const tag = reader.uint32();
3676
+ switch (tag >>> 3) {
3677
+ case 1:
3678
+ message.type = reader.string();
3679
+ break;
3680
+ case 2:
3681
+ message.attributes.push(EventAttribute.decode(reader, reader.uint32()));
3682
+ break;
3683
+ default:
3684
+ reader.skipType(tag & 7);
3685
+ break;
3686
+ }
3687
+ }
3688
+ return message;
3689
+ },
3690
+
3691
+ fromJSON(object: any): Event {
3692
+ return {
3693
+ type: isSet(object.type) ? String(object.type) : "",
3694
+ attributes: Array.isArray(object?.attributes)
3695
+ ? object.attributes.map((e: any) => EventAttribute.fromJSON(e))
3696
+ : [],
3697
+ };
3698
+ },
3699
+
3700
+ toJSON(message: Event): unknown {
3701
+ const obj: any = {};
3702
+ message.type !== undefined && (obj.type = message.type);
3703
+ if (message.attributes) {
3704
+ obj.attributes = message.attributes.map((e) => e ? EventAttribute.toJSON(e) : undefined);
3705
+ } else {
3706
+ obj.attributes = [];
3707
+ }
3708
+ return obj;
3709
+ },
3710
+
3711
+ fromPartial<I extends Exact<DeepPartial<Event>, I>>(object: I): Event {
3712
+ const message = createBaseEvent();
3713
+ message.type = object.type ?? "";
3714
+ message.attributes = object.attributes?.map((e) => EventAttribute.fromPartial(e)) || [];
3715
+ return message;
3716
+ },
3717
+ };
3718
+
3719
+ function createBaseEventAttribute(): EventAttribute {
3720
+ return { key: "", value: "", index: false };
3721
+ }
3722
+
3723
+ export const EventAttribute = {
3724
+ encode(message: EventAttribute, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3725
+ if (message.key !== "") {
3726
+ writer.uint32(10).string(message.key);
3727
+ }
3728
+ if (message.value !== "") {
3729
+ writer.uint32(18).string(message.value);
3730
+ }
3731
+ if (message.index === true) {
3732
+ writer.uint32(24).bool(message.index);
3733
+ }
3734
+ return writer;
3735
+ },
3736
+
3737
+ decode(input: _m0.Reader | Uint8Array, length?: number): EventAttribute {
3738
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3739
+ let end = length === undefined ? reader.len : reader.pos + length;
3740
+ const message = createBaseEventAttribute();
3741
+ while (reader.pos < end) {
3742
+ const tag = reader.uint32();
3743
+ switch (tag >>> 3) {
3744
+ case 1:
3745
+ message.key = reader.string();
3746
+ break;
3747
+ case 2:
3748
+ message.value = reader.string();
3749
+ break;
3750
+ case 3:
3751
+ message.index = reader.bool();
3752
+ break;
3753
+ default:
3754
+ reader.skipType(tag & 7);
3755
+ break;
3756
+ }
3757
+ }
3758
+ return message;
3759
+ },
3760
+
3761
+ fromJSON(object: any): EventAttribute {
3762
+ return {
3763
+ key: isSet(object.key) ? String(object.key) : "",
3764
+ value: isSet(object.value) ? String(object.value) : "",
3765
+ index: isSet(object.index) ? Boolean(object.index) : false,
3766
+ };
3767
+ },
3768
+
3769
+ toJSON(message: EventAttribute): unknown {
3770
+ const obj: any = {};
3771
+ message.key !== undefined && (obj.key = message.key);
3772
+ message.value !== undefined && (obj.value = message.value);
3773
+ message.index !== undefined && (obj.index = message.index);
3774
+ return obj;
3775
+ },
3776
+
3777
+ fromPartial<I extends Exact<DeepPartial<EventAttribute>, I>>(object: I): EventAttribute {
3778
+ const message = createBaseEventAttribute();
3779
+ message.key = object.key ?? "";
3780
+ message.value = object.value ?? "";
3781
+ message.index = object.index ?? false;
3782
+ return message;
3783
+ },
3784
+ };
3785
+
3786
+ function createBaseTxResult(): TxResult {
3787
+ return { height: 0, index: 0, tx: new Uint8Array(), result: undefined };
3788
+ }
3789
+
3790
+ export const TxResult = {
3791
+ encode(message: TxResult, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3792
+ if (message.height !== 0) {
3793
+ writer.uint32(8).int64(message.height);
3794
+ }
3795
+ if (message.index !== 0) {
3796
+ writer.uint32(16).uint32(message.index);
3797
+ }
3798
+ if (message.tx.length !== 0) {
3799
+ writer.uint32(26).bytes(message.tx);
3800
+ }
3801
+ if (message.result !== undefined) {
3802
+ ResponseDeliverTx.encode(message.result, writer.uint32(34).fork()).ldelim();
3803
+ }
3804
+ return writer;
3805
+ },
3806
+
3807
+ decode(input: _m0.Reader | Uint8Array, length?: number): TxResult {
3808
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3809
+ let end = length === undefined ? reader.len : reader.pos + length;
3810
+ const message = createBaseTxResult();
3811
+ while (reader.pos < end) {
3812
+ const tag = reader.uint32();
3813
+ switch (tag >>> 3) {
3814
+ case 1:
3815
+ message.height = longToNumber(reader.int64() as Long);
3816
+ break;
3817
+ case 2:
3818
+ message.index = reader.uint32();
3819
+ break;
3820
+ case 3:
3821
+ message.tx = reader.bytes();
3822
+ break;
3823
+ case 4:
3824
+ message.result = ResponseDeliverTx.decode(reader, reader.uint32());
3825
+ break;
3826
+ default:
3827
+ reader.skipType(tag & 7);
3828
+ break;
3829
+ }
3830
+ }
3831
+ return message;
3832
+ },
3833
+
3834
+ fromJSON(object: any): TxResult {
3835
+ return {
3836
+ height: isSet(object.height) ? Number(object.height) : 0,
3837
+ index: isSet(object.index) ? Number(object.index) : 0,
3838
+ tx: isSet(object.tx) ? bytesFromBase64(object.tx) : new Uint8Array(),
3839
+ result: isSet(object.result) ? ResponseDeliverTx.fromJSON(object.result) : undefined,
3840
+ };
3841
+ },
3842
+
3843
+ toJSON(message: TxResult): unknown {
3844
+ const obj: any = {};
3845
+ message.height !== undefined && (obj.height = Math.round(message.height));
3846
+ message.index !== undefined && (obj.index = Math.round(message.index));
3847
+ message.tx !== undefined && (obj.tx = base64FromBytes(message.tx !== undefined ? message.tx : new Uint8Array()));
3848
+ message.result !== undefined
3849
+ && (obj.result = message.result ? ResponseDeliverTx.toJSON(message.result) : undefined);
3850
+ return obj;
3851
+ },
3852
+
3853
+ fromPartial<I extends Exact<DeepPartial<TxResult>, I>>(object: I): TxResult {
3854
+ const message = createBaseTxResult();
3855
+ message.height = object.height ?? 0;
3856
+ message.index = object.index ?? 0;
3857
+ message.tx = object.tx ?? new Uint8Array();
3858
+ message.result = (object.result !== undefined && object.result !== null)
3859
+ ? ResponseDeliverTx.fromPartial(object.result)
3860
+ : undefined;
3861
+ return message;
3862
+ },
3863
+ };
3864
+
3865
+ function createBaseValidator(): Validator {
3866
+ return { address: new Uint8Array(), power: 0 };
3867
+ }
3868
+
3869
+ export const Validator = {
3870
+ encode(message: Validator, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3871
+ if (message.address.length !== 0) {
3872
+ writer.uint32(10).bytes(message.address);
3873
+ }
3874
+ if (message.power !== 0) {
3875
+ writer.uint32(24).int64(message.power);
3876
+ }
3877
+ return writer;
3878
+ },
3879
+
3880
+ decode(input: _m0.Reader | Uint8Array, length?: number): Validator {
3881
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3882
+ let end = length === undefined ? reader.len : reader.pos + length;
3883
+ const message = createBaseValidator();
3884
+ while (reader.pos < end) {
3885
+ const tag = reader.uint32();
3886
+ switch (tag >>> 3) {
3887
+ case 1:
3888
+ message.address = reader.bytes();
3889
+ break;
3890
+ case 3:
3891
+ message.power = longToNumber(reader.int64() as Long);
3892
+ break;
3893
+ default:
3894
+ reader.skipType(tag & 7);
3895
+ break;
3896
+ }
3897
+ }
3898
+ return message;
3899
+ },
3900
+
3901
+ fromJSON(object: any): Validator {
3902
+ return {
3903
+ address: isSet(object.address) ? bytesFromBase64(object.address) : new Uint8Array(),
3904
+ power: isSet(object.power) ? Number(object.power) : 0,
3905
+ };
3906
+ },
3907
+
3908
+ toJSON(message: Validator): unknown {
3909
+ const obj: any = {};
3910
+ message.address !== undefined
3911
+ && (obj.address = base64FromBytes(message.address !== undefined ? message.address : new Uint8Array()));
3912
+ message.power !== undefined && (obj.power = Math.round(message.power));
3913
+ return obj;
3914
+ },
3915
+
3916
+ fromPartial<I extends Exact<DeepPartial<Validator>, I>>(object: I): Validator {
3917
+ const message = createBaseValidator();
3918
+ message.address = object.address ?? new Uint8Array();
3919
+ message.power = object.power ?? 0;
3920
+ return message;
3921
+ },
3922
+ };
3923
+
3924
+ function createBaseValidatorUpdate(): ValidatorUpdate {
3925
+ return { pubKey: undefined, power: 0 };
3926
+ }
3927
+
3928
+ export const ValidatorUpdate = {
3929
+ encode(message: ValidatorUpdate, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3930
+ if (message.pubKey !== undefined) {
3931
+ PublicKey.encode(message.pubKey, writer.uint32(10).fork()).ldelim();
3932
+ }
3933
+ if (message.power !== 0) {
3934
+ writer.uint32(16).int64(message.power);
3935
+ }
3936
+ return writer;
3937
+ },
3938
+
3939
+ decode(input: _m0.Reader | Uint8Array, length?: number): ValidatorUpdate {
3940
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
3941
+ let end = length === undefined ? reader.len : reader.pos + length;
3942
+ const message = createBaseValidatorUpdate();
3943
+ while (reader.pos < end) {
3944
+ const tag = reader.uint32();
3945
+ switch (tag >>> 3) {
3946
+ case 1:
3947
+ message.pubKey = PublicKey.decode(reader, reader.uint32());
3948
+ break;
3949
+ case 2:
3950
+ message.power = longToNumber(reader.int64() as Long);
3951
+ break;
3952
+ default:
3953
+ reader.skipType(tag & 7);
3954
+ break;
3955
+ }
3956
+ }
3957
+ return message;
3958
+ },
3959
+
3960
+ fromJSON(object: any): ValidatorUpdate {
3961
+ return {
3962
+ pubKey: isSet(object.pubKey) ? PublicKey.fromJSON(object.pubKey) : undefined,
3963
+ power: isSet(object.power) ? Number(object.power) : 0,
3964
+ };
3965
+ },
3966
+
3967
+ toJSON(message: ValidatorUpdate): unknown {
3968
+ const obj: any = {};
3969
+ message.pubKey !== undefined && (obj.pubKey = message.pubKey ? PublicKey.toJSON(message.pubKey) : undefined);
3970
+ message.power !== undefined && (obj.power = Math.round(message.power));
3971
+ return obj;
3972
+ },
3973
+
3974
+ fromPartial<I extends Exact<DeepPartial<ValidatorUpdate>, I>>(object: I): ValidatorUpdate {
3975
+ const message = createBaseValidatorUpdate();
3976
+ message.pubKey = (object.pubKey !== undefined && object.pubKey !== null)
3977
+ ? PublicKey.fromPartial(object.pubKey)
3978
+ : undefined;
3979
+ message.power = object.power ?? 0;
3980
+ return message;
3981
+ },
3982
+ };
3983
+
3984
+ function createBaseVoteInfo(): VoteInfo {
3985
+ return { validator: undefined, signedLastBlock: false };
3986
+ }
3987
+
3988
+ export const VoteInfo = {
3989
+ encode(message: VoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
3990
+ if (message.validator !== undefined) {
3991
+ Validator.encode(message.validator, writer.uint32(10).fork()).ldelim();
3992
+ }
3993
+ if (message.signedLastBlock === true) {
3994
+ writer.uint32(16).bool(message.signedLastBlock);
3995
+ }
3996
+ return writer;
3997
+ },
3998
+
3999
+ decode(input: _m0.Reader | Uint8Array, length?: number): VoteInfo {
4000
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
4001
+ let end = length === undefined ? reader.len : reader.pos + length;
4002
+ const message = createBaseVoteInfo();
4003
+ while (reader.pos < end) {
4004
+ const tag = reader.uint32();
4005
+ switch (tag >>> 3) {
4006
+ case 1:
4007
+ message.validator = Validator.decode(reader, reader.uint32());
4008
+ break;
4009
+ case 2:
4010
+ message.signedLastBlock = reader.bool();
4011
+ break;
4012
+ default:
4013
+ reader.skipType(tag & 7);
4014
+ break;
4015
+ }
4016
+ }
4017
+ return message;
4018
+ },
4019
+
4020
+ fromJSON(object: any): VoteInfo {
4021
+ return {
4022
+ validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined,
4023
+ signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false,
4024
+ };
4025
+ },
4026
+
4027
+ toJSON(message: VoteInfo): unknown {
4028
+ const obj: any = {};
4029
+ message.validator !== undefined
4030
+ && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined);
4031
+ message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock);
4032
+ return obj;
4033
+ },
4034
+
4035
+ fromPartial<I extends Exact<DeepPartial<VoteInfo>, I>>(object: I): VoteInfo {
4036
+ const message = createBaseVoteInfo();
4037
+ message.validator = (object.validator !== undefined && object.validator !== null)
4038
+ ? Validator.fromPartial(object.validator)
4039
+ : undefined;
4040
+ message.signedLastBlock = object.signedLastBlock ?? false;
4041
+ return message;
4042
+ },
4043
+ };
4044
+
4045
+ function createBaseExtendedVoteInfo(): ExtendedVoteInfo {
4046
+ return { validator: undefined, signedLastBlock: false, voteExtension: new Uint8Array() };
4047
+ }
4048
+
4049
+ export const ExtendedVoteInfo = {
4050
+ encode(message: ExtendedVoteInfo, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
4051
+ if (message.validator !== undefined) {
4052
+ Validator.encode(message.validator, writer.uint32(10).fork()).ldelim();
4053
+ }
4054
+ if (message.signedLastBlock === true) {
4055
+ writer.uint32(16).bool(message.signedLastBlock);
4056
+ }
4057
+ if (message.voteExtension.length !== 0) {
4058
+ writer.uint32(26).bytes(message.voteExtension);
4059
+ }
4060
+ return writer;
4061
+ },
4062
+
4063
+ decode(input: _m0.Reader | Uint8Array, length?: number): ExtendedVoteInfo {
4064
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
4065
+ let end = length === undefined ? reader.len : reader.pos + length;
4066
+ const message = createBaseExtendedVoteInfo();
4067
+ while (reader.pos < end) {
4068
+ const tag = reader.uint32();
4069
+ switch (tag >>> 3) {
4070
+ case 1:
4071
+ message.validator = Validator.decode(reader, reader.uint32());
4072
+ break;
4073
+ case 2:
4074
+ message.signedLastBlock = reader.bool();
4075
+ break;
4076
+ case 3:
4077
+ message.voteExtension = reader.bytes();
4078
+ break;
4079
+ default:
4080
+ reader.skipType(tag & 7);
4081
+ break;
4082
+ }
4083
+ }
4084
+ return message;
4085
+ },
4086
+
4087
+ fromJSON(object: any): ExtendedVoteInfo {
4088
+ return {
4089
+ validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined,
4090
+ signedLastBlock: isSet(object.signedLastBlock) ? Boolean(object.signedLastBlock) : false,
4091
+ voteExtension: isSet(object.voteExtension) ? bytesFromBase64(object.voteExtension) : new Uint8Array(),
4092
+ };
4093
+ },
4094
+
4095
+ toJSON(message: ExtendedVoteInfo): unknown {
4096
+ const obj: any = {};
4097
+ message.validator !== undefined
4098
+ && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined);
4099
+ message.signedLastBlock !== undefined && (obj.signedLastBlock = message.signedLastBlock);
4100
+ message.voteExtension !== undefined
4101
+ && (obj.voteExtension = base64FromBytes(
4102
+ message.voteExtension !== undefined ? message.voteExtension : new Uint8Array(),
4103
+ ));
4104
+ return obj;
4105
+ },
4106
+
4107
+ fromPartial<I extends Exact<DeepPartial<ExtendedVoteInfo>, I>>(object: I): ExtendedVoteInfo {
4108
+ const message = createBaseExtendedVoteInfo();
4109
+ message.validator = (object.validator !== undefined && object.validator !== null)
4110
+ ? Validator.fromPartial(object.validator)
4111
+ : undefined;
4112
+ message.signedLastBlock = object.signedLastBlock ?? false;
4113
+ message.voteExtension = object.voteExtension ?? new Uint8Array();
4114
+ return message;
4115
+ },
4116
+ };
4117
+
4118
+ function createBaseMisbehavior(): Misbehavior {
4119
+ return { type: 0, validator: undefined, height: 0, time: undefined, totalVotingPower: 0 };
4120
+ }
4121
+
4122
+ export const Misbehavior = {
4123
+ encode(message: Misbehavior, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
4124
+ if (message.type !== 0) {
4125
+ writer.uint32(8).int32(message.type);
4126
+ }
4127
+ if (message.validator !== undefined) {
4128
+ Validator.encode(message.validator, writer.uint32(18).fork()).ldelim();
4129
+ }
4130
+ if (message.height !== 0) {
4131
+ writer.uint32(24).int64(message.height);
4132
+ }
4133
+ if (message.time !== undefined) {
4134
+ Timestamp.encode(toTimestamp(message.time), writer.uint32(34).fork()).ldelim();
4135
+ }
4136
+ if (message.totalVotingPower !== 0) {
4137
+ writer.uint32(40).int64(message.totalVotingPower);
4138
+ }
4139
+ return writer;
4140
+ },
4141
+
4142
+ decode(input: _m0.Reader | Uint8Array, length?: number): Misbehavior {
4143
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
4144
+ let end = length === undefined ? reader.len : reader.pos + length;
4145
+ const message = createBaseMisbehavior();
4146
+ while (reader.pos < end) {
4147
+ const tag = reader.uint32();
4148
+ switch (tag >>> 3) {
4149
+ case 1:
4150
+ message.type = reader.int32() as any;
4151
+ break;
4152
+ case 2:
4153
+ message.validator = Validator.decode(reader, reader.uint32());
4154
+ break;
4155
+ case 3:
4156
+ message.height = longToNumber(reader.int64() as Long);
4157
+ break;
4158
+ case 4:
4159
+ message.time = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
4160
+ break;
4161
+ case 5:
4162
+ message.totalVotingPower = longToNumber(reader.int64() as Long);
4163
+ break;
4164
+ default:
4165
+ reader.skipType(tag & 7);
4166
+ break;
4167
+ }
4168
+ }
4169
+ return message;
4170
+ },
4171
+
4172
+ fromJSON(object: any): Misbehavior {
4173
+ return {
4174
+ type: isSet(object.type) ? misbehaviorTypeFromJSON(object.type) : 0,
4175
+ validator: isSet(object.validator) ? Validator.fromJSON(object.validator) : undefined,
4176
+ height: isSet(object.height) ? Number(object.height) : 0,
4177
+ time: isSet(object.time) ? fromJsonTimestamp(object.time) : undefined,
4178
+ totalVotingPower: isSet(object.totalVotingPower) ? Number(object.totalVotingPower) : 0,
4179
+ };
4180
+ },
4181
+
4182
+ toJSON(message: Misbehavior): unknown {
4183
+ const obj: any = {};
4184
+ message.type !== undefined && (obj.type = misbehaviorTypeToJSON(message.type));
4185
+ message.validator !== undefined
4186
+ && (obj.validator = message.validator ? Validator.toJSON(message.validator) : undefined);
4187
+ message.height !== undefined && (obj.height = Math.round(message.height));
4188
+ message.time !== undefined && (obj.time = message.time.toISOString());
4189
+ message.totalVotingPower !== undefined && (obj.totalVotingPower = Math.round(message.totalVotingPower));
4190
+ return obj;
4191
+ },
4192
+
4193
+ fromPartial<I extends Exact<DeepPartial<Misbehavior>, I>>(object: I): Misbehavior {
4194
+ const message = createBaseMisbehavior();
4195
+ message.type = object.type ?? 0;
4196
+ message.validator = (object.validator !== undefined && object.validator !== null)
4197
+ ? Validator.fromPartial(object.validator)
4198
+ : undefined;
4199
+ message.height = object.height ?? 0;
4200
+ message.time = object.time ?? undefined;
4201
+ message.totalVotingPower = object.totalVotingPower ?? 0;
4202
+ return message;
4203
+ },
4204
+ };
4205
+
4206
+ function createBaseSnapshot(): Snapshot {
4207
+ return { height: 0, format: 0, chunks: 0, hash: new Uint8Array(), metadata: new Uint8Array() };
4208
+ }
4209
+
4210
+ export const Snapshot = {
4211
+ encode(message: Snapshot, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
4212
+ if (message.height !== 0) {
4213
+ writer.uint32(8).uint64(message.height);
4214
+ }
4215
+ if (message.format !== 0) {
4216
+ writer.uint32(16).uint32(message.format);
4217
+ }
4218
+ if (message.chunks !== 0) {
4219
+ writer.uint32(24).uint32(message.chunks);
4220
+ }
4221
+ if (message.hash.length !== 0) {
4222
+ writer.uint32(34).bytes(message.hash);
4223
+ }
4224
+ if (message.metadata.length !== 0) {
4225
+ writer.uint32(42).bytes(message.metadata);
4226
+ }
4227
+ return writer;
4228
+ },
4229
+
4230
+ decode(input: _m0.Reader | Uint8Array, length?: number): Snapshot {
4231
+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);
4232
+ let end = length === undefined ? reader.len : reader.pos + length;
4233
+ const message = createBaseSnapshot();
4234
+ while (reader.pos < end) {
4235
+ const tag = reader.uint32();
4236
+ switch (tag >>> 3) {
4237
+ case 1:
4238
+ message.height = longToNumber(reader.uint64() as Long);
4239
+ break;
4240
+ case 2:
4241
+ message.format = reader.uint32();
4242
+ break;
4243
+ case 3:
4244
+ message.chunks = reader.uint32();
4245
+ break;
4246
+ case 4:
4247
+ message.hash = reader.bytes();
4248
+ break;
4249
+ case 5:
4250
+ message.metadata = reader.bytes();
4251
+ break;
4252
+ default:
4253
+ reader.skipType(tag & 7);
4254
+ break;
4255
+ }
4256
+ }
4257
+ return message;
4258
+ },
4259
+
4260
+ fromJSON(object: any): Snapshot {
4261
+ return {
4262
+ height: isSet(object.height) ? Number(object.height) : 0,
4263
+ format: isSet(object.format) ? Number(object.format) : 0,
4264
+ chunks: isSet(object.chunks) ? Number(object.chunks) : 0,
4265
+ hash: isSet(object.hash) ? bytesFromBase64(object.hash) : new Uint8Array(),
4266
+ metadata: isSet(object.metadata) ? bytesFromBase64(object.metadata) : new Uint8Array(),
4267
+ };
4268
+ },
4269
+
4270
+ toJSON(message: Snapshot): unknown {
4271
+ const obj: any = {};
4272
+ message.height !== undefined && (obj.height = Math.round(message.height));
4273
+ message.format !== undefined && (obj.format = Math.round(message.format));
4274
+ message.chunks !== undefined && (obj.chunks = Math.round(message.chunks));
4275
+ message.hash !== undefined
4276
+ && (obj.hash = base64FromBytes(message.hash !== undefined ? message.hash : new Uint8Array()));
4277
+ message.metadata !== undefined
4278
+ && (obj.metadata = base64FromBytes(message.metadata !== undefined ? message.metadata : new Uint8Array()));
4279
+ return obj;
4280
+ },
4281
+
4282
+ fromPartial<I extends Exact<DeepPartial<Snapshot>, I>>(object: I): Snapshot {
4283
+ const message = createBaseSnapshot();
4284
+ message.height = object.height ?? 0;
4285
+ message.format = object.format ?? 0;
4286
+ message.chunks = object.chunks ?? 0;
4287
+ message.hash = object.hash ?? new Uint8Array();
4288
+ message.metadata = object.metadata ?? new Uint8Array();
4289
+ return message;
4290
+ },
4291
+ };
4292
+
4293
+ export interface ABCIApplication {
4294
+ Echo(request: RequestEcho): Promise<ResponseEcho>;
4295
+ Flush(request: RequestFlush): Promise<ResponseFlush>;
4296
+ Info(request: RequestInfo): Promise<ResponseInfo>;
4297
+ DeliverTx(request: RequestDeliverTx): Promise<ResponseDeliverTx>;
4298
+ CheckTx(request: RequestCheckTx): Promise<ResponseCheckTx>;
4299
+ Query(request: RequestQuery): Promise<ResponseQuery>;
4300
+ Commit(request: RequestCommit): Promise<ResponseCommit>;
4301
+ InitChain(request: RequestInitChain): Promise<ResponseInitChain>;
4302
+ BeginBlock(request: RequestBeginBlock): Promise<ResponseBeginBlock>;
4303
+ EndBlock(request: RequestEndBlock): Promise<ResponseEndBlock>;
4304
+ ListSnapshots(request: RequestListSnapshots): Promise<ResponseListSnapshots>;
4305
+ OfferSnapshot(request: RequestOfferSnapshot): Promise<ResponseOfferSnapshot>;
4306
+ LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise<ResponseLoadSnapshotChunk>;
4307
+ ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise<ResponseApplySnapshotChunk>;
4308
+ PrepareProposal(request: RequestPrepareProposal): Promise<ResponsePrepareProposal>;
4309
+ ProcessProposal(request: RequestProcessProposal): Promise<ResponseProcessProposal>;
4310
+ }
4311
+
4312
+ export class ABCIApplicationClientImpl implements ABCIApplication {
4313
+ private readonly rpc: Rpc;
4314
+ constructor(rpc: Rpc) {
4315
+ this.rpc = rpc;
4316
+ this.Echo = this.Echo.bind(this);
4317
+ this.Flush = this.Flush.bind(this);
4318
+ this.Info = this.Info.bind(this);
4319
+ this.DeliverTx = this.DeliverTx.bind(this);
4320
+ this.CheckTx = this.CheckTx.bind(this);
4321
+ this.Query = this.Query.bind(this);
4322
+ this.Commit = this.Commit.bind(this);
4323
+ this.InitChain = this.InitChain.bind(this);
4324
+ this.BeginBlock = this.BeginBlock.bind(this);
4325
+ this.EndBlock = this.EndBlock.bind(this);
4326
+ this.ListSnapshots = this.ListSnapshots.bind(this);
4327
+ this.OfferSnapshot = this.OfferSnapshot.bind(this);
4328
+ this.LoadSnapshotChunk = this.LoadSnapshotChunk.bind(this);
4329
+ this.ApplySnapshotChunk = this.ApplySnapshotChunk.bind(this);
4330
+ this.PrepareProposal = this.PrepareProposal.bind(this);
4331
+ this.ProcessProposal = this.ProcessProposal.bind(this);
4332
+ }
4333
+ Echo(request: RequestEcho): Promise<ResponseEcho> {
4334
+ const data = RequestEcho.encode(request).finish();
4335
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Echo", data);
4336
+ return promise.then((data) => ResponseEcho.decode(new _m0.Reader(data)));
4337
+ }
4338
+
4339
+ Flush(request: RequestFlush): Promise<ResponseFlush> {
4340
+ const data = RequestFlush.encode(request).finish();
4341
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Flush", data);
4342
+ return promise.then((data) => ResponseFlush.decode(new _m0.Reader(data)));
4343
+ }
4344
+
4345
+ Info(request: RequestInfo): Promise<ResponseInfo> {
4346
+ const data = RequestInfo.encode(request).finish();
4347
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Info", data);
4348
+ return promise.then((data) => ResponseInfo.decode(new _m0.Reader(data)));
4349
+ }
4350
+
4351
+ DeliverTx(request: RequestDeliverTx): Promise<ResponseDeliverTx> {
4352
+ const data = RequestDeliverTx.encode(request).finish();
4353
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "DeliverTx", data);
4354
+ return promise.then((data) => ResponseDeliverTx.decode(new _m0.Reader(data)));
4355
+ }
4356
+
4357
+ CheckTx(request: RequestCheckTx): Promise<ResponseCheckTx> {
4358
+ const data = RequestCheckTx.encode(request).finish();
4359
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "CheckTx", data);
4360
+ return promise.then((data) => ResponseCheckTx.decode(new _m0.Reader(data)));
4361
+ }
4362
+
4363
+ Query(request: RequestQuery): Promise<ResponseQuery> {
4364
+ const data = RequestQuery.encode(request).finish();
4365
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Query", data);
4366
+ return promise.then((data) => ResponseQuery.decode(new _m0.Reader(data)));
4367
+ }
4368
+
4369
+ Commit(request: RequestCommit): Promise<ResponseCommit> {
4370
+ const data = RequestCommit.encode(request).finish();
4371
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "Commit", data);
4372
+ return promise.then((data) => ResponseCommit.decode(new _m0.Reader(data)));
4373
+ }
4374
+
4375
+ InitChain(request: RequestInitChain): Promise<ResponseInitChain> {
4376
+ const data = RequestInitChain.encode(request).finish();
4377
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "InitChain", data);
4378
+ return promise.then((data) => ResponseInitChain.decode(new _m0.Reader(data)));
4379
+ }
4380
+
4381
+ BeginBlock(request: RequestBeginBlock): Promise<ResponseBeginBlock> {
4382
+ const data = RequestBeginBlock.encode(request).finish();
4383
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "BeginBlock", data);
4384
+ return promise.then((data) => ResponseBeginBlock.decode(new _m0.Reader(data)));
4385
+ }
4386
+
4387
+ EndBlock(request: RequestEndBlock): Promise<ResponseEndBlock> {
4388
+ const data = RequestEndBlock.encode(request).finish();
4389
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "EndBlock", data);
4390
+ return promise.then((data) => ResponseEndBlock.decode(new _m0.Reader(data)));
4391
+ }
4392
+
4393
+ ListSnapshots(request: RequestListSnapshots): Promise<ResponseListSnapshots> {
4394
+ const data = RequestListSnapshots.encode(request).finish();
4395
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ListSnapshots", data);
4396
+ return promise.then((data) => ResponseListSnapshots.decode(new _m0.Reader(data)));
4397
+ }
4398
+
4399
+ OfferSnapshot(request: RequestOfferSnapshot): Promise<ResponseOfferSnapshot> {
4400
+ const data = RequestOfferSnapshot.encode(request).finish();
4401
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "OfferSnapshot", data);
4402
+ return promise.then((data) => ResponseOfferSnapshot.decode(new _m0.Reader(data)));
4403
+ }
4404
+
4405
+ LoadSnapshotChunk(request: RequestLoadSnapshotChunk): Promise<ResponseLoadSnapshotChunk> {
4406
+ const data = RequestLoadSnapshotChunk.encode(request).finish();
4407
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "LoadSnapshotChunk", data);
4408
+ return promise.then((data) => ResponseLoadSnapshotChunk.decode(new _m0.Reader(data)));
4409
+ }
4410
+
4411
+ ApplySnapshotChunk(request: RequestApplySnapshotChunk): Promise<ResponseApplySnapshotChunk> {
4412
+ const data = RequestApplySnapshotChunk.encode(request).finish();
4413
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ApplySnapshotChunk", data);
4414
+ return promise.then((data) => ResponseApplySnapshotChunk.decode(new _m0.Reader(data)));
4415
+ }
4416
+
4417
+ PrepareProposal(request: RequestPrepareProposal): Promise<ResponsePrepareProposal> {
4418
+ const data = RequestPrepareProposal.encode(request).finish();
4419
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "PrepareProposal", data);
4420
+ return promise.then((data) => ResponsePrepareProposal.decode(new _m0.Reader(data)));
4421
+ }
4422
+
4423
+ ProcessProposal(request: RequestProcessProposal): Promise<ResponseProcessProposal> {
4424
+ const data = RequestProcessProposal.encode(request).finish();
4425
+ const promise = this.rpc.request("tendermint.abci.ABCIApplication", "ProcessProposal", data);
4426
+ return promise.then((data) => ResponseProcessProposal.decode(new _m0.Reader(data)));
4427
+ }
4428
+ }
4429
+
4430
+ interface Rpc {
4431
+ request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;
4432
+ }
4433
+
4434
+ declare var self: any | undefined;
4435
+ declare var window: any | undefined;
4436
+ declare var global: any | undefined;
4437
+ var globalThis: any = (() => {
4438
+ if (typeof globalThis !== "undefined") {
4439
+ return globalThis;
4440
+ }
4441
+ if (typeof self !== "undefined") {
4442
+ return self;
4443
+ }
4444
+ if (typeof window !== "undefined") {
4445
+ return window;
4446
+ }
4447
+ if (typeof global !== "undefined") {
4448
+ return global;
4449
+ }
4450
+ throw "Unable to locate global object";
4451
+ })();
4452
+
4453
+ function bytesFromBase64(b64: string): Uint8Array {
4454
+ if (globalThis.Buffer) {
4455
+ return Uint8Array.from(globalThis.Buffer.from(b64, "base64"));
4456
+ } else {
4457
+ const bin = globalThis.atob(b64);
4458
+ const arr = new Uint8Array(bin.length);
4459
+ for (let i = 0; i < bin.length; ++i) {
4460
+ arr[i] = bin.charCodeAt(i);
4461
+ }
4462
+ return arr;
4463
+ }
4464
+ }
4465
+
4466
+ function base64FromBytes(arr: Uint8Array): string {
4467
+ if (globalThis.Buffer) {
4468
+ return globalThis.Buffer.from(arr).toString("base64");
4469
+ } else {
4470
+ const bin: string[] = [];
4471
+ arr.forEach((byte) => {
4472
+ bin.push(String.fromCharCode(byte));
4473
+ });
4474
+ return globalThis.btoa(bin.join(""));
4475
+ }
4476
+ }
4477
+
4478
+ type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
4479
+
4480
+ export type DeepPartial<T> = T extends Builtin ? T
4481
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
4482
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
4483
+ : Partial<T>;
4484
+
4485
+ type KeysOfUnion<T> = T extends T ? keyof T : never;
4486
+ export type Exact<P, I extends P> = P extends Builtin ? P
4487
+ : P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
4488
+
4489
+ function toTimestamp(date: Date): Timestamp {
4490
+ const seconds = date.getTime() / 1_000;
4491
+ const nanos = (date.getTime() % 1_000) * 1_000_000;
4492
+ return { seconds, nanos };
4493
+ }
4494
+
4495
+ function fromTimestamp(t: Timestamp): Date {
4496
+ let millis = t.seconds * 1_000;
4497
+ millis += t.nanos / 1_000_000;
4498
+ return new Date(millis);
4499
+ }
4500
+
4501
+ function fromJsonTimestamp(o: any): Date {
4502
+ if (o instanceof Date) {
4503
+ return o;
4504
+ } else if (typeof o === "string") {
4505
+ return new Date(o);
4506
+ } else {
4507
+ return fromTimestamp(Timestamp.fromJSON(o));
4508
+ }
4509
+ }
4510
+
4511
+ function longToNumber(long: Long): number {
4512
+ if (long.gt(Number.MAX_SAFE_INTEGER)) {
4513
+ throw new globalThis.Error("Value is larger than Number.MAX_SAFE_INTEGER");
4514
+ }
4515
+ return long.toNumber();
4516
+ }
4517
+
4518
+ if (_m0.util.Long !== Long) {
4519
+ _m0.util.Long = Long as any;
4520
+ _m0.configure();
4521
+ }
4522
+
4523
+ function isSet(value: any): boolean {
4524
+ return value !== null && value !== undefined;
4525
+ }