@xpla/xpla-react 1.7.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (346) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/package.json +47 -0
  3. package/src/amino/amino.ts +1 -0
  4. package/src/binary.ts +534 -0
  5. package/src/cosmos/app/runtime/v1alpha1/module.ts +423 -0
  6. package/src/cosmos/app/runtime/v2/module.ts +589 -0
  7. package/src/cosmos/app/v1alpha1/config.ts +422 -0
  8. package/src/cosmos/app/v1alpha1/module.ts +461 -0
  9. package/src/cosmos/app/v1alpha1/query.rpc.func.ts +14 -0
  10. package/src/cosmos/app/v1alpha1/query.ts +177 -0
  11. package/src/cosmos/auth/module/v1/module.ts +253 -0
  12. package/src/cosmos/auth/v1beta1/accounts.ts +226 -0
  13. package/src/cosmos/auth/v1beta1/auth.ts +550 -0
  14. package/src/cosmos/auth/v1beta1/genesis.ts +119 -0
  15. package/src/cosmos/auth/v1beta1/query.rpc.func.ts +113 -0
  16. package/src/cosmos/auth/v1beta1/query.ts +2034 -0
  17. package/src/cosmos/auth/v1beta1/tx.registry.ts +29 -0
  18. package/src/cosmos/auth/v1beta1/tx.rpc.func.ts +13 -0
  19. package/src/cosmos/auth/v1beta1/tx.ts +219 -0
  20. package/src/cosmos/authz/module/v1/module.ts +80 -0
  21. package/src/cosmos/authz/v1beta1/authz.ts +481 -0
  22. package/src/cosmos/authz/v1beta1/event.ts +259 -0
  23. package/src/cosmos/authz/v1beta1/genesis.ts +100 -0
  24. package/src/cosmos/authz/v1beta1/query.rpc.func.ts +36 -0
  25. package/src/cosmos/authz/v1beta1/query.ts +707 -0
  26. package/src/cosmos/authz/v1beta1/tx.registry.ts +65 -0
  27. package/src/cosmos/authz/v1beta1/tx.rpc.func.ts +31 -0
  28. package/src/cosmos/authz/v1beta1/tx.ts +647 -0
  29. package/src/cosmos/autocli/v1/options.ts +1145 -0
  30. package/src/cosmos/autocli/v1/query.rpc.func.ts +14 -0
  31. package/src/cosmos/autocli/v1/query.ts +288 -0
  32. package/src/cosmos/bank/module/v1/module.ts +153 -0
  33. package/src/cosmos/bank/v1beta1/authz.ts +138 -0
  34. package/src/cosmos/bank/v1beta1/bank.ts +974 -0
  35. package/src/cosmos/bank/v1beta1/genesis.ts +307 -0
  36. package/src/cosmos/bank/v1beta1/query.rpc.func.ts +146 -0
  37. package/src/cosmos/bank/v1beta1/query.ts +3027 -0
  38. package/src/cosmos/bank/v1beta1/tx.registry.ts +83 -0
  39. package/src/cosmos/bank/v1beta1/tx.rpc.func.ts +40 -0
  40. package/src/cosmos/bank/v1beta1/tx.ts +861 -0
  41. package/src/cosmos/base/abci/v1beta1/abci.ts +1698 -0
  42. package/src/cosmos/base/grpc/v2/service.rpc.func.ts +25 -0
  43. package/src/cosmos/base/grpc/v2/service.ts +473 -0
  44. package/src/cosmos/base/node/v1beta1/query.rpc.func.ts +25 -0
  45. package/src/cosmos/base/node/v1beta1/query.ts +454 -0
  46. package/src/cosmos/base/query/v1beta1/pagination.ts +361 -0
  47. package/src/cosmos/base/reflection/v1beta1/reflection.rpc.func.ts +25 -0
  48. package/src/cosmos/base/reflection/v1beta1/reflection.ts +382 -0
  49. package/src/cosmos/base/reflection/v2alpha1/reflection.rpc.func.ts +69 -0
  50. package/src/cosmos/base/reflection/v2alpha1/reflection.ts +2727 -0
  51. package/src/cosmos/base/tendermint/v1beta1/query.rpc.func.ts +80 -0
  52. package/src/cosmos/base/tendermint/v1beta1/query.ts +2302 -0
  53. package/src/cosmos/base/tendermint/v1beta1/types.ts +455 -0
  54. package/src/cosmos/base/v1beta1/coin.ts +439 -0
  55. package/src/cosmos/circuit/module/v1/module.ts +99 -0
  56. package/src/cosmos/circuit/v1/query.rpc.func.ts +36 -0
  57. package/src/cosmos/circuit/v1/query.ts +574 -0
  58. package/src/cosmos/circuit/v1/tx.registry.ts +65 -0
  59. package/src/cosmos/circuit/v1/tx.rpc.func.ts +31 -0
  60. package/src/cosmos/circuit/v1/tx.ts +676 -0
  61. package/src/cosmos/circuit/v1/types.ts +413 -0
  62. package/src/cosmos/consensus/module/v1/module.ts +99 -0
  63. package/src/cosmos/consensus/v1/query.rpc.func.ts +14 -0
  64. package/src/cosmos/consensus/v1/query.ts +185 -0
  65. package/src/cosmos/consensus/v1/tx.registry.ts +29 -0
  66. package/src/cosmos/consensus/v1/tx.rpc.func.ts +13 -0
  67. package/src/cosmos/consensus/v1/tx.ts +255 -0
  68. package/src/cosmos/crisis/module/v1/module.ts +115 -0
  69. package/src/cosmos/crisis/v1beta1/genesis.ts +106 -0
  70. package/src/cosmos/crisis/v1beta1/tx.registry.ts +47 -0
  71. package/src/cosmos/crisis/v1beta1/tx.rpc.func.ts +22 -0
  72. package/src/cosmos/crisis/v1beta1/tx.ts +416 -0
  73. package/src/cosmos/crypto/ed25519/keys.ts +209 -0
  74. package/src/cosmos/crypto/hd/v1/hd.ts +169 -0
  75. package/src/cosmos/crypto/keyring/v1/record.ts +529 -0
  76. package/src/cosmos/crypto/multisig/keys.ts +122 -0
  77. package/src/cosmos/crypto/multisig/v1beta1/multisig.ts +225 -0
  78. package/src/cosmos/crypto/secp256k1/keys.ts +203 -0
  79. package/src/cosmos/crypto/secp256r1/keys.ts +201 -0
  80. package/src/cosmos/distribution/module/v1/module.ts +113 -0
  81. package/src/cosmos/distribution/v1beta1/distribution.ts +1494 -0
  82. package/src/cosmos/distribution/v1beta1/genesis.ts +1129 -0
  83. package/src/cosmos/distribution/v1beta1/query.rpc.func.ts +113 -0
  84. package/src/cosmos/distribution/v1beta1/query.ts +2126 -0
  85. package/src/cosmos/distribution/v1beta1/tx.registry.ts +137 -0
  86. package/src/cosmos/distribution/v1beta1/tx.rpc.func.ts +67 -0
  87. package/src/cosmos/distribution/v1beta1/tx.ts +1478 -0
  88. package/src/cosmos/evidence/module/v1/module.ts +80 -0
  89. package/src/cosmos/evidence/v1beta1/evidence.ts +154 -0
  90. package/src/cosmos/evidence/v1beta1/genesis.ts +102 -0
  91. package/src/cosmos/evidence/v1beta1/query.rpc.func.ts +25 -0
  92. package/src/cosmos/evidence/v1beta1/query.ts +451 -0
  93. package/src/cosmos/evidence/v1beta1/tx.registry.ts +29 -0
  94. package/src/cosmos/evidence/v1beta1/tx.rpc.func.ts +13 -0
  95. package/src/cosmos/evidence/v1beta1/tx.ts +221 -0
  96. package/src/cosmos/feegrant/module/v1/module.ts +80 -0
  97. package/src/cosmos/feegrant/v1beta1/feegrant.ts +573 -0
  98. package/src/cosmos/feegrant/v1beta1/genesis.ts +100 -0
  99. package/src/cosmos/feegrant/v1beta1/query.rpc.func.ts +36 -0
  100. package/src/cosmos/feegrant/v1beta1/query.ts +677 -0
  101. package/src/cosmos/feegrant/v1beta1/tx.registry.ts +65 -0
  102. package/src/cosmos/feegrant/v1beta1/tx.rpc.func.ts +31 -0
  103. package/src/cosmos/feegrant/v1beta1/tx.ts +597 -0
  104. package/src/cosmos/genutil/module/v1/module.ts +80 -0
  105. package/src/cosmos/genutil/v1beta1/genesis.ts +101 -0
  106. package/src/cosmos/gov/module/v1/module.ts +121 -0
  107. package/src/cosmos/gov/v1/genesis.ts +280 -0
  108. package/src/cosmos/gov/v1/gov.ts +1843 -0
  109. package/src/cosmos/gov/v1/query.rpc.func.ts +102 -0
  110. package/src/cosmos/gov/v1/query.ts +1970 -0
  111. package/src/cosmos/gov/v1/tx.registry.ts +137 -0
  112. package/src/cosmos/gov/v1/tx.rpc.func.ts +67 -0
  113. package/src/cosmos/gov/v1/tx.ts +1657 -0
  114. package/src/cosmos/gov/v1beta1/genesis.ts +202 -0
  115. package/src/cosmos/gov/v1beta1/gov.ts +1425 -0
  116. package/src/cosmos/gov/v1beta1/query.rpc.func.ts +91 -0
  117. package/src/cosmos/gov/v1beta1/query.ts +1749 -0
  118. package/src/cosmos/gov/v1beta1/tx.registry.ts +83 -0
  119. package/src/cosmos/gov/v1beta1/tx.rpc.func.ts +40 -0
  120. package/src/cosmos/gov/v1beta1/tx.ts +881 -0
  121. package/src/cosmos/group/module/v1/module.ts +128 -0
  122. package/src/cosmos/group/v1/events.ts +1044 -0
  123. package/src/cosmos/group/v1/genesis.ts +240 -0
  124. package/src/cosmos/group/v1/query.rpc.func.ts +157 -0
  125. package/src/cosmos/group/v1/query.ts +3015 -0
  126. package/src/cosmos/group/v1/tx.registry.ts +263 -0
  127. package/src/cosmos/group/v1/tx.rpc.func.ts +130 -0
  128. package/src/cosmos/group/v1/tx.ts +3207 -0
  129. package/src/cosmos/group/v1/types.ts +2081 -0
  130. package/src/cosmos/ics23/v1/proofs.ts +2060 -0
  131. package/src/cosmos/mint/module/v1/module.ts +113 -0
  132. package/src/cosmos/mint/v1beta1/genesis.ts +116 -0
  133. package/src/cosmos/mint/v1beta1/mint.ts +291 -0
  134. package/src/cosmos/mint/v1beta1/query.rpc.func.ts +36 -0
  135. package/src/cosmos/mint/v1beta1/query.ts +541 -0
  136. package/src/cosmos/mint/v1beta1/tx.registry.ts +29 -0
  137. package/src/cosmos/mint/v1beta1/tx.rpc.func.ts +13 -0
  138. package/src/cosmos/mint/v1beta1/tx.ts +219 -0
  139. package/src/cosmos/msg/textual/v1/textual.ts +1 -0
  140. package/src/cosmos/msg/v1/msg.ts +1 -0
  141. package/src/cosmos/nft/module/v1/module.ts +80 -0
  142. package/src/cosmos/nft/v1beta1/event.ts +403 -0
  143. package/src/cosmos/nft/v1beta1/genesis.ts +234 -0
  144. package/src/cosmos/nft/v1beta1/nft.ts +356 -0
  145. package/src/cosmos/nft/v1beta1/query.rpc.func.ts +80 -0
  146. package/src/cosmos/nft/v1beta1/query.ts +1465 -0
  147. package/src/cosmos/nft/v1beta1/tx.registry.ts +29 -0
  148. package/src/cosmos/nft/v1beta1/tx.rpc.func.ts +13 -0
  149. package/src/cosmos/nft/v1beta1/tx.ts +224 -0
  150. package/src/cosmos/orm/module/v1alpha1/module.ts +88 -0
  151. package/src/cosmos/orm/query/v1alpha1/query.rpc.func.ts +25 -0
  152. package/src/cosmos/orm/query/v1alpha1/query.ts +993 -0
  153. package/src/cosmos/orm/v1/orm.ts +589 -0
  154. package/src/cosmos/orm/v1alpha1/schema.ts +325 -0
  155. package/src/cosmos/params/module/v1/module.ts +80 -0
  156. package/src/cosmos/params/v1beta1/params.ts +255 -0
  157. package/src/cosmos/params/v1beta1/query.rpc.func.ts +25 -0
  158. package/src/cosmos/params/v1beta1/query.ts +525 -0
  159. package/src/cosmos/query/v1/query.ts +1 -0
  160. package/src/cosmos/reflection/v1/reflection.rpc.func.ts +14 -0
  161. package/src/cosmos/reflection/v1/reflection.ts +179 -0
  162. package/src/cosmos/slashing/module/v1/module.ts +99 -0
  163. package/src/cosmos/slashing/v1beta1/genesis.ts +492 -0
  164. package/src/cosmos/slashing/v1beta1/query.rpc.func.ts +36 -0
  165. package/src/cosmos/slashing/v1beta1/query.ts +598 -0
  166. package/src/cosmos/slashing/v1beta1/slashing.ts +357 -0
  167. package/src/cosmos/slashing/v1beta1/tx.registry.ts +47 -0
  168. package/src/cosmos/slashing/v1beta1/tx.rpc.func.ts +22 -0
  169. package/src/cosmos/slashing/v1beta1/tx.ts +390 -0
  170. package/src/cosmos/staking/module/v1/module.ts +157 -0
  171. package/src/cosmos/staking/v1beta1/authz.ts +323 -0
  172. package/src/cosmos/staking/v1beta1/genesis.ts +346 -0
  173. package/src/cosmos/staking/v1beta1/query.rpc.func.ts +157 -0
  174. package/src/cosmos/staking/v1beta1/query.ts +3073 -0
  175. package/src/cosmos/staking/v1beta1/staking.ts +3005 -0
  176. package/src/cosmos/staking/v1beta1/tx.registry.ts +137 -0
  177. package/src/cosmos/staking/v1beta1/tx.rpc.func.ts +67 -0
  178. package/src/cosmos/staking/v1beta1/tx.ts +1638 -0
  179. package/src/cosmos/store/internal/kv/v1beta1/kv.ts +207 -0
  180. package/src/cosmos/store/snapshots/v1/snapshot.ts +863 -0
  181. package/src/cosmos/store/snapshots/v2/snapshot.ts +823 -0
  182. package/src/cosmos/store/streaming/abci/grpc.ts +393 -0
  183. package/src/cosmos/store/v1beta1/commit_info.ts +362 -0
  184. package/src/cosmos/store/v1beta1/listening.ts +286 -0
  185. package/src/cosmos/streaming/v1/grpc.ts +985 -0
  186. package/src/cosmos/tx/config/v1/config.ts +127 -0
  187. package/src/cosmos/tx/signing/v1beta1/signing.ts +688 -0
  188. package/src/cosmos/tx/v1beta1/service.rpc.func.ts +102 -0
  189. package/src/cosmos/tx/v1beta1/service.ts +2294 -0
  190. package/src/cosmos/tx/v1beta1/tx.ts +2029 -0
  191. package/src/cosmos/upgrade/module/v1/module.ts +99 -0
  192. package/src/cosmos/upgrade/v1beta1/query.rpc.func.ts +58 -0
  193. package/src/cosmos/upgrade/v1beta1/query.ts +1016 -0
  194. package/src/cosmos/upgrade/v1beta1/tx.registry.ts +47 -0
  195. package/src/cosmos/upgrade/v1beta1/tx.rpc.func.ts +22 -0
  196. package/src/cosmos/upgrade/v1beta1/tx.ts +398 -0
  197. package/src/cosmos/upgrade/v1beta1/upgrade.ts +591 -0
  198. package/src/cosmos/validate/module/v1/module.ts +80 -0
  199. package/src/cosmos/vesting/module/v1/module.ts +80 -0
  200. package/src/cosmos/vesting/v1beta1/tx.registry.ts +65 -0
  201. package/src/cosmos/vesting/v1beta1/tx.rpc.func.ts +31 -0
  202. package/src/cosmos/vesting/v1beta1/tx.ts +698 -0
  203. package/src/cosmos/vesting/v1beta1/vesting.ts +735 -0
  204. package/src/cosmos_proto/cosmos.ts +341 -0
  205. package/src/cosmwasm/wasm/v1/authz.ts +1231 -0
  206. package/src/cosmwasm/wasm/v1/genesis.ts +532 -0
  207. package/src/cosmwasm/wasm/v1/ibc.ts +355 -0
  208. package/src/cosmwasm/wasm/v1/proposal_legacy.ts +2432 -0
  209. package/src/cosmwasm/wasm/v1/query.rpc.func.ts +124 -0
  210. package/src/cosmwasm/wasm/v1/query.ts +2560 -0
  211. package/src/cosmwasm/wasm/v1/tx.registry.ts +317 -0
  212. package/src/cosmwasm/wasm/v1/tx.rpc.func.ts +157 -0
  213. package/src/cosmwasm/wasm/v1/tx.ts +4191 -0
  214. package/src/cosmwasm/wasm/v1/types.ts +1120 -0
  215. package/src/ethermint/crypto/v1/ethsecp256k1/keys.ts +193 -0
  216. package/src/ethermint/evm/v1/events.ts +485 -0
  217. package/src/ethermint/evm/v1/evm.ts +1590 -0
  218. package/src/ethermint/evm/v1/genesis.ts +240 -0
  219. package/src/ethermint/evm/v1/query.rpc.func.ts +136 -0
  220. package/src/ethermint/evm/v1/query.ts +2535 -0
  221. package/src/ethermint/evm/v1/tx.registry.ts +47 -0
  222. package/src/ethermint/evm/v1/tx.rpc.func.ts +22 -0
  223. package/src/ethermint/evm/v1/tx.ts +1333 -0
  224. package/src/ethermint/feemarket/v1/events.ts +195 -0
  225. package/src/ethermint/feemarket/v1/feemarket.ts +213 -0
  226. package/src/ethermint/feemarket/v1/genesis.ts +114 -0
  227. package/src/ethermint/feemarket/v1/query.rpc.func.ts +36 -0
  228. package/src/ethermint/feemarket/v1/query.ts +487 -0
  229. package/src/ethermint/feemarket/v1/tx.registry.ts +29 -0
  230. package/src/ethermint/feemarket/v1/tx.rpc.func.ts +13 -0
  231. package/src/ethermint/feemarket/v1/tx.ts +197 -0
  232. package/src/ethermint/types/v1/account.ts +114 -0
  233. package/src/ethermint/types/v1/dynamic_fee.ts +91 -0
  234. package/src/ethermint/types/v1/indexer.ts +205 -0
  235. package/src/ethermint/types/v1/web3.ts +147 -0
  236. package/src/extern.ts +38 -0
  237. package/src/gogoproto/gogo.ts +1 -0
  238. package/src/google/api/annotations.ts +1 -0
  239. package/src/google/api/http.ts +1069 -0
  240. package/src/google/protobuf/any.ts +331 -0
  241. package/src/google/protobuf/descriptor.ts +7177 -0
  242. package/src/google/protobuf/duration.ts +225 -0
  243. package/src/google/protobuf/timestamp.ts +281 -0
  244. package/src/helper-func-types.ts +191 -0
  245. package/src/helpers.ts +259 -0
  246. package/src/ibc/applications/fee/v1/ack.ts +131 -0
  247. package/src/ibc/applications/fee/v1/fee.ts +481 -0
  248. package/src/ibc/applications/fee/v1/genesis.ts +661 -0
  249. package/src/ibc/applications/fee/v1/metadata.ts +121 -0
  250. package/src/ibc/applications/fee/v1/query.rpc.func.ts +113 -0
  251. package/src/ibc/applications/fee/v1/query.ts +2134 -0
  252. package/src/ibc/applications/fee/v1/tx.registry.ts +83 -0
  253. package/src/ibc/applications/fee/v1/tx.rpc.func.ts +40 -0
  254. package/src/ibc/applications/fee/v1/tx.ts +889 -0
  255. package/src/ibc/applications/interchain_accounts/controller/v1/controller.ts +105 -0
  256. package/src/ibc/applications/interchain_accounts/controller/v1/query.rpc.func.ts +25 -0
  257. package/src/ibc/applications/interchain_accounts/controller/v1/query.ts +379 -0
  258. package/src/ibc/applications/interchain_accounts/controller/v1/tx.registry.ts +65 -0
  259. package/src/ibc/applications/interchain_accounts/controller/v1/tx.rpc.func.ts +31 -0
  260. package/src/ibc/applications/interchain_accounts/controller/v1/tx.ts +685 -0
  261. package/src/ibc/applications/interchain_accounts/genesis/v1/genesis.ts +661 -0
  262. package/src/ibc/applications/interchain_accounts/host/v1/host.ts +253 -0
  263. package/src/ibc/applications/interchain_accounts/host/v1/query.rpc.func.ts +14 -0
  264. package/src/ibc/applications/interchain_accounts/host/v1/query.ts +177 -0
  265. package/src/ibc/applications/interchain_accounts/host/v1/tx.registry.ts +47 -0
  266. package/src/ibc/applications/interchain_accounts/host/v1/tx.rpc.func.ts +22 -0
  267. package/src/ibc/applications/interchain_accounts/host/v1/tx.ts +429 -0
  268. package/src/ibc/applications/interchain_accounts/v1/account.ts +112 -0
  269. package/src/ibc/applications/interchain_accounts/v1/metadata.ts +191 -0
  270. package/src/ibc/applications/interchain_accounts/v1/packet.ts +259 -0
  271. package/src/ibc/applications/transfer/v1/authz.ts +280 -0
  272. package/src/ibc/applications/transfer/v1/genesis.ts +153 -0
  273. package/src/ibc/applications/transfer/v1/query.rpc.func.ts +69 -0
  274. package/src/ibc/applications/transfer/v1/query.ts +1205 -0
  275. package/src/ibc/applications/transfer/v1/transfer.ts +261 -0
  276. package/src/ibc/applications/transfer/v1/tx.registry.ts +47 -0
  277. package/src/ibc/applications/transfer/v1/tx.rpc.func.ts +22 -0
  278. package/src/ibc/applications/transfer/v1/tx.ts +532 -0
  279. package/src/ibc/applications/transfer/v2/packet.ts +171 -0
  280. package/src/ibc/core/channel/v1/channel.ts +1510 -0
  281. package/src/ibc/core/channel/v1/genesis.ts +354 -0
  282. package/src/ibc/core/channel/v1/query.rpc.func.ts +190 -0
  283. package/src/ibc/core/channel/v1/query.ts +4354 -0
  284. package/src/ibc/core/channel/v1/tx.registry.ts +353 -0
  285. package/src/ibc/core/channel/v1/tx.rpc.func.ts +175 -0
  286. package/src/ibc/core/channel/v1/tx.ts +4866 -0
  287. package/src/ibc/core/channel/v1/upgrade.ts +388 -0
  288. package/src/ibc/core/client/v1/client.ts +927 -0
  289. package/src/ibc/core/client/v1/genesis.ts +426 -0
  290. package/src/ibc/core/client/v1/query.rpc.func.ts +113 -0
  291. package/src/ibc/core/client/v1/query.ts +2280 -0
  292. package/src/ibc/core/client/v1/tx.registry.ts +137 -0
  293. package/src/ibc/core/client/v1/tx.rpc.func.ts +67 -0
  294. package/src/ibc/core/client/v1/tx.ts +1543 -0
  295. package/src/ibc/core/commitment/v1/commitment.ts +418 -0
  296. package/src/ibc/core/connection/v1/connection.ts +1010 -0
  297. package/src/ibc/core/connection/v1/genesis.ts +146 -0
  298. package/src/ibc/core/connection/v1/query.rpc.func.ts +69 -0
  299. package/src/ibc/core/connection/v1/query.ts +1408 -0
  300. package/src/ibc/core/connection/v1/tx.registry.ts +101 -0
  301. package/src/ibc/core/connection/v1/tx.rpc.func.ts +49 -0
  302. package/src/ibc/core/connection/v1/tx.ts +1365 -0
  303. package/src/ibc/core/types/v1/genesis.ts +137 -0
  304. package/src/ibc/lightclients/localhost/v2/localhost.ts +100 -0
  305. package/src/ibc/lightclients/solomachine/v2/solomachine.ts +2103 -0
  306. package/src/ibc/lightclients/solomachine/v3/solomachine.ts +1070 -0
  307. package/src/ibc/lightclients/tendermint/v1/tendermint.ts +838 -0
  308. package/src/ibc/lightclients/wasm/v1/genesis.ts +197 -0
  309. package/src/ibc/lightclients/wasm/v1/query.rpc.func.ts +25 -0
  310. package/src/ibc/lightclients/wasm/v1/query.ts +404 -0
  311. package/src/ibc/lightclients/wasm/v1/tx.registry.ts +65 -0
  312. package/src/ibc/lightclients/wasm/v1/tx.rpc.func.ts +31 -0
  313. package/src/ibc/lightclients/wasm/v1/tx.ts +621 -0
  314. package/src/ibc/lightclients/wasm/v1/wasm.ts +438 -0
  315. package/src/react-query.ts +185 -0
  316. package/src/registry.ts +218 -0
  317. package/src/tendermint/abci/types.ts +6283 -0
  318. package/src/tendermint/crypto/keys.ts +103 -0
  319. package/src/tendermint/crypto/proof.ts +555 -0
  320. package/src/tendermint/p2p/types.ts +507 -0
  321. package/src/tendermint/types/block.ts +131 -0
  322. package/src/tendermint/types/evidence.ts +476 -0
  323. package/src/tendermint/types/params.ts +814 -0
  324. package/src/tendermint/types/types.ts +2157 -0
  325. package/src/tendermint/types/validator.ts +389 -0
  326. package/src/tendermint/version/types.ts +219 -0
  327. package/src/types.ts +155 -0
  328. package/src/utf8.ts +148 -0
  329. package/src/varint.ts +488 -0
  330. package/src/xpla/reward/v1beta1/genesis.ts +92 -0
  331. package/src/xpla/reward/v1beta1/query.rpc.func.ts +25 -0
  332. package/src/xpla/reward/v1beta1/query.ts +333 -0
  333. package/src/xpla/reward/v1beta1/reward.ts +153 -0
  334. package/src/xpla/reward/v1beta1/tx.registry.ts +47 -0
  335. package/src/xpla/reward/v1beta1/tx.rpc.func.ts +22 -0
  336. package/src/xpla/reward/v1beta1/tx.ts +391 -0
  337. package/src/xpla/volunteer/v1beta1/genesis.ts +92 -0
  338. package/src/xpla/volunteer/v1beta1/proposal.ts +649 -0
  339. package/src/xpla/volunteer/v1beta1/query.rpc.func.ts +14 -0
  340. package/src/xpla/volunteer/v1beta1/query.ts +160 -0
  341. package/src/xpla/volunteer/v1beta1/tx.registry.ts +47 -0
  342. package/src/xpla/volunteer/v1beta1/tx.rpc.func.ts +22 -0
  343. package/src/xpla/volunteer/v1beta1/tx.ts +448 -0
  344. package/src/xpla/volunteer/v1beta1/volunteervalidator.ts +107 -0
  345. package/tsconfig.esm.json +10 -0
  346. package/tsconfig.json +10 -0
@@ -0,0 +1,225 @@
1
+ import { BinaryReader, BinaryWriter } from "../../binary";
2
+ import { DeepPartial } from "../../helpers";
3
+ import { GlobalDecoderRegistry } from "../../registry";
4
+ /**
5
+ * A Duration represents a signed, fixed-length span of time represented
6
+ * as a count of seconds and fractions of seconds at nanosecond
7
+ * resolution. It is independent of any calendar and concepts like "day"
8
+ * or "month". It is related to Timestamp in that the difference between
9
+ * two Timestamp values is a Duration and it can be added or subtracted
10
+ * from a Timestamp. Range is approximately +-10,000 years.
11
+ *
12
+ * # Examples
13
+ *
14
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
15
+ *
16
+ * Timestamp start = ...;
17
+ * Timestamp end = ...;
18
+ * Duration duration = ...;
19
+ *
20
+ * duration.seconds = end.seconds - start.seconds;
21
+ * duration.nanos = end.nanos - start.nanos;
22
+ *
23
+ * if (duration.seconds < 0 && duration.nanos > 0) {
24
+ * duration.seconds += 1;
25
+ * duration.nanos -= 1000000000;
26
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
27
+ * duration.seconds -= 1;
28
+ * duration.nanos += 1000000000;
29
+ * }
30
+ *
31
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
32
+ *
33
+ * Timestamp start = ...;
34
+ * Duration duration = ...;
35
+ * Timestamp end = ...;
36
+ *
37
+ * end.seconds = start.seconds + duration.seconds;
38
+ * end.nanos = start.nanos + duration.nanos;
39
+ *
40
+ * if (end.nanos < 0) {
41
+ * end.seconds -= 1;
42
+ * end.nanos += 1000000000;
43
+ * } else if (end.nanos >= 1000000000) {
44
+ * end.seconds += 1;
45
+ * end.nanos -= 1000000000;
46
+ * }
47
+ *
48
+ * Example 3: Compute Duration from datetime.timedelta in Python.
49
+ *
50
+ * td = datetime.timedelta(days=3, minutes=10)
51
+ * duration = Duration()
52
+ * duration.FromTimedelta(td)
53
+ *
54
+ * # JSON Mapping
55
+ *
56
+ * In JSON format, the Duration type is encoded as a string rather than an
57
+ * object, where the string ends in the suffix "s" (indicating seconds) and
58
+ * is preceded by the number of seconds, with nanoseconds expressed as
59
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
60
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
61
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
62
+ * microsecond should be expressed in JSON format as "3.000001s".
63
+ */
64
+ export interface Duration {
65
+ /**
66
+ * Signed seconds of the span of time. Must be from -315,576,000,000
67
+ * to +315,576,000,000 inclusive. Note: these bounds are computed from:
68
+ * 60 sec/min * 60 min/hr * 24 hr/day * 365.25 days/year * 10000 years
69
+ */
70
+ seconds: bigint;
71
+ /**
72
+ * Signed fractions of a second at nanosecond resolution of the span
73
+ * of time. Durations less than one second are represented with a 0
74
+ * `seconds` field and a positive or negative `nanos` field. For durations
75
+ * of one second or more, a non-zero value for the `nanos` field must be
76
+ * of the same sign as the `seconds` field. Must be from -999,999,999
77
+ * to +999,999,999 inclusive.
78
+ */
79
+ nanos: number;
80
+ }
81
+ export interface DurationProtoMsg {
82
+ typeUrl: "/google.protobuf.Duration";
83
+ value: Uint8Array;
84
+ }
85
+ /**
86
+ * A Duration represents a signed, fixed-length span of time represented
87
+ * as a count of seconds and fractions of seconds at nanosecond
88
+ * resolution. It is independent of any calendar and concepts like "day"
89
+ * or "month". It is related to Timestamp in that the difference between
90
+ * two Timestamp values is a Duration and it can be added or subtracted
91
+ * from a Timestamp. Range is approximately +-10,000 years.
92
+ *
93
+ * # Examples
94
+ *
95
+ * Example 1: Compute Duration from two Timestamps in pseudo code.
96
+ *
97
+ * Timestamp start = ...;
98
+ * Timestamp end = ...;
99
+ * Duration duration = ...;
100
+ *
101
+ * duration.seconds = end.seconds - start.seconds;
102
+ * duration.nanos = end.nanos - start.nanos;
103
+ *
104
+ * if (duration.seconds < 0 && duration.nanos > 0) {
105
+ * duration.seconds += 1;
106
+ * duration.nanos -= 1000000000;
107
+ * } else if (duration.seconds > 0 && duration.nanos < 0) {
108
+ * duration.seconds -= 1;
109
+ * duration.nanos += 1000000000;
110
+ * }
111
+ *
112
+ * Example 2: Compute Timestamp from Timestamp + Duration in pseudo code.
113
+ *
114
+ * Timestamp start = ...;
115
+ * Duration duration = ...;
116
+ * Timestamp end = ...;
117
+ *
118
+ * end.seconds = start.seconds + duration.seconds;
119
+ * end.nanos = start.nanos + duration.nanos;
120
+ *
121
+ * if (end.nanos < 0) {
122
+ * end.seconds -= 1;
123
+ * end.nanos += 1000000000;
124
+ * } else if (end.nanos >= 1000000000) {
125
+ * end.seconds += 1;
126
+ * end.nanos -= 1000000000;
127
+ * }
128
+ *
129
+ * Example 3: Compute Duration from datetime.timedelta in Python.
130
+ *
131
+ * td = datetime.timedelta(days=3, minutes=10)
132
+ * duration = Duration()
133
+ * duration.FromTimedelta(td)
134
+ *
135
+ * # JSON Mapping
136
+ *
137
+ * In JSON format, the Duration type is encoded as a string rather than an
138
+ * object, where the string ends in the suffix "s" (indicating seconds) and
139
+ * is preceded by the number of seconds, with nanoseconds expressed as
140
+ * fractional seconds. For example, 3 seconds with 0 nanoseconds should be
141
+ * encoded in JSON format as "3s", while 3 seconds and 1 nanosecond should
142
+ * be expressed in JSON format as "3.000000001s", and 3 seconds and 1
143
+ * microsecond should be expressed in JSON format as "3.000001s".
144
+ */
145
+ export type DurationAmino = string;
146
+ export interface DurationAminoMsg {
147
+ type: "/google.protobuf.Duration";
148
+ value: DurationAmino;
149
+ }
150
+ function createBaseDuration(): Duration {
151
+ return {
152
+ seconds: BigInt(0),
153
+ nanos: 0
154
+ };
155
+ }
156
+ export const Duration = {
157
+ typeUrl: "/google.protobuf.Duration",
158
+ is(o: any): o is Duration {
159
+ return o && (o.$typeUrl === Duration.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number");
160
+ },
161
+ isAmino(o: any): o is DurationAmino {
162
+ return o && (o.$typeUrl === Duration.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number");
163
+ },
164
+ encode(message: Duration, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
165
+ if (message.seconds !== BigInt(0)) {
166
+ writer.uint32(8).int64(message.seconds);
167
+ }
168
+ if (message.nanos !== 0) {
169
+ writer.uint32(16).int32(message.nanos);
170
+ }
171
+ return writer;
172
+ },
173
+ decode(input: BinaryReader | Uint8Array, length?: number): Duration {
174
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
175
+ let end = length === undefined ? reader.len : reader.pos + length;
176
+ const message = createBaseDuration();
177
+ while (reader.pos < end) {
178
+ const tag = reader.uint32();
179
+ switch (tag >>> 3) {
180
+ case 1:
181
+ message.seconds = reader.int64();
182
+ break;
183
+ case 2:
184
+ message.nanos = reader.int32();
185
+ break;
186
+ default:
187
+ reader.skipType(tag & 7);
188
+ break;
189
+ }
190
+ }
191
+ return message;
192
+ },
193
+ fromPartial(object: DeepPartial<Duration>): Duration {
194
+ const message = createBaseDuration();
195
+ message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0);
196
+ message.nanos = object.nanos ?? 0;
197
+ return message;
198
+ },
199
+ fromAmino(object: DurationAmino): Duration {
200
+ const value = BigInt(object);
201
+ return {
202
+ seconds: value / BigInt("1000000000"),
203
+ nanos: Number(value % BigInt("1000000000"))
204
+ };
205
+ },
206
+ toAmino(message: Duration): DurationAmino {
207
+ return (message.seconds * BigInt("1000000000") + BigInt(message.nanos)).toString();
208
+ },
209
+ fromAminoMsg(object: DurationAminoMsg): Duration {
210
+ return Duration.fromAmino(object.value);
211
+ },
212
+ fromProtoMsg(message: DurationProtoMsg): Duration {
213
+ return Duration.decode(message.value);
214
+ },
215
+ toProto(message: Duration): Uint8Array {
216
+ return Duration.encode(message).finish();
217
+ },
218
+ toProtoMsg(message: Duration): DurationProtoMsg {
219
+ return {
220
+ typeUrl: "/google.protobuf.Duration",
221
+ value: Duration.encode(message).finish()
222
+ };
223
+ }
224
+ };
225
+ GlobalDecoderRegistry.register(Duration.typeUrl, Duration);
@@ -0,0 +1,281 @@
1
+ import { BinaryReader, BinaryWriter } from "../../binary";
2
+ import { DeepPartial, fromJsonTimestamp, fromTimestamp } from "../../helpers";
3
+ import { GlobalDecoderRegistry } from "../../registry";
4
+ /**
5
+ * A Timestamp represents a point in time independent of any time zone or local
6
+ * calendar, encoded as a count of seconds and fractions of seconds at
7
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
8
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
9
+ * Gregorian calendar backwards to year one.
10
+ *
11
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
12
+ * second table is needed for interpretation, using a [24-hour linear
13
+ * smear](https://developers.google.com/time/smear).
14
+ *
15
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
16
+ * restricting to that range, we ensure that we can convert to and from [RFC
17
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
18
+ *
19
+ * # Examples
20
+ *
21
+ * Example 1: Compute Timestamp from POSIX `time()`.
22
+ *
23
+ * Timestamp timestamp;
24
+ * timestamp.set_seconds(time(NULL));
25
+ * timestamp.set_nanos(0);
26
+ *
27
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
28
+ *
29
+ * struct timeval tv;
30
+ * gettimeofday(&tv, NULL);
31
+ *
32
+ * Timestamp timestamp;
33
+ * timestamp.set_seconds(tv.tv_sec);
34
+ * timestamp.set_nanos(tv.tv_usec * 1000);
35
+ *
36
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
37
+ *
38
+ * FILETIME ft;
39
+ * GetSystemTimeAsFileTime(&ft);
40
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
41
+ *
42
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
43
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
44
+ * Timestamp timestamp;
45
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
46
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
47
+ *
48
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
49
+ *
50
+ * long millis = System.currentTimeMillis();
51
+ *
52
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
53
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
54
+ *
55
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
56
+ *
57
+ * Instant now = Instant.now();
58
+ *
59
+ * Timestamp timestamp =
60
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
61
+ * .setNanos(now.getNano()).build();
62
+ *
63
+ * Example 6: Compute Timestamp from current time in Python.
64
+ *
65
+ * timestamp = Timestamp()
66
+ * timestamp.GetCurrentTime()
67
+ *
68
+ * # JSON Mapping
69
+ *
70
+ * In JSON format, the Timestamp type is encoded as a string in the
71
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
72
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
73
+ * where {year} is always expressed using four digits while {month}, {day},
74
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
75
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
76
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
77
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
78
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
79
+ * able to accept both UTC and other timezones (as indicated by an offset).
80
+ *
81
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
82
+ * 01:30 UTC on January 15, 2017.
83
+ *
84
+ * In JavaScript, one can convert a Date object to this format using the
85
+ * standard
86
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
87
+ * method. In Python, a standard `datetime.datetime` object can be converted
88
+ * to this format using
89
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
90
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
91
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
92
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
93
+ * ) to obtain a formatter capable of generating timestamps in this format.
94
+ */
95
+ export interface Timestamp {
96
+ /**
97
+ * Represents seconds of UTC time since Unix epoch
98
+ * 1970-01-01T00:00:00Z. Must be from 0001-01-01T00:00:00Z to
99
+ * 9999-12-31T23:59:59Z inclusive.
100
+ */
101
+ seconds: bigint;
102
+ /**
103
+ * Non-negative fractions of a second at nanosecond resolution. Negative
104
+ * second values with fractions must still have non-negative nanos values
105
+ * that count forward in time. Must be from 0 to 999,999,999
106
+ * inclusive.
107
+ */
108
+ nanos: number;
109
+ }
110
+ export interface TimestampProtoMsg {
111
+ typeUrl: "/google.protobuf.Timestamp";
112
+ value: Uint8Array;
113
+ }
114
+ /**
115
+ * A Timestamp represents a point in time independent of any time zone or local
116
+ * calendar, encoded as a count of seconds and fractions of seconds at
117
+ * nanosecond resolution. The count is relative to an epoch at UTC midnight on
118
+ * January 1, 1970, in the proleptic Gregorian calendar which extends the
119
+ * Gregorian calendar backwards to year one.
120
+ *
121
+ * All minutes are 60 seconds long. Leap seconds are "smeared" so that no leap
122
+ * second table is needed for interpretation, using a [24-hour linear
123
+ * smear](https://developers.google.com/time/smear).
124
+ *
125
+ * The range is from 0001-01-01T00:00:00Z to 9999-12-31T23:59:59.999999999Z. By
126
+ * restricting to that range, we ensure that we can convert to and from [RFC
127
+ * 3339](https://www.ietf.org/rfc/rfc3339.txt) date strings.
128
+ *
129
+ * # Examples
130
+ *
131
+ * Example 1: Compute Timestamp from POSIX `time()`.
132
+ *
133
+ * Timestamp timestamp;
134
+ * timestamp.set_seconds(time(NULL));
135
+ * timestamp.set_nanos(0);
136
+ *
137
+ * Example 2: Compute Timestamp from POSIX `gettimeofday()`.
138
+ *
139
+ * struct timeval tv;
140
+ * gettimeofday(&tv, NULL);
141
+ *
142
+ * Timestamp timestamp;
143
+ * timestamp.set_seconds(tv.tv_sec);
144
+ * timestamp.set_nanos(tv.tv_usec * 1000);
145
+ *
146
+ * Example 3: Compute Timestamp from Win32 `GetSystemTimeAsFileTime()`.
147
+ *
148
+ * FILETIME ft;
149
+ * GetSystemTimeAsFileTime(&ft);
150
+ * UINT64 ticks = (((UINT64)ft.dwHighDateTime) << 32) | ft.dwLowDateTime;
151
+ *
152
+ * // A Windows tick is 100 nanoseconds. Windows epoch 1601-01-01T00:00:00Z
153
+ * // is 11644473600 seconds before Unix epoch 1970-01-01T00:00:00Z.
154
+ * Timestamp timestamp;
155
+ * timestamp.set_seconds((INT64) ((ticks / 10000000) - 11644473600LL));
156
+ * timestamp.set_nanos((INT32) ((ticks % 10000000) * 100));
157
+ *
158
+ * Example 4: Compute Timestamp from Java `System.currentTimeMillis()`.
159
+ *
160
+ * long millis = System.currentTimeMillis();
161
+ *
162
+ * Timestamp timestamp = Timestamp.newBuilder().setSeconds(millis / 1000)
163
+ * .setNanos((int) ((millis % 1000) * 1000000)).build();
164
+ *
165
+ * Example 5: Compute Timestamp from Java `Instant.now()`.
166
+ *
167
+ * Instant now = Instant.now();
168
+ *
169
+ * Timestamp timestamp =
170
+ * Timestamp.newBuilder().setSeconds(now.getEpochSecond())
171
+ * .setNanos(now.getNano()).build();
172
+ *
173
+ * Example 6: Compute Timestamp from current time in Python.
174
+ *
175
+ * timestamp = Timestamp()
176
+ * timestamp.GetCurrentTime()
177
+ *
178
+ * # JSON Mapping
179
+ *
180
+ * In JSON format, the Timestamp type is encoded as a string in the
181
+ * [RFC 3339](https://www.ietf.org/rfc/rfc3339.txt) format. That is, the
182
+ * format is "{year}-{month}-{day}T{hour}:{min}:{sec}[.{frac_sec}]Z"
183
+ * where {year} is always expressed using four digits while {month}, {day},
184
+ * {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
185
+ * seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
186
+ * are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
187
+ * is required. A proto3 JSON serializer should always use UTC (as indicated by
188
+ * "Z") when printing the Timestamp type and a proto3 JSON parser should be
189
+ * able to accept both UTC and other timezones (as indicated by an offset).
190
+ *
191
+ * For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
192
+ * 01:30 UTC on January 15, 2017.
193
+ *
194
+ * In JavaScript, one can convert a Date object to this format using the
195
+ * standard
196
+ * [toISOString()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/toISOString)
197
+ * method. In Python, a standard `datetime.datetime` object can be converted
198
+ * to this format using
199
+ * [`strftime`](https://docs.python.org/2/library/time.html#time.strftime) with
200
+ * the time format spec '%Y-%m-%dT%H:%M:%S.%fZ'. Likewise, in Java, one can use
201
+ * the Joda Time's [`ISODateTimeFormat.dateTime()`](
202
+ * http://joda-time.sourceforge.net/apidocs/org/joda/time/format/ISODateTimeFormat.html#dateTime()
203
+ * ) to obtain a formatter capable of generating timestamps in this format.
204
+ */
205
+ export type TimestampAmino = string;
206
+ export interface TimestampAminoMsg {
207
+ type: "/google.protobuf.Timestamp";
208
+ value: TimestampAmino;
209
+ }
210
+ function createBaseTimestamp(): Timestamp {
211
+ return {
212
+ seconds: BigInt(0),
213
+ nanos: 0
214
+ };
215
+ }
216
+ export const Timestamp = {
217
+ typeUrl: "/google.protobuf.Timestamp",
218
+ is(o: any): o is Timestamp {
219
+ return o && (o.$typeUrl === Timestamp.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number");
220
+ },
221
+ isAmino(o: any): o is TimestampAmino {
222
+ return o && (o.$typeUrl === Timestamp.typeUrl || typeof o.seconds === "bigint" && typeof o.nanos === "number");
223
+ },
224
+ encode(message: Timestamp, writer: BinaryWriter = BinaryWriter.create()): BinaryWriter {
225
+ if (message.seconds !== BigInt(0)) {
226
+ writer.uint32(8).int64(message.seconds);
227
+ }
228
+ if (message.nanos !== 0) {
229
+ writer.uint32(16).int32(message.nanos);
230
+ }
231
+ return writer;
232
+ },
233
+ decode(input: BinaryReader | Uint8Array, length?: number): Timestamp {
234
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
235
+ let end = length === undefined ? reader.len : reader.pos + length;
236
+ const message = createBaseTimestamp();
237
+ while (reader.pos < end) {
238
+ const tag = reader.uint32();
239
+ switch (tag >>> 3) {
240
+ case 1:
241
+ message.seconds = reader.int64();
242
+ break;
243
+ case 2:
244
+ message.nanos = reader.int32();
245
+ break;
246
+ default:
247
+ reader.skipType(tag & 7);
248
+ break;
249
+ }
250
+ }
251
+ return message;
252
+ },
253
+ fromPartial(object: DeepPartial<Timestamp>): Timestamp {
254
+ const message = createBaseTimestamp();
255
+ message.seconds = object.seconds !== undefined && object.seconds !== null ? BigInt(object.seconds.toString()) : BigInt(0);
256
+ message.nanos = object.nanos ?? 0;
257
+ return message;
258
+ },
259
+ fromAmino(object: TimestampAmino): Timestamp {
260
+ return fromJsonTimestamp(object);
261
+ },
262
+ toAmino(message: Timestamp): TimestampAmino {
263
+ return fromTimestamp(message).toISOString().replace(/\.\d+Z$/, "Z");
264
+ },
265
+ fromAminoMsg(object: TimestampAminoMsg): Timestamp {
266
+ return Timestamp.fromAmino(object.value);
267
+ },
268
+ fromProtoMsg(message: TimestampProtoMsg): Timestamp {
269
+ return Timestamp.decode(message.value);
270
+ },
271
+ toProto(message: Timestamp): Uint8Array {
272
+ return Timestamp.encode(message).finish();
273
+ },
274
+ toProtoMsg(message: Timestamp): TimestampProtoMsg {
275
+ return {
276
+ typeUrl: "/google.protobuf.Timestamp",
277
+ value: Timestamp.encode(message).finish()
278
+ };
279
+ }
280
+ };
281
+ GlobalDecoderRegistry.register(Timestamp.typeUrl, Timestamp);
@@ -0,0 +1,191 @@
1
+ /**
2
+ * This file and any referenced files were automatically generated by @cosmology/telescope@1.11.3
3
+ * DO NOT MODIFY BY HAND. Instead, download the latest proto files for your chain
4
+ * and run the transpile command or npm scripts command that is used to regenerate this bundle.
5
+ */
6
+
7
+
8
+ import { HttpEndpoint } from "@interchainjs/types";
9
+ import { BinaryReader, BinaryWriter } from "./binary";
10
+ import { getRpcClient } from "./extern";
11
+ import { isRpc, Rpc } from "./helpers";
12
+
13
+ export interface QueryBuilderOptions<TReq, TRes> {
14
+ encode: (request: TReq, writer?: BinaryWriter) => BinaryWriter
15
+ decode: (input: BinaryReader | Uint8Array, length?: number) => TRes
16
+ service: string,
17
+ method: string,
18
+ clientResolver?: RpcResolver
19
+ }
20
+
21
+ export function buildQuery<TReq, TRes>(opts: QueryBuilderOptions<TReq, TRes>) {
22
+ return async (request: TReq) => {
23
+ let rpc: Rpc | undefined;
24
+
25
+ if(isRpc(opts.clientResolver)) {
26
+ rpc = opts.clientResolver;
27
+ } else {
28
+ rpc = opts.clientResolver ? await getRpcClient(opts.clientResolver) : undefined;
29
+ }
30
+
31
+ if (!rpc) throw new Error("Query Rpc is not initialized");
32
+
33
+ const data = opts.encode(request).finish();
34
+ const response = await rpc.request(opts.service, opts.method, data);
35
+ return opts.decode(response);
36
+ };
37
+ }
38
+
39
+ export interface ITxArgs<TMsg> {
40
+ signerAddress: string;
41
+ message: TMsg;
42
+ fee: StdFee | 'auto';
43
+ memo: string;
44
+ }
45
+
46
+ export function isISigningClient(client: unknown): client is ISigningClient {
47
+ return client !== null && client !== undefined
48
+ && typeof (client as ISigningClient).signAndBroadcast === 'function'
49
+ && typeof (client as ISigningClient).addConverters === 'function'
50
+ && typeof (client as ISigningClient).addEncoders === 'function';
51
+ }
52
+
53
+ export interface ISigningClient {
54
+ /**
55
+ * register converters
56
+ */
57
+ addConverters: (converters: AminoConverter[]) => void;
58
+ /**
59
+ * register encoders
60
+ */
61
+ addEncoders: (encoders: Encoder[]) => void;
62
+
63
+ signAndBroadcast: (
64
+ signerAddress: string,
65
+ message: Message[],
66
+ fee: StdFee | 'auto',
67
+ memo: string
68
+ ) => Promise<DeliverTxResponse>;
69
+ }
70
+
71
+ export interface TxBuilderOptions {
72
+ clientResolver?: SigningClientResolver,
73
+ typeUrl: string,
74
+ encoders?: Encoder[],
75
+ converters?: AminoConverter[],
76
+ }
77
+
78
+ export function buildTx<TMsg>(opts: TxBuilderOptions) {
79
+ return async (
80
+ signerAddress: string,
81
+ message: TMsg,
82
+ fee: StdFee | 'auto',
83
+ memo: string
84
+ ): Promise<DeliverTxResponse> => {
85
+ let client: ISigningClient | undefined;
86
+
87
+ // if opts.getSigningClient is a function, call it to get the SigningClient instance
88
+ if(isISigningClient(opts.clientResolver)) {
89
+ client = opts.clientResolver;
90
+ }
91
+
92
+ if (!client) throw new Error("SigningClient is not initialized");
93
+
94
+ //register all related encoders and converters
95
+ client.addEncoders(opts.encoders ?? []);
96
+ client.addConverters(opts.converters ?? []);
97
+
98
+ const data = [
99
+ {
100
+ typeUrl: opts.typeUrl,
101
+ value: message,
102
+ },
103
+ ];
104
+ return client.signAndBroadcast!(signerAddress, data, fee, memo);
105
+ };
106
+ }
107
+
108
+ export interface Coin {
109
+ denom: string;
110
+ amount: string;
111
+ }
112
+
113
+ export interface StdFee {
114
+ amount: Coin[];
115
+ gas: string;
116
+ /** The granter address that is used for paying with feegrants */
117
+ granter?: string;
118
+ /** The fee payer address. The payer must have signed the transaction. */
119
+ payer?: string;
120
+ }
121
+
122
+ /**
123
+ * The response after successfully broadcasting a transaction.
124
+ * Success or failure refer to the execution result.
125
+ */
126
+ export interface DeliverTxResponse {
127
+ height: number;
128
+ /** The position of the transaction within the block. This is a 0-based index. */
129
+ txIndex: number;
130
+ /** Error code. The transaction suceeded if and only if code is 0. */
131
+ code: number;
132
+ transactionHash: string;
133
+ events: Event[];
134
+ /**
135
+ * A string-based log document.
136
+ *
137
+ * This currently seems to merge attributes of multiple events into one event per type
138
+ * (https://github.com/tendermint/tendermint/issues/9595). You might want to use the `events`
139
+ * field instead.
140
+ */
141
+ rawLog?: string;
142
+ /** @deprecated Use `msgResponses` instead. */
143
+ data?: MsgData[];
144
+ /**
145
+ * The message responses of the [TxMsgData](https://github.com/cosmos/cosmos-sdk/blob/v0.46.3/proto/cosmos/base/abci/v1beta1/abci.proto#L128-L140)
146
+ * as `Any`s.
147
+ * This field is an empty list for chains running Cosmos SDK < 0.46.
148
+ */
149
+ msgResponses: Array<{
150
+ typeUrl: string;
151
+ value: Uint8Array;
152
+ }>;
153
+ gasUsed: bigint;
154
+ gasWanted: bigint;
155
+ }
156
+
157
+ export interface MsgData {
158
+ msgType: string;
159
+ data: Uint8Array;
160
+ }
161
+
162
+ export interface Attribute {
163
+ key: string;
164
+ value: string;
165
+ index: boolean;
166
+ }
167
+ export interface Event {
168
+ type: string;
169
+ attributes: Attribute[];
170
+ }
171
+
172
+ export interface Message<T = any> {
173
+ typeUrl: string;
174
+ value: T;
175
+ }
176
+
177
+ export interface Encoder {
178
+ typeUrl: string;
179
+ fromPartial: (data: any) => any;
180
+ encode: (data: any) => Uint8Array;
181
+ }
182
+
183
+ export interface AminoConverter {
184
+ typeUrl: string;
185
+ aminoType: string;
186
+ fromAmino: (data: any) => any;
187
+ toAmino: (data: any) => any;
188
+ }
189
+
190
+ export type SigningClientResolver = string | HttpEndpoint | ISigningClient;
191
+ export type RpcResolver = string | HttpEndpoint | Rpc ;