@uswap/toolboxes 4.3.6

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 (275) hide show
  1. package/dist/src/cardano/index.cjs +4 -0
  2. package/dist/src/cardano/index.cjs.map +11 -0
  3. package/dist/src/cardano/index.js +4 -0
  4. package/dist/src/cardano/index.js.map +11 -0
  5. package/dist/src/cosmos/index.cjs +4 -0
  6. package/dist/src/cosmos/index.cjs.map +20 -0
  7. package/dist/src/cosmos/index.js +4 -0
  8. package/dist/src/cosmos/index.js.map +20 -0
  9. package/dist/src/evm/index.cjs +4 -0
  10. package/dist/src/evm/index.cjs.map +20 -0
  11. package/dist/src/evm/index.js +4 -0
  12. package/dist/src/evm/index.js.map +20 -0
  13. package/dist/src/index.cjs +5 -0
  14. package/dist/src/index.cjs.map +67 -0
  15. package/dist/src/index.js +5 -0
  16. package/dist/src/index.js.map +67 -0
  17. package/dist/src/near/index.cjs +4 -0
  18. package/dist/src/near/index.cjs.map +16 -0
  19. package/dist/src/near/index.js +4 -0
  20. package/dist/src/near/index.js.map +16 -0
  21. package/dist/src/radix/index.cjs +4 -0
  22. package/dist/src/radix/index.cjs.map +10 -0
  23. package/dist/src/radix/index.js +4 -0
  24. package/dist/src/radix/index.js.map +10 -0
  25. package/dist/src/ripple/index.cjs +4 -0
  26. package/dist/src/ripple/index.cjs.map +10 -0
  27. package/dist/src/ripple/index.js +4 -0
  28. package/dist/src/ripple/index.js.map +10 -0
  29. package/dist/src/solana/index.cjs +4 -0
  30. package/dist/src/solana/index.cjs.map +11 -0
  31. package/dist/src/solana/index.js +4 -0
  32. package/dist/src/solana/index.js.map +11 -0
  33. package/dist/src/substrate/index.cjs +4 -0
  34. package/dist/src/substrate/index.cjs.map +13 -0
  35. package/dist/src/substrate/index.js +4 -0
  36. package/dist/src/substrate/index.js.map +13 -0
  37. package/dist/src/sui/index.cjs +4 -0
  38. package/dist/src/sui/index.cjs.map +11 -0
  39. package/dist/src/sui/index.js +4 -0
  40. package/dist/src/sui/index.js.map +11 -0
  41. package/dist/src/ton/index.cjs +4 -0
  42. package/dist/src/ton/index.cjs.map +11 -0
  43. package/dist/src/ton/index.js +4 -0
  44. package/dist/src/ton/index.js.map +11 -0
  45. package/dist/src/tron/index.cjs +4 -0
  46. package/dist/src/tron/index.cjs.map +13 -0
  47. package/dist/src/tron/index.js +4 -0
  48. package/dist/src/tron/index.js.map +13 -0
  49. package/dist/src/utxo/index.cjs +5 -0
  50. package/dist/src/utxo/index.cjs.map +21 -0
  51. package/dist/src/utxo/index.js +5 -0
  52. package/dist/src/utxo/index.js.map +21 -0
  53. package/dist/types/cardano/index.d.ts +3 -0
  54. package/dist/types/cardano/index.d.ts.map +1 -0
  55. package/dist/types/cardano/toolbox.d.ts +34 -0
  56. package/dist/types/cardano/toolbox.d.ts.map +1 -0
  57. package/dist/types/cardano/types.d.ts +11 -0
  58. package/dist/types/cardano/types.d.ts.map +1 -0
  59. package/dist/types/cosmos/index.d.ts +5 -0
  60. package/dist/types/cosmos/index.d.ts.map +1 -0
  61. package/dist/types/cosmos/thorchainUtils/addressFormat.d.ts +5 -0
  62. package/dist/types/cosmos/thorchainUtils/addressFormat.d.ts.map +1 -0
  63. package/dist/types/cosmos/thorchainUtils/index.d.ts +5 -0
  64. package/dist/types/cosmos/thorchainUtils/index.d.ts.map +1 -0
  65. package/dist/types/cosmos/thorchainUtils/messages.d.ts +208 -0
  66. package/dist/types/cosmos/thorchainUtils/messages.d.ts.map +1 -0
  67. package/dist/types/cosmos/thorchainUtils/registry.d.ts +4 -0
  68. package/dist/types/cosmos/thorchainUtils/registry.d.ts.map +1 -0
  69. package/dist/types/cosmos/thorchainUtils/types/MsgCompiled.d.ts +2 -0
  70. package/dist/types/cosmos/thorchainUtils/types/MsgCompiled.d.ts.map +1 -0
  71. package/dist/types/cosmos/thorchainUtils/types/client-types.d.ts +63 -0
  72. package/dist/types/cosmos/thorchainUtils/types/client-types.d.ts.map +1 -0
  73. package/dist/types/cosmos/thorchainUtils/types/index.d.ts +2 -0
  74. package/dist/types/cosmos/thorchainUtils/types/index.d.ts.map +1 -0
  75. package/dist/types/cosmos/toolbox/cosmos.d.ts +62 -0
  76. package/dist/types/cosmos/toolbox/cosmos.d.ts.map +1 -0
  77. package/dist/types/cosmos/toolbox/index.d.ts +15 -0
  78. package/dist/types/cosmos/toolbox/index.d.ts.map +1 -0
  79. package/dist/types/cosmos/toolbox/thorchain.d.ts +158 -0
  80. package/dist/types/cosmos/toolbox/thorchain.d.ts.map +1 -0
  81. package/dist/types/cosmos/types.d.ts +49 -0
  82. package/dist/types/cosmos/types.d.ts.map +1 -0
  83. package/dist/types/cosmos/util.d.ts +74 -0
  84. package/dist/types/cosmos/util.d.ts.map +1 -0
  85. package/dist/types/evm/api.d.ts +8 -0
  86. package/dist/types/evm/api.d.ts.map +1 -0
  87. package/dist/types/evm/contracts/eth/multicall.d.ts +36 -0
  88. package/dist/types/evm/contracts/eth/multicall.d.ts.map +1 -0
  89. package/dist/types/evm/contracts/op/gasOracle.d.ts +40 -0
  90. package/dist/types/evm/contracts/op/gasOracle.d.ts.map +1 -0
  91. package/dist/types/evm/helpers.d.ts +6 -0
  92. package/dist/types/evm/helpers.d.ts.map +1 -0
  93. package/dist/types/evm/index.d.ts +5 -0
  94. package/dist/types/evm/index.d.ts.map +1 -0
  95. package/dist/types/evm/toolbox/baseEVMToolbox.d.ts +83 -0
  96. package/dist/types/evm/toolbox/baseEVMToolbox.d.ts.map +1 -0
  97. package/dist/types/evm/toolbox/evm.d.ts +767 -0
  98. package/dist/types/evm/toolbox/evm.d.ts.map +1 -0
  99. package/dist/types/evm/toolbox/index.d.ts +7 -0
  100. package/dist/types/evm/toolbox/index.d.ts.map +1 -0
  101. package/dist/types/evm/toolbox/op.d.ts +76 -0
  102. package/dist/types/evm/toolbox/op.d.ts.map +1 -0
  103. package/dist/types/evm/types.d.ts +108 -0
  104. package/dist/types/evm/types.d.ts.map +1 -0
  105. package/dist/types/index.d.ts +75 -0
  106. package/dist/types/index.d.ts.map +1 -0
  107. package/dist/types/near/helpers/core.d.ts +15 -0
  108. package/dist/types/near/helpers/core.d.ts.map +1 -0
  109. package/dist/types/near/helpers/gasEstimation.d.ts +41 -0
  110. package/dist/types/near/helpers/gasEstimation.d.ts.map +1 -0
  111. package/dist/types/near/helpers/nep141.d.ts +36 -0
  112. package/dist/types/near/helpers/nep141.d.ts.map +1 -0
  113. package/dist/types/near/index.d.ts +10 -0
  114. package/dist/types/near/index.d.ts.map +1 -0
  115. package/dist/types/near/toolbox.d.ts +32 -0
  116. package/dist/types/near/toolbox.d.ts.map +1 -0
  117. package/dist/types/near/types/contract.d.ts +38 -0
  118. package/dist/types/near/types/contract.d.ts.map +1 -0
  119. package/dist/types/near/types/nep141.d.ts +29 -0
  120. package/dist/types/near/types/nep141.d.ts.map +1 -0
  121. package/dist/types/near/types/toolbox.d.ts +51 -0
  122. package/dist/types/near/types/toolbox.d.ts.map +1 -0
  123. package/dist/types/near/types.d.ts +47 -0
  124. package/dist/types/near/types.d.ts.map +1 -0
  125. package/dist/types/radix/index.d.ts +14 -0
  126. package/dist/types/radix/index.d.ts.map +1 -0
  127. package/dist/types/ripple/index.d.ts +46 -0
  128. package/dist/types/ripple/index.d.ts.map +1 -0
  129. package/dist/types/solana/index.d.ts +23 -0
  130. package/dist/types/solana/index.d.ts.map +1 -0
  131. package/dist/types/solana/toolbox.d.ts +51 -0
  132. package/dist/types/solana/toolbox.d.ts.map +1 -0
  133. package/dist/types/substrate/balance.d.ts +17 -0
  134. package/dist/types/substrate/balance.d.ts.map +1 -0
  135. package/dist/types/substrate/index.d.ts +3 -0
  136. package/dist/types/substrate/index.d.ts.map +1 -0
  137. package/dist/types/substrate/substrate.d.ts +148 -0
  138. package/dist/types/substrate/substrate.d.ts.map +1 -0
  139. package/dist/types/substrate/types.d.ts +100 -0
  140. package/dist/types/substrate/types.d.ts.map +1 -0
  141. package/dist/types/sui/index.d.ts +3 -0
  142. package/dist/types/sui/index.d.ts.map +1 -0
  143. package/dist/types/sui/toolbox.d.ts +19 -0
  144. package/dist/types/sui/toolbox.d.ts.map +1 -0
  145. package/dist/types/sui/types.d.ts +16 -0
  146. package/dist/types/sui/types.d.ts.map +1 -0
  147. package/dist/types/ton/index.d.ts +3 -0
  148. package/dist/types/ton/index.d.ts.map +1 -0
  149. package/dist/types/ton/toolbox.d.ts +14 -0
  150. package/dist/types/ton/toolbox.d.ts.map +1 -0
  151. package/dist/types/ton/types.d.ts +22 -0
  152. package/dist/types/ton/types.d.ts.map +1 -0
  153. package/dist/types/tron/helpers/trc20.abi.d.ts +156 -0
  154. package/dist/types/tron/helpers/trc20.abi.d.ts.map +1 -0
  155. package/dist/types/tron/helpers/trongrid.d.ts +8 -0
  156. package/dist/types/tron/helpers/trongrid.d.ts.map +1 -0
  157. package/dist/types/tron/index.d.ts +6 -0
  158. package/dist/types/tron/index.d.ts.map +1 -0
  159. package/dist/types/tron/toolbox.d.ts +26 -0
  160. package/dist/types/tron/toolbox.d.ts.map +1 -0
  161. package/dist/types/tron/types.d.ts +103 -0
  162. package/dist/types/tron/types.d.ts.map +1 -0
  163. package/dist/types/types.d.ts +26 -0
  164. package/dist/types/types.d.ts.map +1 -0
  165. package/dist/types/utils.d.ts +4 -0
  166. package/dist/types/utils.d.ts.map +1 -0
  167. package/dist/types/utxo/helpers/api.d.ts +101 -0
  168. package/dist/types/utxo/helpers/api.d.ts.map +1 -0
  169. package/dist/types/utxo/helpers/bchaddrjs.d.ts +10 -0
  170. package/dist/types/utxo/helpers/bchaddrjs.d.ts.map +1 -0
  171. package/dist/types/utxo/helpers/coinselect.d.ts +17 -0
  172. package/dist/types/utxo/helpers/coinselect.d.ts.map +1 -0
  173. package/dist/types/utxo/helpers/index.d.ts +5 -0
  174. package/dist/types/utxo/helpers/index.d.ts.map +1 -0
  175. package/dist/types/utxo/helpers/txSize.d.ts +21 -0
  176. package/dist/types/utxo/helpers/txSize.d.ts.map +1 -0
  177. package/dist/types/utxo/index.d.ts +7 -0
  178. package/dist/types/utxo/index.d.ts.map +1 -0
  179. package/dist/types/utxo/toolbox/bitcoinCash.d.ts +93 -0
  180. package/dist/types/utxo/toolbox/bitcoinCash.d.ts.map +1 -0
  181. package/dist/types/utxo/toolbox/index.d.ts +28 -0
  182. package/dist/types/utxo/toolbox/index.d.ts.map +1 -0
  183. package/dist/types/utxo/toolbox/params.d.ts +32 -0
  184. package/dist/types/utxo/toolbox/params.d.ts.map +1 -0
  185. package/dist/types/utxo/toolbox/utxo.d.ts +103 -0
  186. package/dist/types/utxo/toolbox/utxo.d.ts.map +1 -0
  187. package/dist/types/utxo/toolbox/validators.d.ts +4 -0
  188. package/dist/types/utxo/toolbox/validators.d.ts.map +1 -0
  189. package/dist/types/utxo/toolbox/zcash.d.ts +72 -0
  190. package/dist/types/utxo/toolbox/zcash.d.ts.map +1 -0
  191. package/dist/types/utxo/types.d.ts +46 -0
  192. package/dist/types/utxo/types.d.ts.map +1 -0
  193. package/package.json +205 -0
  194. package/src/__tests__/address-validation-all-chains.test.ts +162 -0
  195. package/src/__tests__/addressValidator.test.ts +162 -0
  196. package/src/cardano/__tests__/toolbox.test.ts +48 -0
  197. package/src/cardano/index.ts +2 -0
  198. package/src/cardano/toolbox.ts +168 -0
  199. package/src/cardano/types.ts +10 -0
  200. package/src/cosmos/__tests__/toolbox.test.ts +91 -0
  201. package/src/cosmos/index.ts +4 -0
  202. package/src/cosmos/thorchainUtils/addressFormat.ts +22 -0
  203. package/src/cosmos/thorchainUtils/index.ts +4 -0
  204. package/src/cosmos/thorchainUtils/messages.ts +212 -0
  205. package/src/cosmos/thorchainUtils/registry.ts +43 -0
  206. package/src/cosmos/thorchainUtils/types/MsgCompiled.ts +2800 -0
  207. package/src/cosmos/thorchainUtils/types/client-types.ts +54 -0
  208. package/src/cosmos/thorchainUtils/types/index.ts +1 -0
  209. package/src/cosmos/toolbox/cosmos.ts +345 -0
  210. package/src/cosmos/toolbox/index.ts +35 -0
  211. package/src/cosmos/toolbox/thorchain.ts +249 -0
  212. package/src/cosmos/types.ts +48 -0
  213. package/src/cosmos/util.ts +214 -0
  214. package/src/evm/__tests__/address-validation.test.ts +84 -0
  215. package/src/evm/__tests__/ethereum.test.ts +137 -0
  216. package/src/evm/__tests__/signMessage.test.ts +60 -0
  217. package/src/evm/api.ts +10 -0
  218. package/src/evm/contracts/eth/multicall.ts +165 -0
  219. package/src/evm/contracts/op/gasOracle.ts +145 -0
  220. package/src/evm/helpers.ts +73 -0
  221. package/src/evm/index.ts +4 -0
  222. package/src/evm/toolbox/baseEVMToolbox.ts +695 -0
  223. package/src/evm/toolbox/evm.ts +67 -0
  224. package/src/evm/toolbox/index.ts +44 -0
  225. package/src/evm/toolbox/op.ts +156 -0
  226. package/src/evm/types.ts +146 -0
  227. package/src/index.ts +260 -0
  228. package/src/near/__tests__/core.test.ts +70 -0
  229. package/src/near/helpers/core.ts +85 -0
  230. package/src/near/helpers/gasEstimation.ts +96 -0
  231. package/src/near/helpers/nep141.ts +50 -0
  232. package/src/near/index.ts +21 -0
  233. package/src/near/toolbox.ts +421 -0
  234. package/src/near/types/contract.ts +32 -0
  235. package/src/near/types/nep141.ts +34 -0
  236. package/src/near/types/toolbox.ts +55 -0
  237. package/src/near/types.ts +44 -0
  238. package/src/radix/index.ts +132 -0
  239. package/src/ripple/index.ts +179 -0
  240. package/src/solana/index.ts +36 -0
  241. package/src/solana/toolbox.ts +415 -0
  242. package/src/substrate/balance.ts +88 -0
  243. package/src/substrate/index.ts +2 -0
  244. package/src/substrate/substrate.ts +281 -0
  245. package/src/substrate/types.ts +115 -0
  246. package/src/sui/__tests__/toolbox.test.ts +82 -0
  247. package/src/sui/index.ts +2 -0
  248. package/src/sui/toolbox.ts +165 -0
  249. package/src/sui/types.ts +11 -0
  250. package/src/ton/__tests__/toolbox.test.ts +63 -0
  251. package/src/ton/index.ts +2 -0
  252. package/src/ton/toolbox.ts +136 -0
  253. package/src/ton/types.ts +13 -0
  254. package/src/tron/__tests__/toolbox.test.ts +221 -0
  255. package/src/tron/helpers/trc20.abi.ts +107 -0
  256. package/src/tron/helpers/trongrid.ts +53 -0
  257. package/src/tron/index.ts +21 -0
  258. package/src/tron/toolbox.ts +585 -0
  259. package/src/tron/types.ts +83 -0
  260. package/src/types.ts +28 -0
  261. package/src/utils.ts +27 -0
  262. package/src/utxo/__tests__/zcash-integration.test.ts +97 -0
  263. package/src/utxo/helpers/api.ts +471 -0
  264. package/src/utxo/helpers/bchaddrjs.ts +166 -0
  265. package/src/utxo/helpers/coinselect.ts +92 -0
  266. package/src/utxo/helpers/index.ts +4 -0
  267. package/src/utxo/helpers/txSize.ts +137 -0
  268. package/src/utxo/index.ts +6 -0
  269. package/src/utxo/toolbox/bitcoinCash.ts +243 -0
  270. package/src/utxo/toolbox/index.ts +59 -0
  271. package/src/utxo/toolbox/params.ts +18 -0
  272. package/src/utxo/toolbox/utxo.ts +439 -0
  273. package/src/utxo/toolbox/validators.ts +36 -0
  274. package/src/utxo/toolbox/zcash.ts +245 -0
  275. package/src/utxo/types.ts +39 -0
@@ -0,0 +1,2800 @@
1
+ // @ts-nocheck
2
+ import $protobuf from "protobufjs/minimal.js";
3
+
4
+ // Common aliases
5
+ const $Reader = $protobuf.Reader;
6
+ const $Writer = $protobuf.Writer;
7
+ const $util = $protobuf.util;
8
+
9
+ // Exported root namespace
10
+
11
+ export const $root = ($protobuf.roots.default || ($protobuf.roots.default = {})) as any;
12
+
13
+ $root.common = (() => {
14
+ /**
15
+ * Namespace common.
16
+ * @exports common
17
+ * @namespace
18
+ */
19
+ const common = {};
20
+
21
+ common.Asset = (() => {
22
+ /**
23
+ * Properties of an Asset.
24
+ * @memberof common
25
+ * @interface IAsset
26
+ * @property {string|null} [chain] Asset chain
27
+ * @property {string|null} [symbol] Asset symbol
28
+ * @property {string|null} [ticker] Asset ticker
29
+ * @property {boolean|null} [synth] Asset synth
30
+ */
31
+
32
+ /**
33
+ * Constructs a new Asset.
34
+ * @memberof common
35
+ * @classdesc Represents an Asset.
36
+ * @implements IAsset
37
+ * @constructor
38
+ * @param {common.IAsset=} [properties] Properties to set
39
+ */
40
+ function Asset(properties) {
41
+ if (properties)
42
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
43
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
44
+ }
45
+
46
+ /**
47
+ * Asset chain.
48
+ * @member {string} chain
49
+ * @memberof common.Asset
50
+ * @instance
51
+ */
52
+ Asset.prototype.chain = "";
53
+
54
+ /**
55
+ * Asset symbol.
56
+ * @member {string} symbol
57
+ * @memberof common.Asset
58
+ * @instance
59
+ */
60
+ Asset.prototype.symbol = "";
61
+
62
+ /**
63
+ * Asset ticker.
64
+ * @member {string} ticker
65
+ * @memberof common.Asset
66
+ * @instance
67
+ */
68
+ Asset.prototype.ticker = "";
69
+
70
+ /**
71
+ * Asset synth.
72
+ * @member {boolean} synth
73
+ * @memberof common.Asset
74
+ * @instance
75
+ */
76
+ Asset.prototype.synth = false;
77
+
78
+ /**
79
+ * Creates a new Asset instance using the specified properties.
80
+ * @function create
81
+ * @memberof common.Asset
82
+ * @static
83
+ * @param {common.IAsset=} [properties] Properties to set
84
+ * @returns {common.Asset} Asset instance
85
+ */
86
+ Asset.create = function create(properties) {
87
+ return new Asset(properties);
88
+ };
89
+
90
+ /**
91
+ * Encodes the specified Asset message. Does not implicitly {@link common.Asset.verify|verify} messages.
92
+ * @function encode
93
+ * @memberof common.Asset
94
+ * @static
95
+ * @param {common.IAsset} message Asset message or plain object to encode
96
+ * @param {$protobuf.Writer} [writer] Writer to encode to
97
+ * @returns {$protobuf.Writer} Writer
98
+ */
99
+ Asset.encode = function encode(message, writer) {
100
+ if (!writer) writer = $Writer.create();
101
+ if (message.chain != null && Object.hasOwnProperty.call(message, "chain"))
102
+ writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.chain);
103
+ if (message.symbol != null && Object.hasOwnProperty.call(message, "symbol"))
104
+ writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.symbol);
105
+ if (message.ticker != null && Object.hasOwnProperty.call(message, "ticker"))
106
+ writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.ticker);
107
+ if (message.synth != null && Object.hasOwnProperty.call(message, "synth"))
108
+ writer.uint32(/* id 4, wireType 0 =*/ 32).bool(message.synth);
109
+ return writer;
110
+ };
111
+
112
+ /**
113
+ * Encodes the specified Asset message, length delimited. Does not implicitly {@link common.Asset.verify|verify} messages.
114
+ * @function encodeDelimited
115
+ * @memberof common.Asset
116
+ * @static
117
+ * @param {common.IAsset} message Asset message or plain object to encode
118
+ * @param {$protobuf.Writer} [writer] Writer to encode to
119
+ * @returns {$protobuf.Writer} Writer
120
+ */
121
+ Asset.encodeDelimited = function encodeDelimited(message, writer) {
122
+ return this.encode(message, writer).ldelim();
123
+ };
124
+
125
+ /**
126
+ * Decodes an Asset message from the specified reader or buffer.
127
+ * @function decode
128
+ * @memberof common.Asset
129
+ * @static
130
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
131
+ * @param {number} [length] Message length if known beforehand
132
+ * @returns {common.Asset} Asset
133
+ * @throws {Error} If the payload is not a reader or valid buffer
134
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
135
+ */
136
+ Asset.decode = function decode(reader, length) {
137
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
138
+ const end = length === undefined ? reader.len : reader.pos + length,
139
+ message = new $root.common.Asset();
140
+ while (reader.pos < end) {
141
+ const tag = reader.uint32();
142
+ switch (tag >>> 3) {
143
+ case 1:
144
+ message.chain = reader.string();
145
+ break;
146
+ case 2:
147
+ message.symbol = reader.string();
148
+ break;
149
+ case 3:
150
+ message.ticker = reader.string();
151
+ break;
152
+ case 4:
153
+ message.synth = reader.bool();
154
+ break;
155
+ default:
156
+ reader.skipType(tag & 7);
157
+ break;
158
+ }
159
+ }
160
+ return message;
161
+ };
162
+
163
+ /**
164
+ * Decodes an Asset message from the specified reader or buffer, length delimited.
165
+ * @function decodeDelimited
166
+ * @memberof common.Asset
167
+ * @static
168
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
169
+ * @returns {common.Asset} Asset
170
+ * @throws {Error} If the payload is not a reader or valid buffer
171
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
172
+ */
173
+ Asset.decodeDelimited = function decodeDelimited(reader) {
174
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
175
+ return this.decode(reader, reader.uint32());
176
+ };
177
+
178
+ /**
179
+ * Verifies an Asset message.
180
+ * @function verify
181
+ * @memberof common.Asset
182
+ * @static
183
+ * @param {Object.<string,*>} message Plain object to verify
184
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
185
+ */
186
+ Asset.verify = function verify(message) {
187
+ if (typeof message !== "object" || message === null) return "object expected";
188
+ if (message.chain != null && message.hasOwnProperty("chain"))
189
+ if (!$util.isString(message.chain)) return "chain: string expected";
190
+ if (message.symbol != null && message.hasOwnProperty("symbol"))
191
+ if (!$util.isString(message.symbol)) return "symbol: string expected";
192
+ if (message.ticker != null && message.hasOwnProperty("ticker"))
193
+ if (!$util.isString(message.ticker)) return "ticker: string expected";
194
+ if (message.synth != null && message.hasOwnProperty("synth"))
195
+ if (typeof message.synth !== "boolean") return "synth: boolean expected";
196
+ return null;
197
+ };
198
+
199
+ /**
200
+ * Creates an Asset message from a plain object. Also converts values to their respective internal types.
201
+ * @function fromObject
202
+ * @memberof common.Asset
203
+ * @static
204
+ * @param {Object.<string,*>} object Plain object
205
+ * @returns {common.Asset} Asset
206
+ */
207
+ Asset.fromObject = function fromObject(object) {
208
+ if (object instanceof $root.common.Asset) return object;
209
+ const message = new $root.common.Asset();
210
+ if (object.chain != null) message.chain = String(object.chain);
211
+ if (object.symbol != null) message.symbol = String(object.symbol);
212
+ if (object.ticker != null) message.ticker = String(object.ticker);
213
+ if (object.synth != null) message.synth = Boolean(object.synth);
214
+ return message;
215
+ };
216
+
217
+ /**
218
+ * Creates a plain object from an Asset message. Also converts values to other types if specified.
219
+ * @function toObject
220
+ * @memberof common.Asset
221
+ * @static
222
+ * @param {common.Asset} message Asset
223
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
224
+ * @returns {Object.<string,*>} Plain object
225
+ */
226
+ Asset.toObject = function toObject(message, options) {
227
+ if (!options) options = {};
228
+ const object = {};
229
+ if (options.defaults) {
230
+ object.chain = "";
231
+ object.symbol = "";
232
+ object.ticker = "";
233
+ object.synth = false;
234
+ }
235
+ if (message.chain != null && message.hasOwnProperty("chain")) object.chain = message.chain;
236
+ if (message.symbol != null && message.hasOwnProperty("symbol"))
237
+ object.symbol = message.symbol;
238
+ if (message.ticker != null && message.hasOwnProperty("ticker"))
239
+ object.ticker = message.ticker;
240
+ if (message.synth != null && message.hasOwnProperty("synth")) object.synth = message.synth;
241
+ return object;
242
+ };
243
+
244
+ /**
245
+ * Converts this Asset to JSON.
246
+ * @function toJSON
247
+ * @memberof common.Asset
248
+ * @instance
249
+ * @returns {Object.<string,*>} JSON object
250
+ */
251
+ Asset.prototype.toJSON = function toJSON() {
252
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
253
+ };
254
+
255
+ return Asset;
256
+ })();
257
+
258
+ common.Coin = (() => {
259
+ /**
260
+ * Properties of a Coin.
261
+ * @memberof common
262
+ * @interface ICoin
263
+ * @property {common.IAsset|null} [asset] Coin asset
264
+ * @property {string|null} [amount] Coin amount
265
+ * @property {number|Long|null} [decimals] Coin decimals
266
+ */
267
+
268
+ /**
269
+ * Constructs a new Coin.
270
+ * @memberof common
271
+ * @classdesc Represents a Coin.
272
+ * @implements ICoin
273
+ * @constructor
274
+ * @param {common.ICoin=} [properties] Properties to set
275
+ */
276
+ function Coin(properties) {
277
+ if (properties)
278
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
279
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
280
+ }
281
+
282
+ /**
283
+ * Coin asset.
284
+ * @member {common.IAsset|null|undefined} asset
285
+ * @memberof common.Coin
286
+ * @instance
287
+ */
288
+ Coin.prototype.asset = null;
289
+
290
+ /**
291
+ * Coin amount.
292
+ * @member {string} amount
293
+ * @memberof common.Coin
294
+ * @instance
295
+ */
296
+ Coin.prototype.amount = "";
297
+
298
+ /**
299
+ * Coin decimals.
300
+ * @member {number|Long} decimals
301
+ * @memberof common.Coin
302
+ * @instance
303
+ */
304
+ Coin.prototype.decimals = $util.Long ? $util.Long.fromBits(0, 0, false) : 0;
305
+
306
+ /**
307
+ * Creates a new Coin instance using the specified properties.
308
+ * @function create
309
+ * @memberof common.Coin
310
+ * @static
311
+ * @param {common.ICoin=} [properties] Properties to set
312
+ * @returns {common.Coin} Coin instance
313
+ */
314
+ Coin.create = function create(properties) {
315
+ return new Coin(properties);
316
+ };
317
+
318
+ /**
319
+ * Encodes the specified Coin message. Does not implicitly {@link common.Coin.verify|verify} messages.
320
+ * @function encode
321
+ * @memberof common.Coin
322
+ * @static
323
+ * @param {common.ICoin} message Coin message or plain object to encode
324
+ * @param {$protobuf.Writer} [writer] Writer to encode to
325
+ * @returns {$protobuf.Writer} Writer
326
+ */
327
+ Coin.encode = function encode(message, writer) {
328
+ if (!writer) writer = $Writer.create();
329
+ if (message.asset != null && Object.hasOwnProperty.call(message, "asset"))
330
+ $root.common.Asset.encode(
331
+ message.asset,
332
+ writer.uint32(/* id 1, wireType 2 =*/ 10).fork(),
333
+ ).ldelim();
334
+ if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
335
+ writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.amount);
336
+ if (message.decimals != null && Object.hasOwnProperty.call(message, "decimals"))
337
+ writer.uint32(/* id 3, wireType 0 =*/ 24).int64(message.decimals);
338
+ return writer;
339
+ };
340
+
341
+ /**
342
+ * Encodes the specified Coin message, length delimited. Does not implicitly {@link common.Coin.verify|verify} messages.
343
+ * @function encodeDelimited
344
+ * @memberof common.Coin
345
+ * @static
346
+ * @param {common.ICoin} message Coin message or plain object to encode
347
+ * @param {$protobuf.Writer} [writer] Writer to encode to
348
+ * @returns {$protobuf.Writer} Writer
349
+ */
350
+ Coin.encodeDelimited = function encodeDelimited(message, writer) {
351
+ return this.encode(message, writer).ldelim();
352
+ };
353
+
354
+ /**
355
+ * Decodes a Coin message from the specified reader or buffer.
356
+ * @function decode
357
+ * @memberof common.Coin
358
+ * @static
359
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
360
+ * @param {number} [length] Message length if known beforehand
361
+ * @returns {common.Coin} Coin
362
+ * @throws {Error} If the payload is not a reader or valid buffer
363
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
364
+ */
365
+ Coin.decode = function decode(reader, length) {
366
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
367
+ const end = length === undefined ? reader.len : reader.pos + length,
368
+ message = new $root.common.Coin();
369
+ while (reader.pos < end) {
370
+ const tag = reader.uint32();
371
+ switch (tag >>> 3) {
372
+ case 1:
373
+ message.asset = $root.common.Asset.decode(reader, reader.uint32());
374
+ break;
375
+ case 2:
376
+ message.amount = reader.string();
377
+ break;
378
+ case 3:
379
+ message.decimals = reader.int64();
380
+ break;
381
+ default:
382
+ reader.skipType(tag & 7);
383
+ break;
384
+ }
385
+ }
386
+ return message;
387
+ };
388
+
389
+ /**
390
+ * Decodes a Coin message from the specified reader or buffer, length delimited.
391
+ * @function decodeDelimited
392
+ * @memberof common.Coin
393
+ * @static
394
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
395
+ * @returns {common.Coin} Coin
396
+ * @throws {Error} If the payload is not a reader or valid buffer
397
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
398
+ */
399
+ Coin.decodeDelimited = function decodeDelimited(reader) {
400
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
401
+ return this.decode(reader, reader.uint32());
402
+ };
403
+
404
+ /**
405
+ * Verifies a Coin message.
406
+ * @function verify
407
+ * @memberof common.Coin
408
+ * @static
409
+ * @param {Object.<string,*>} message Plain object to verify
410
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
411
+ */
412
+ Coin.verify = function verify(message) {
413
+ if (typeof message !== "object" || message === null) return "object expected";
414
+ if (message.asset != null && message.hasOwnProperty("asset")) {
415
+ const error = $root.common.Asset.verify(message.asset);
416
+ if (error) return "asset." + error;
417
+ }
418
+ if (message.amount != null && message.hasOwnProperty("amount"))
419
+ if (!$util.isString(message.amount)) return "amount: string expected";
420
+ if (message.decimals != null && message.hasOwnProperty("decimals"))
421
+ if (
422
+ !$util.isInteger(message.decimals) &&
423
+ !(
424
+ message.decimals &&
425
+ $util.isInteger(message.decimals.low) &&
426
+ $util.isInteger(message.decimals.high)
427
+ )
428
+ )
429
+ return "decimals: integer|Long expected";
430
+ return null;
431
+ };
432
+
433
+ /**
434
+ * Creates a Coin message from a plain object. Also converts values to their respective internal types.
435
+ * @function fromObject
436
+ * @memberof common.Coin
437
+ * @static
438
+ * @param {Object.<string,*>} object Plain object
439
+ * @returns {common.Coin} Coin
440
+ */
441
+ Coin.fromObject = function fromObject(object) {
442
+ if (object instanceof $root.common.Coin) return object;
443
+ const message = new $root.common.Coin();
444
+ if (object.asset != null) {
445
+ if (typeof object.asset !== "object")
446
+ throw TypeError(".common.Coin.asset: object expected");
447
+ message.asset = $root.common.Asset.fromObject(object.asset);
448
+ }
449
+ if (object.amount != null) message.amount = String(object.amount);
450
+ if (object.decimals != null)
451
+ if ($util.Long) (message.decimals = $util.Long.fromValue(object.decimals)).unsigned = false;
452
+ else if (typeof object.decimals === "string")
453
+ message.decimals = Number.parseInt(object.decimals, 10);
454
+ else if (typeof object.decimals === "number") message.decimals = object.decimals;
455
+ else if (typeof object.decimals === "object")
456
+ message.decimals = new $util.LongBits(
457
+ object.decimals.low >>> 0,
458
+ object.decimals.high >>> 0,
459
+ ).toNumber();
460
+ return message;
461
+ };
462
+
463
+ /**
464
+ * Creates a plain object from a Coin message. Also converts values to other types if specified.
465
+ * @function toObject
466
+ * @memberof common.Coin
467
+ * @static
468
+ * @param {common.Coin} message Coin
469
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
470
+ * @returns {Object.<string,*>} Plain object
471
+ */
472
+ Coin.toObject = function toObject(message, options) {
473
+ if (!options) options = {};
474
+ const object = {};
475
+ if (options.defaults) {
476
+ object.asset = null;
477
+ object.amount = "";
478
+ if ($util.Long) {
479
+ const long = new $util.Long(0, 0, false);
480
+ object.decimals =
481
+ options.longs === String
482
+ ? long.toString()
483
+ : options.longs === Number
484
+ ? long.toNumber()
485
+ : long;
486
+ } else object.decimals = options.longs === String ? "0" : 0;
487
+ }
488
+ if (message.asset != null && message.hasOwnProperty("asset"))
489
+ object.asset = $root.common.Asset.toObject(message.asset, options);
490
+ if (message.amount != null && message.hasOwnProperty("amount"))
491
+ object.amount = message.amount;
492
+ if (message.decimals != null && message.hasOwnProperty("decimals"))
493
+ if (typeof message.decimals === "number")
494
+ object.decimals = options.longs === String ? String(message.decimals) : message.decimals;
495
+ else
496
+ object.decimals =
497
+ options.longs === String
498
+ ? $util.Long.prototype.toString.call(message.decimals)
499
+ : options.longs === Number
500
+ ? new $util.LongBits(
501
+ message.decimals.low >>> 0,
502
+ message.decimals.high >>> 0,
503
+ ).toNumber()
504
+ : message.decimals;
505
+ return object;
506
+ };
507
+
508
+ /**
509
+ * Converts this Coin to JSON.
510
+ * @function toJSON
511
+ * @memberof common.Coin
512
+ * @instance
513
+ * @returns {Object.<string,*>} JSON object
514
+ */
515
+ Coin.prototype.toJSON = function toJSON() {
516
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
517
+ };
518
+
519
+ return Coin;
520
+ })();
521
+
522
+ common.PubKeySet = (() => {
523
+ /**
524
+ * Properties of a PubKeySet.
525
+ * @memberof common
526
+ * @interface IPubKeySet
527
+ * @property {string|null} [secp256k1] PubKeySet secp256k1
528
+ * @property {string|null} [ed25519] PubKeySet ed25519
529
+ */
530
+
531
+ /**
532
+ * Constructs a new PubKeySet.
533
+ * @memberof common
534
+ * @classdesc Represents a PubKeySet.
535
+ * @implements IPubKeySet
536
+ * @constructor
537
+ * @param {common.IPubKeySet=} [properties] Properties to set
538
+ */
539
+ function PubKeySet(properties) {
540
+ if (properties)
541
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
542
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
543
+ }
544
+
545
+ /**
546
+ * PubKeySet secp256k1.
547
+ * @member {string} secp256k1
548
+ * @memberof common.PubKeySet
549
+ * @instance
550
+ */
551
+ PubKeySet.prototype.secp256k1 = "";
552
+
553
+ /**
554
+ * PubKeySet ed25519.
555
+ * @member {string} ed25519
556
+ * @memberof common.PubKeySet
557
+ * @instance
558
+ */
559
+ PubKeySet.prototype.ed25519 = "";
560
+
561
+ /**
562
+ * Creates a new PubKeySet instance using the specified properties.
563
+ * @function create
564
+ * @memberof common.PubKeySet
565
+ * @static
566
+ * @param {common.IPubKeySet=} [properties] Properties to set
567
+ * @returns {common.PubKeySet} PubKeySet instance
568
+ */
569
+ PubKeySet.create = function create(properties) {
570
+ return new PubKeySet(properties);
571
+ };
572
+
573
+ /**
574
+ * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages.
575
+ * @function encode
576
+ * @memberof common.PubKeySet
577
+ * @static
578
+ * @param {common.IPubKeySet} message PubKeySet message or plain object to encode
579
+ * @param {$protobuf.Writer} [writer] Writer to encode to
580
+ * @returns {$protobuf.Writer} Writer
581
+ */
582
+ PubKeySet.encode = function encode(message, writer) {
583
+ if (!writer) writer = $Writer.create();
584
+ if (message.secp256k1 != null && Object.hasOwnProperty.call(message, "secp256k1"))
585
+ writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.secp256k1);
586
+ if (message.ed25519 != null && Object.hasOwnProperty.call(message, "ed25519"))
587
+ writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.ed25519);
588
+ return writer;
589
+ };
590
+
591
+ /**
592
+ * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages.
593
+ * @function encodeDelimited
594
+ * @memberof common.PubKeySet
595
+ * @static
596
+ * @param {common.IPubKeySet} message PubKeySet message or plain object to encode
597
+ * @param {$protobuf.Writer} [writer] Writer to encode to
598
+ * @returns {$protobuf.Writer} Writer
599
+ */
600
+ PubKeySet.encodeDelimited = function encodeDelimited(message, writer) {
601
+ return this.encode(message, writer).ldelim();
602
+ };
603
+
604
+ /**
605
+ * Decodes a PubKeySet message from the specified reader or buffer.
606
+ * @function decode
607
+ * @memberof common.PubKeySet
608
+ * @static
609
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
610
+ * @param {number} [length] Message length if known beforehand
611
+ * @returns {common.PubKeySet} PubKeySet
612
+ * @throws {Error} If the payload is not a reader or valid buffer
613
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
614
+ */
615
+ PubKeySet.decode = function decode(reader, length) {
616
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
617
+ const end = length === undefined ? reader.len : reader.pos + length,
618
+ message = new $root.common.PubKeySet();
619
+ while (reader.pos < end) {
620
+ const tag = reader.uint32();
621
+ switch (tag >>> 3) {
622
+ case 1:
623
+ message.secp256k1 = reader.string();
624
+ break;
625
+ case 2:
626
+ message.ed25519 = reader.string();
627
+ break;
628
+ default:
629
+ reader.skipType(tag & 7);
630
+ break;
631
+ }
632
+ }
633
+ return message;
634
+ };
635
+
636
+ /**
637
+ * Decodes a PubKeySet message from the specified reader or buffer, length delimited.
638
+ * @function decodeDelimited
639
+ * @memberof common.PubKeySet
640
+ * @static
641
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
642
+ * @returns {common.PubKeySet} PubKeySet
643
+ * @throws {Error} If the payload is not a reader or valid buffer
644
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
645
+ */
646
+ PubKeySet.decodeDelimited = function decodeDelimited(reader) {
647
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
648
+ return this.decode(reader, reader.uint32());
649
+ };
650
+
651
+ /**
652
+ * Verifies a PubKeySet message.
653
+ * @function verify
654
+ * @memberof common.PubKeySet
655
+ * @static
656
+ * @param {Object.<string,*>} message Plain object to verify
657
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
658
+ */
659
+ PubKeySet.verify = function verify(message) {
660
+ if (typeof message !== "object" || message === null) return "object expected";
661
+ if (message.secp256k1 != null && message.hasOwnProperty("secp256k1"))
662
+ if (!$util.isString(message.secp256k1)) return "secp256k1: string expected";
663
+ if (message.ed25519 != null && message.hasOwnProperty("ed25519"))
664
+ if (!$util.isString(message.ed25519)) return "ed25519: string expected";
665
+ return null;
666
+ };
667
+
668
+ /**
669
+ * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types.
670
+ * @function fromObject
671
+ * @memberof common.PubKeySet
672
+ * @static
673
+ * @param {Object.<string,*>} object Plain object
674
+ * @returns {common.PubKeySet} PubKeySet
675
+ */
676
+ PubKeySet.fromObject = function fromObject(object) {
677
+ if (object instanceof $root.common.PubKeySet) return object;
678
+ const message = new $root.common.PubKeySet();
679
+ if (object.secp256k1 != null) message.secp256k1 = String(object.secp256k1);
680
+ if (object.ed25519 != null) message.ed25519 = String(object.ed25519);
681
+ return message;
682
+ };
683
+
684
+ /**
685
+ * Creates a plain object from a PubKeySet message. Also converts values to other types if specified.
686
+ * @function toObject
687
+ * @memberof common.PubKeySet
688
+ * @static
689
+ * @param {common.PubKeySet} message PubKeySet
690
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
691
+ * @returns {Object.<string,*>} Plain object
692
+ */
693
+ PubKeySet.toObject = function toObject(message, options) {
694
+ if (!options) options = {};
695
+ const object = {};
696
+ if (options.defaults) {
697
+ object.secp256k1 = "";
698
+ object.ed25519 = "";
699
+ }
700
+ if (message.secp256k1 != null && message.hasOwnProperty("secp256k1"))
701
+ object.secp256k1 = message.secp256k1;
702
+ if (message.ed25519 != null && message.hasOwnProperty("ed25519"))
703
+ object.ed25519 = message.ed25519;
704
+ return object;
705
+ };
706
+
707
+ /**
708
+ * Converts this PubKeySet to JSON.
709
+ * @function toJSON
710
+ * @memberof common.PubKeySet
711
+ * @instance
712
+ * @returns {Object.<string,*>} JSON object
713
+ */
714
+ PubKeySet.prototype.toJSON = function toJSON() {
715
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
716
+ };
717
+
718
+ return PubKeySet;
719
+ })();
720
+
721
+ common.Tx = (() => {
722
+ /**
723
+ * Properties of a Tx.
724
+ * @memberof common
725
+ * @interface ITx
726
+ * @property {string|null} [id] Tx id
727
+ * @property {string|null} [chain] Tx chain
728
+ * @property {string|null} [fromAddress] Tx fromAddress
729
+ * @property {string|null} [toAddress] Tx toAddress
730
+ * @property {Array.<common.ICoin>|null} [coins] Tx coins
731
+ * @property {Array.<common.ICoin>|null} [gas] Tx gas
732
+ * @property {string|null} [memo] Tx memo
733
+ */
734
+
735
+ /**
736
+ * Constructs a new Tx.
737
+ * @memberof common
738
+ * @classdesc Represents a Tx.
739
+ * @implements ITx
740
+ * @constructor
741
+ * @param {common.ITx=} [properties] Properties to set
742
+ */
743
+ function Tx(properties) {
744
+ this.coins = [];
745
+ this.gas = [];
746
+ if (properties)
747
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
748
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
749
+ }
750
+
751
+ /**
752
+ * Tx id.
753
+ * @member {string} id
754
+ * @memberof common.Tx
755
+ * @instance
756
+ */
757
+ Tx.prototype.id = "";
758
+
759
+ /**
760
+ * Tx chain.
761
+ * @member {string} chain
762
+ * @memberof common.Tx
763
+ * @instance
764
+ */
765
+ Tx.prototype.chain = "";
766
+
767
+ /**
768
+ * Tx fromAddress.
769
+ * @member {string} fromAddress
770
+ * @memberof common.Tx
771
+ * @instance
772
+ */
773
+ Tx.prototype.fromAddress = "";
774
+
775
+ /**
776
+ * Tx toAddress.
777
+ * @member {string} toAddress
778
+ * @memberof common.Tx
779
+ * @instance
780
+ */
781
+ Tx.prototype.toAddress = "";
782
+
783
+ /**
784
+ * Tx coins.
785
+ * @member {Array.<common.ICoin>} coins
786
+ * @memberof common.Tx
787
+ * @instance
788
+ */
789
+ Tx.prototype.coins = $util.emptyArray;
790
+
791
+ /**
792
+ * Tx gas.
793
+ * @member {Array.<common.ICoin>} gas
794
+ * @memberof common.Tx
795
+ * @instance
796
+ */
797
+ Tx.prototype.gas = $util.emptyArray;
798
+
799
+ /**
800
+ * Tx memo.
801
+ * @member {string} memo
802
+ * @memberof common.Tx
803
+ * @instance
804
+ */
805
+ Tx.prototype.memo = "";
806
+
807
+ /**
808
+ * Creates a new Tx instance using the specified properties.
809
+ * @function create
810
+ * @memberof common.Tx
811
+ * @static
812
+ * @param {common.ITx=} [properties] Properties to set
813
+ * @returns {common.Tx} Tx instance
814
+ */
815
+ Tx.create = function create(properties) {
816
+ return new Tx(properties);
817
+ };
818
+
819
+ /**
820
+ * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages.
821
+ * @function encode
822
+ * @memberof common.Tx
823
+ * @static
824
+ * @param {common.ITx} message Tx message or plain object to encode
825
+ * @param {$protobuf.Writer} [writer] Writer to encode to
826
+ * @returns {$protobuf.Writer} Writer
827
+ */
828
+ Tx.encode = function encode(message, writer) {
829
+ if (!writer) writer = $Writer.create();
830
+ if (message.id != null && Object.hasOwnProperty.call(message, "id"))
831
+ writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.id);
832
+ if (message.chain != null && Object.hasOwnProperty.call(message, "chain"))
833
+ writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.chain);
834
+ if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress"))
835
+ writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.fromAddress);
836
+ if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress"))
837
+ writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.toAddress);
838
+ if (message.coins?.length)
839
+ for (let i = 0; i < message.coins.length; ++i)
840
+ $root.common.Coin.encode(
841
+ message.coins[i],
842
+ writer.uint32(/* id 5, wireType 2 =*/ 42).fork(),
843
+ ).ldelim();
844
+ if (message.gas?.length)
845
+ for (let j = 0; j < message.gas.length; ++j)
846
+ $root.common.Coin.encode(
847
+ message.gas[j],
848
+ writer.uint32(/* id 6, wireType 2 =*/ 50).fork(),
849
+ ).ldelim();
850
+ if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
851
+ writer.uint32(/* id 7, wireType 2 =*/ 58).string(message.memo);
852
+ return writer;
853
+ };
854
+
855
+ /**
856
+ * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages.
857
+ * @function encodeDelimited
858
+ * @memberof common.Tx
859
+ * @static
860
+ * @param {common.ITx} message Tx message or plain object to encode
861
+ * @param {$protobuf.Writer} [writer] Writer to encode to
862
+ * @returns {$protobuf.Writer} Writer
863
+ */
864
+ Tx.encodeDelimited = function encodeDelimited(message, writer) {
865
+ return this.encode(message, writer).ldelim();
866
+ };
867
+
868
+ /**
869
+ * Decodes a Tx message from the specified reader or buffer.
870
+ * @function decode
871
+ * @memberof common.Tx
872
+ * @static
873
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
874
+ * @param {number} [length] Message length if known beforehand
875
+ * @returns {common.Tx} Tx
876
+ * @throws {Error} If the payload is not a reader or valid buffer
877
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
878
+ */
879
+ Tx.decode = function decode(reader, length) {
880
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
881
+ const end = length === undefined ? reader.len : reader.pos + length,
882
+ message = new $root.common.Tx();
883
+ while (reader.pos < end) {
884
+ const tag = reader.uint32();
885
+ switch (tag >>> 3) {
886
+ case 1:
887
+ message.id = reader.string();
888
+ break;
889
+ case 2:
890
+ message.chain = reader.string();
891
+ break;
892
+ case 3:
893
+ message.fromAddress = reader.string();
894
+ break;
895
+ case 4:
896
+ message.toAddress = reader.string();
897
+ break;
898
+ case 5:
899
+ if (!message.coins?.length) message.coins = [];
900
+ message.coins.push($root.common.Coin.decode(reader, reader.uint32()));
901
+ break;
902
+ case 6:
903
+ if (!message.gas?.length) message.gas = [];
904
+ message.gas.push($root.common.Coin.decode(reader, reader.uint32()));
905
+ break;
906
+ case 7:
907
+ message.memo = reader.string();
908
+ break;
909
+ default:
910
+ reader.skipType(tag & 7);
911
+ break;
912
+ }
913
+ }
914
+ return message;
915
+ };
916
+
917
+ /**
918
+ * Decodes a Tx message from the specified reader or buffer, length delimited.
919
+ * @function decodeDelimited
920
+ * @memberof common.Tx
921
+ * @static
922
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
923
+ * @returns {common.Tx} Tx
924
+ * @throws {Error} If the payload is not a reader or valid buffer
925
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
926
+ */
927
+ Tx.decodeDelimited = function decodeDelimited(reader) {
928
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
929
+ return this.decode(reader, reader.uint32());
930
+ };
931
+
932
+ /**
933
+ * Verifies a Tx message.
934
+ * @function verify
935
+ * @memberof common.Tx
936
+ * @static
937
+ * @param {Object.<string,*>} message Plain object to verify
938
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
939
+ */
940
+ Tx.verify = function verify(message) {
941
+ if (typeof message !== "object" || message === null) return "object expected";
942
+ if (message.id != null && message.hasOwnProperty("id"))
943
+ if (!$util.isString(message.id)) return "id: string expected";
944
+ if (message.chain != null && message.hasOwnProperty("chain"))
945
+ if (!$util.isString(message.chain)) return "chain: string expected";
946
+ if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
947
+ if (!$util.isString(message.fromAddress)) return "fromAddress: string expected";
948
+ if (message.toAddress != null && message.hasOwnProperty("toAddress"))
949
+ if (!$util.isString(message.toAddress)) return "toAddress: string expected";
950
+ if (message.coins != null && message.hasOwnProperty("coins")) {
951
+ if (!Array.isArray(message.coins)) return "coins: array expected";
952
+ for (let i = 0; i < message.coins.length; ++i) {
953
+ const error = $root.common.Coin.verify(message.coins[i]);
954
+ if (error) return "coins." + error;
955
+ }
956
+ }
957
+ if (message.gas != null && message.hasOwnProperty("gas")) {
958
+ if (!Array.isArray(message.gas)) return "gas: array expected";
959
+ for (let j = 0; j < message.gas.length; ++j) {
960
+ const error = $root.common.Coin.verify(message.gas[j]);
961
+ if (error) return "gas." + error;
962
+ }
963
+ }
964
+ if (message.memo != null && message.hasOwnProperty("memo"))
965
+ if (!$util.isString(message.memo)) return "memo: string expected";
966
+ return null;
967
+ };
968
+
969
+ /**
970
+ * Creates a Tx message from a plain object. Also converts values to their respective internal types.
971
+ * @function fromObject
972
+ * @memberof common.Tx
973
+ * @static
974
+ * @param {Object.<string,*>} object Plain object
975
+ * @returns {common.Tx} Tx
976
+ */
977
+ Tx.fromObject = function fromObject(object) {
978
+ if (object instanceof $root.common.Tx) return object;
979
+ const message = new $root.common.Tx();
980
+ if (object.id != null) message.id = String(object.id);
981
+ if (object.chain != null) message.chain = String(object.chain);
982
+ if (object.fromAddress != null) message.fromAddress = String(object.fromAddress);
983
+ if (object.toAddress != null) message.toAddress = String(object.toAddress);
984
+ if (object.coins) {
985
+ if (!Array.isArray(object.coins)) throw TypeError(".common.Tx.coins: array expected");
986
+ message.coins = [];
987
+ for (let i = 0; i < object.coins.length; ++i) {
988
+ if (typeof object.coins[i] !== "object")
989
+ throw TypeError(".common.Tx.coins: object expected");
990
+ message.coins[i] = $root.common.Coin.fromObject(object.coins[i]);
991
+ }
992
+ }
993
+ if (object.gas) {
994
+ if (!Array.isArray(object.gas)) throw TypeError(".common.Tx.gas: array expected");
995
+ message.gas = [];
996
+ for (let i = 0; i < object.gas.length; ++i) {
997
+ if (typeof object.gas[i] !== "object") throw TypeError(".common.Tx.gas: object expected");
998
+ message.gas[i] = $root.common.Coin.fromObject(object.gas[i]);
999
+ }
1000
+ }
1001
+ if (object.memo != null) message.memo = String(object.memo);
1002
+ return message;
1003
+ };
1004
+
1005
+ /**
1006
+ * Creates a plain object from a Tx message. Also converts values to other types if specified.
1007
+ * @function toObject
1008
+ * @memberof common.Tx
1009
+ * @static
1010
+ * @param {common.Tx} message Tx
1011
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1012
+ * @returns {Object.<string,*>} Plain object
1013
+ */
1014
+ Tx.toObject = function toObject(message, options) {
1015
+ if (!options) options = {};
1016
+ const object = {};
1017
+ if (options.arrays || options.defaults) {
1018
+ object.coins = [];
1019
+ object.gas = [];
1020
+ }
1021
+ if (options.defaults) {
1022
+ object.id = "";
1023
+ object.chain = "";
1024
+ object.fromAddress = "";
1025
+ object.toAddress = "";
1026
+ object.memo = "";
1027
+ }
1028
+ if (message.id != null && message.hasOwnProperty("id")) object.id = message.id;
1029
+ if (message.chain != null && message.hasOwnProperty("chain")) object.chain = message.chain;
1030
+ if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
1031
+ object.fromAddress = message.fromAddress;
1032
+ if (message.toAddress != null && message.hasOwnProperty("toAddress"))
1033
+ object.toAddress = message.toAddress;
1034
+ if (message.coins?.length) {
1035
+ object.coins = [];
1036
+ for (let j = 0; j < message.coins.length; ++j)
1037
+ object.coins[j] = $root.common.Coin.toObject(message.coins[j], options);
1038
+ }
1039
+ if (message.gas?.length) {
1040
+ object.gas = [];
1041
+ for (let j = 0; j < message.gas.length; ++j)
1042
+ object.gas[j] = $root.common.Coin.toObject(message.gas[j], options);
1043
+ }
1044
+ if (message.memo != null && message.hasOwnProperty("memo")) object.memo = message.memo;
1045
+ return object;
1046
+ };
1047
+
1048
+ /**
1049
+ * Converts this Tx to JSON.
1050
+ * @function toJSON
1051
+ * @memberof common.Tx
1052
+ * @instance
1053
+ * @returns {Object.<string,*>} JSON object
1054
+ */
1055
+ Tx.prototype.toJSON = function toJSON() {
1056
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1057
+ };
1058
+
1059
+ return Tx;
1060
+ })();
1061
+
1062
+ common.Fee = (() => {
1063
+ /**
1064
+ * Properties of a Fee.
1065
+ * @memberof common
1066
+ * @interface IFee
1067
+ * @property {Array.<common.ICoin>|null} [coins] Fee coins
1068
+ * @property {string|null} [poolDeduct] Fee poolDeduct
1069
+ */
1070
+
1071
+ /**
1072
+ * Constructs a new Fee.
1073
+ * @memberof common
1074
+ * @classdesc Represents a Fee.
1075
+ * @implements IFee
1076
+ * @constructor
1077
+ * @param {common.IFee=} [properties] Properties to set
1078
+ */
1079
+ function Fee(properties) {
1080
+ this.coins = [];
1081
+ if (properties)
1082
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1083
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1084
+ }
1085
+
1086
+ /**
1087
+ * Fee coins.
1088
+ * @member {Array.<common.ICoin>} coins
1089
+ * @memberof common.Fee
1090
+ * @instance
1091
+ */
1092
+ Fee.prototype.coins = $util.emptyArray;
1093
+
1094
+ /**
1095
+ * Fee poolDeduct.
1096
+ * @member {string} poolDeduct
1097
+ * @memberof common.Fee
1098
+ * @instance
1099
+ */
1100
+ Fee.prototype.poolDeduct = "";
1101
+
1102
+ /**
1103
+ * Creates a new Fee instance using the specified properties.
1104
+ * @function create
1105
+ * @memberof common.Fee
1106
+ * @static
1107
+ * @param {common.IFee=} [properties] Properties to set
1108
+ * @returns {common.Fee} Fee instance
1109
+ */
1110
+ Fee.create = function create(properties) {
1111
+ return new Fee(properties);
1112
+ };
1113
+
1114
+ /**
1115
+ * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages.
1116
+ * @function encode
1117
+ * @memberof common.Fee
1118
+ * @static
1119
+ * @param {common.IFee} message Fee message or plain object to encode
1120
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1121
+ * @returns {$protobuf.Writer} Writer
1122
+ */
1123
+ Fee.encode = function encode(message, writer) {
1124
+ if (!writer) writer = $Writer.create();
1125
+ if (message.coins?.length)
1126
+ for (let i = 0; i < message.coins.length; ++i)
1127
+ $root.common.Coin.encode(
1128
+ message.coins[i],
1129
+ writer.uint32(/* id 1, wireType 2 =*/ 10).fork(),
1130
+ ).ldelim();
1131
+ if (message.poolDeduct != null && Object.hasOwnProperty.call(message, "poolDeduct"))
1132
+ writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.poolDeduct);
1133
+ return writer;
1134
+ };
1135
+
1136
+ /**
1137
+ * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages.
1138
+ * @function encodeDelimited
1139
+ * @memberof common.Fee
1140
+ * @static
1141
+ * @param {common.IFee} message Fee message or plain object to encode
1142
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1143
+ * @returns {$protobuf.Writer} Writer
1144
+ */
1145
+ Fee.encodeDelimited = function encodeDelimited(message, writer) {
1146
+ return this.encode(message, writer).ldelim();
1147
+ };
1148
+
1149
+ /**
1150
+ * Decodes a Fee message from the specified reader or buffer.
1151
+ * @function decode
1152
+ * @memberof common.Fee
1153
+ * @static
1154
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1155
+ * @param {number} [length] Message length if known beforehand
1156
+ * @returns {common.Fee} Fee
1157
+ * @throws {Error} If the payload is not a reader or valid buffer
1158
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1159
+ */
1160
+ Fee.decode = function decode(reader, length) {
1161
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1162
+ const end = length === undefined ? reader.len : reader.pos + length,
1163
+ message = new $root.common.Fee();
1164
+ while (reader.pos < end) {
1165
+ const tag = reader.uint32();
1166
+ switch (tag >>> 3) {
1167
+ case 1:
1168
+ if (!message.coins?.length) message.coins = [];
1169
+ message.coins.push($root.common.Coin.decode(reader, reader.uint32()));
1170
+ break;
1171
+ case 2:
1172
+ message.poolDeduct = reader.string();
1173
+ break;
1174
+ default:
1175
+ reader.skipType(tag & 7);
1176
+ break;
1177
+ }
1178
+ }
1179
+ return message;
1180
+ };
1181
+
1182
+ /**
1183
+ * Decodes a Fee message from the specified reader or buffer, length delimited.
1184
+ * @function decodeDelimited
1185
+ * @memberof common.Fee
1186
+ * @static
1187
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1188
+ * @returns {common.Fee} Fee
1189
+ * @throws {Error} If the payload is not a reader or valid buffer
1190
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1191
+ */
1192
+ Fee.decodeDelimited = function decodeDelimited(reader) {
1193
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1194
+ return this.decode(reader, reader.uint32());
1195
+ };
1196
+
1197
+ /**
1198
+ * Verifies a Fee message.
1199
+ * @function verify
1200
+ * @memberof common.Fee
1201
+ * @static
1202
+ * @param {Object.<string,*>} message Plain object to verify
1203
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1204
+ */
1205
+ Fee.verify = function verify(message) {
1206
+ if (typeof message !== "object" || message === null) return "object expected";
1207
+ if (message.coins != null && message.hasOwnProperty("coins")) {
1208
+ if (!Array.isArray(message.coins)) return "coins: array expected";
1209
+ for (let i = 0; i < message.coins.length; ++i) {
1210
+ const error = $root.common.Coin.verify(message.coins[i]);
1211
+ if (error) return "coins." + error;
1212
+ }
1213
+ }
1214
+ if (message.poolDeduct != null && message.hasOwnProperty("poolDeduct"))
1215
+ if (!$util.isString(message.poolDeduct)) return "poolDeduct: string expected";
1216
+ return null;
1217
+ };
1218
+
1219
+ /**
1220
+ * Creates a Fee message from a plain object. Also converts values to their respective internal types.
1221
+ * @function fromObject
1222
+ * @memberof common.Fee
1223
+ * @static
1224
+ * @param {Object.<string,*>} object Plain object
1225
+ * @returns {common.Fee} Fee
1226
+ */
1227
+ Fee.fromObject = function fromObject(object) {
1228
+ if (object instanceof $root.common.Fee) return object;
1229
+ const message = new $root.common.Fee();
1230
+ if (object.coins) {
1231
+ if (!Array.isArray(object.coins)) throw TypeError(".common.Fee.coins: array expected");
1232
+ message.coins = [];
1233
+ for (let i = 0; i < object.coins.length; ++i) {
1234
+ if (typeof object.coins[i] !== "object")
1235
+ throw TypeError(".common.Fee.coins: object expected");
1236
+ message.coins[i] = $root.common.Coin.fromObject(object.coins[i]);
1237
+ }
1238
+ }
1239
+ if (object.poolDeduct != null) message.poolDeduct = String(object.poolDeduct);
1240
+ return message;
1241
+ };
1242
+
1243
+ /**
1244
+ * Creates a plain object from a Fee message. Also converts values to other types if specified.
1245
+ * @function toObject
1246
+ * @memberof common.Fee
1247
+ * @static
1248
+ * @param {common.Fee} message Fee
1249
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1250
+ * @returns {Object.<string,*>} Plain object
1251
+ */
1252
+ Fee.toObject = function toObject(message, options) {
1253
+ if (!options) options = {};
1254
+ const object = {};
1255
+ if (options.arrays || options.defaults) object.coins = [];
1256
+ if (options.defaults) object.poolDeduct = "";
1257
+ if (message.coins?.length) {
1258
+ object.coins = [];
1259
+ for (let j = 0; j < message.coins.length; ++j)
1260
+ object.coins[j] = $root.common.Coin.toObject(message.coins[j], options);
1261
+ }
1262
+ if (message.poolDeduct != null && message.hasOwnProperty("poolDeduct"))
1263
+ object.poolDeduct = message.poolDeduct;
1264
+ return object;
1265
+ };
1266
+
1267
+ /**
1268
+ * Converts this Fee to JSON.
1269
+ * @function toJSON
1270
+ * @memberof common.Fee
1271
+ * @instance
1272
+ * @returns {Object.<string,*>} JSON object
1273
+ */
1274
+ Fee.prototype.toJSON = function toJSON() {
1275
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1276
+ };
1277
+
1278
+ return Fee;
1279
+ })();
1280
+
1281
+ common.ProtoUint = (() => {
1282
+ /**
1283
+ * Properties of a ProtoUint.
1284
+ * @memberof common
1285
+ * @interface IProtoUint
1286
+ * @property {string|null} [value] ProtoUint value
1287
+ */
1288
+
1289
+ /**
1290
+ * Constructs a new ProtoUint.
1291
+ * @memberof common
1292
+ * @classdesc Represents a ProtoUint.
1293
+ * @implements IProtoUint
1294
+ * @constructor
1295
+ * @param {common.IProtoUint=} [properties] Properties to set
1296
+ */
1297
+ function ProtoUint(properties) {
1298
+ if (properties)
1299
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1300
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1301
+ }
1302
+
1303
+ /**
1304
+ * ProtoUint value.
1305
+ * @member {string} value
1306
+ * @memberof common.ProtoUint
1307
+ * @instance
1308
+ */
1309
+ ProtoUint.prototype.value = "";
1310
+
1311
+ /**
1312
+ * Creates a new ProtoUint instance using the specified properties.
1313
+ * @function create
1314
+ * @memberof common.ProtoUint
1315
+ * @static
1316
+ * @param {common.IProtoUint=} [properties] Properties to set
1317
+ * @returns {common.ProtoUint} ProtoUint instance
1318
+ */
1319
+ ProtoUint.create = function create(properties) {
1320
+ return new ProtoUint(properties);
1321
+ };
1322
+
1323
+ /**
1324
+ * Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages.
1325
+ * @function encode
1326
+ * @memberof common.ProtoUint
1327
+ * @static
1328
+ * @param {common.IProtoUint} message ProtoUint message or plain object to encode
1329
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1330
+ * @returns {$protobuf.Writer} Writer
1331
+ */
1332
+ ProtoUint.encode = function encode(message, writer) {
1333
+ if (!writer) writer = $Writer.create();
1334
+ if (message.value != null && Object.hasOwnProperty.call(message, "value"))
1335
+ writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.value);
1336
+ return writer;
1337
+ };
1338
+
1339
+ /**
1340
+ * Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages.
1341
+ * @function encodeDelimited
1342
+ * @memberof common.ProtoUint
1343
+ * @static
1344
+ * @param {common.IProtoUint} message ProtoUint message or plain object to encode
1345
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1346
+ * @returns {$protobuf.Writer} Writer
1347
+ */
1348
+ ProtoUint.encodeDelimited = function encodeDelimited(message, writer) {
1349
+ return this.encode(message, writer).ldelim();
1350
+ };
1351
+
1352
+ /**
1353
+ * Decodes a ProtoUint message from the specified reader or buffer.
1354
+ * @function decode
1355
+ * @memberof common.ProtoUint
1356
+ * @static
1357
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1358
+ * @param {number} [length] Message length if known beforehand
1359
+ * @returns {common.ProtoUint} ProtoUint
1360
+ * @throws {Error} If the payload is not a reader or valid buffer
1361
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1362
+ */
1363
+ ProtoUint.decode = function decode(reader, length) {
1364
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1365
+ const end = length === undefined ? reader.len : reader.pos + length,
1366
+ message = new $root.common.ProtoUint();
1367
+ while (reader.pos < end) {
1368
+ const tag = reader.uint32();
1369
+ switch (tag >>> 3) {
1370
+ case 1:
1371
+ message.value = reader.string();
1372
+ break;
1373
+ default:
1374
+ reader.skipType(tag & 7);
1375
+ break;
1376
+ }
1377
+ }
1378
+ return message;
1379
+ };
1380
+
1381
+ /**
1382
+ * Decodes a ProtoUint message from the specified reader or buffer, length delimited.
1383
+ * @function decodeDelimited
1384
+ * @memberof common.ProtoUint
1385
+ * @static
1386
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1387
+ * @returns {common.ProtoUint} ProtoUint
1388
+ * @throws {Error} If the payload is not a reader or valid buffer
1389
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1390
+ */
1391
+ ProtoUint.decodeDelimited = function decodeDelimited(reader) {
1392
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1393
+ return this.decode(reader, reader.uint32());
1394
+ };
1395
+
1396
+ /**
1397
+ * Verifies a ProtoUint message.
1398
+ * @function verify
1399
+ * @memberof common.ProtoUint
1400
+ * @static
1401
+ * @param {Object.<string,*>} message Plain object to verify
1402
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1403
+ */
1404
+ ProtoUint.verify = function verify(message) {
1405
+ if (typeof message !== "object" || message === null) return "object expected";
1406
+ if (message.value != null && message.hasOwnProperty("value"))
1407
+ if (!$util.isString(message.value)) return "value: string expected";
1408
+ return null;
1409
+ };
1410
+
1411
+ /**
1412
+ * Creates a ProtoUint message from a plain object. Also converts values to their respective internal types.
1413
+ * @function fromObject
1414
+ * @memberof common.ProtoUint
1415
+ * @static
1416
+ * @param {Object.<string,*>} object Plain object
1417
+ * @returns {common.ProtoUint} ProtoUint
1418
+ */
1419
+ ProtoUint.fromObject = function fromObject(object) {
1420
+ if (object instanceof $root.common.ProtoUint) return object;
1421
+ const message = new $root.common.ProtoUint();
1422
+ if (object.value != null) message.value = String(object.value);
1423
+ return message;
1424
+ };
1425
+
1426
+ /**
1427
+ * Creates a plain object from a ProtoUint message. Also converts values to other types if specified.
1428
+ * @function toObject
1429
+ * @memberof common.ProtoUint
1430
+ * @static
1431
+ * @param {common.ProtoUint} message ProtoUint
1432
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1433
+ * @returns {Object.<string,*>} Plain object
1434
+ */
1435
+ ProtoUint.toObject = function toObject(message, options) {
1436
+ if (!options) options = {};
1437
+ const object = {};
1438
+ if (options.defaults) object.value = "";
1439
+ if (message.value != null && message.hasOwnProperty("value")) object.value = message.value;
1440
+ return object;
1441
+ };
1442
+
1443
+ /**
1444
+ * Converts this ProtoUint to JSON.
1445
+ * @function toJSON
1446
+ * @memberof common.ProtoUint
1447
+ * @instance
1448
+ * @returns {Object.<string,*>} JSON object
1449
+ */
1450
+ ProtoUint.prototype.toJSON = function toJSON() {
1451
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1452
+ };
1453
+
1454
+ return ProtoUint;
1455
+ })();
1456
+
1457
+ return common;
1458
+ })();
1459
+
1460
+ $root.types = (() => {
1461
+ /**
1462
+ * Namespace types.
1463
+ * @exports types
1464
+ * @namespace
1465
+ */
1466
+ const types = {};
1467
+
1468
+ types.MsgDeposit = (() => {
1469
+ /**
1470
+ * Properties of a MsgDeposit.
1471
+ * @memberof types
1472
+ * @interface IMsgDeposit
1473
+ * @property {Array.<common.ICoin>|null} [coins] MsgDeposit coins
1474
+ * @property {string|null} [memo] MsgDeposit memo
1475
+ * @property {Uint8Array|null} [signer] MsgDeposit signer
1476
+ */
1477
+
1478
+ /**
1479
+ * Constructs a new MsgDeposit.
1480
+ * @memberof types
1481
+ * @classdesc Represents a MsgDeposit.
1482
+ * @implements IMsgDeposit
1483
+ * @constructor
1484
+ * @param {types.IMsgDeposit=} [properties] Properties to set
1485
+ */
1486
+ function MsgDeposit(properties) {
1487
+ this.coins = [];
1488
+ if (properties)
1489
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1490
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1491
+ }
1492
+
1493
+ /**
1494
+ * MsgDeposit coins.
1495
+ * @member {Array.<common.ICoin>} coins
1496
+ * @memberof types.MsgDeposit
1497
+ * @instance
1498
+ */
1499
+ MsgDeposit.prototype.coins = $util.emptyArray;
1500
+
1501
+ /**
1502
+ * MsgDeposit memo.
1503
+ * @member {string} memo
1504
+ * @memberof types.MsgDeposit
1505
+ * @instance
1506
+ */
1507
+ MsgDeposit.prototype.memo = "";
1508
+
1509
+ /**
1510
+ * MsgDeposit signer.
1511
+ * @member {Uint8Array} signer
1512
+ * @memberof types.MsgDeposit
1513
+ * @instance
1514
+ */
1515
+ MsgDeposit.prototype.signer = $util.newBuffer([]);
1516
+
1517
+ /**
1518
+ * Creates a new MsgDeposit instance using the specified properties.
1519
+ * @function create
1520
+ * @memberof types.MsgDeposit
1521
+ * @static
1522
+ * @param {types.IMsgDeposit=} [properties] Properties to set
1523
+ * @returns {types.MsgDeposit} MsgDeposit instance
1524
+ */
1525
+ MsgDeposit.create = function create(properties) {
1526
+ return new MsgDeposit(properties);
1527
+ };
1528
+
1529
+ /**
1530
+ * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages.
1531
+ * @function encode
1532
+ * @memberof types.MsgDeposit
1533
+ * @static
1534
+ * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode
1535
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1536
+ * @returns {$protobuf.Writer} Writer
1537
+ */
1538
+ MsgDeposit.encode = function encode(message, writer) {
1539
+ if (!writer) writer = $Writer.create();
1540
+ if (message.coins?.length)
1541
+ for (let i = 0; i < message.coins.length; ++i)
1542
+ $root.common.Coin.encode(
1543
+ message.coins[i],
1544
+ writer.uint32(/* id 1, wireType 2 =*/ 10).fork(),
1545
+ ).ldelim();
1546
+ if (message.memo != null && Object.hasOwnProperty.call(message, "memo"))
1547
+ writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.memo);
1548
+ if (message.signer != null && Object.hasOwnProperty.call(message, "signer"))
1549
+ writer.uint32(/* id 3, wireType 2 =*/ 26).bytes(message.signer);
1550
+ return writer;
1551
+ };
1552
+
1553
+ /**
1554
+ * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages.
1555
+ * @function encodeDelimited
1556
+ * @memberof types.MsgDeposit
1557
+ * @static
1558
+ * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode
1559
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1560
+ * @returns {$protobuf.Writer} Writer
1561
+ */
1562
+ MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) {
1563
+ return this.encode(message, writer).ldelim();
1564
+ };
1565
+
1566
+ /**
1567
+ * Decodes a MsgDeposit message from the specified reader or buffer.
1568
+ * @function decode
1569
+ * @memberof types.MsgDeposit
1570
+ * @static
1571
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1572
+ * @param {number} [length] Message length if known beforehand
1573
+ * @returns {types.MsgDeposit} MsgDeposit
1574
+ * @throws {Error} If the payload is not a reader or valid buffer
1575
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1576
+ */
1577
+ MsgDeposit.decode = function decode(reader, length) {
1578
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1579
+ const end = length === undefined ? reader.len : reader.pos + length,
1580
+ message = new $root.types.MsgDeposit();
1581
+ while (reader.pos < end) {
1582
+ const tag = reader.uint32();
1583
+ switch (tag >>> 3) {
1584
+ case 1:
1585
+ if (!message.coins?.length) message.coins = [];
1586
+ message.coins.push($root.common.Coin.decode(reader, reader.uint32()));
1587
+ break;
1588
+ case 2:
1589
+ message.memo = reader.string();
1590
+ break;
1591
+ case 3:
1592
+ message.signer = reader.bytes();
1593
+ break;
1594
+ default:
1595
+ reader.skipType(tag & 7);
1596
+ break;
1597
+ }
1598
+ }
1599
+ return message;
1600
+ };
1601
+
1602
+ /**
1603
+ * Decodes a MsgDeposit message from the specified reader or buffer, length delimited.
1604
+ * @function decodeDelimited
1605
+ * @memberof types.MsgDeposit
1606
+ * @static
1607
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1608
+ * @returns {types.MsgDeposit} MsgDeposit
1609
+ * @throws {Error} If the payload is not a reader or valid buffer
1610
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1611
+ */
1612
+ MsgDeposit.decodeDelimited = function decodeDelimited(reader) {
1613
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1614
+ return this.decode(reader, reader.uint32());
1615
+ };
1616
+
1617
+ /**
1618
+ * Verifies a MsgDeposit message.
1619
+ * @function verify
1620
+ * @memberof types.MsgDeposit
1621
+ * @static
1622
+ * @param {Object.<string,*>} message Plain object to verify
1623
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1624
+ */
1625
+ MsgDeposit.verify = function verify(message) {
1626
+ if (typeof message !== "object" || message === null) return "object expected";
1627
+ if (message.coins != null && message.hasOwnProperty("coins")) {
1628
+ if (!Array.isArray(message.coins)) return "coins: array expected";
1629
+ for (let i = 0; i < message.coins.length; ++i) {
1630
+ const error = $root.common.Coin.verify(message.coins[i]);
1631
+ if (error) return "coins." + error;
1632
+ }
1633
+ }
1634
+ if (message.memo != null && message.hasOwnProperty("memo"))
1635
+ if (!$util.isString(message.memo)) return "memo: string expected";
1636
+ if (message.signer != null && message.hasOwnProperty("signer"))
1637
+ if (
1638
+ !(
1639
+ (message.signer && typeof message.signer.length === "number") ||
1640
+ $util.isString(message.signer)
1641
+ )
1642
+ )
1643
+ return "signer: buffer expected";
1644
+ return null;
1645
+ };
1646
+
1647
+ /**
1648
+ * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types.
1649
+ * @function fromObject
1650
+ * @memberof types.MsgDeposit
1651
+ * @static
1652
+ * @param {Object.<string,*>} object Plain object
1653
+ * @returns {types.MsgDeposit} MsgDeposit
1654
+ */
1655
+ MsgDeposit.fromObject = function fromObject(object) {
1656
+ if (object instanceof $root.types.MsgDeposit) return object;
1657
+ const message = new $root.types.MsgDeposit();
1658
+ if (object.coins) {
1659
+ if (!Array.isArray(object.coins))
1660
+ throw TypeError(".types.MsgDeposit.coins: array expected");
1661
+ message.coins = [];
1662
+ for (let i = 0; i < object.coins.length; ++i) {
1663
+ if (typeof object.coins[i] !== "object")
1664
+ throw TypeError(".types.MsgDeposit.coins: object expected");
1665
+ message.coins[i] = $root.common.Coin.fromObject(object.coins[i]);
1666
+ }
1667
+ }
1668
+ if (object.memo != null) message.memo = String(object.memo);
1669
+ if (object.signer != null)
1670
+ if (typeof object.signer === "string")
1671
+ $util.base64.decode(
1672
+ object.signer,
1673
+ (message.signer = $util.newBuffer($util.base64.length(object.signer))),
1674
+ 0,
1675
+ );
1676
+ else if (object.signer.length) message.signer = object.signer;
1677
+ return message;
1678
+ };
1679
+
1680
+ /**
1681
+ * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified.
1682
+ * @function toObject
1683
+ * @memberof types.MsgDeposit
1684
+ * @static
1685
+ * @param {types.MsgDeposit} message MsgDeposit
1686
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1687
+ * @returns {Object.<string,*>} Plain object
1688
+ */
1689
+ MsgDeposit.toObject = function toObject(message, options) {
1690
+ if (!options) options = {};
1691
+ const object = {};
1692
+ if (options.arrays || options.defaults) object.coins = [];
1693
+ if (options.defaults) {
1694
+ object.memo = "";
1695
+ if (options.bytes === String) object.signer = "";
1696
+ else {
1697
+ object.signer = [];
1698
+ if (options.bytes !== Array) object.signer = $util.newBuffer(object.signer);
1699
+ }
1700
+ }
1701
+ if (message.coins?.length) {
1702
+ object.coins = [];
1703
+ for (let j = 0; j < message.coins.length; ++j)
1704
+ object.coins[j] = $root.common.Coin.toObject(message.coins[j], options);
1705
+ }
1706
+ if (message.memo != null && message.hasOwnProperty("memo")) object.memo = message.memo;
1707
+ if (message.signer != null && message.hasOwnProperty("signer"))
1708
+ object.signer =
1709
+ options.bytes === String
1710
+ ? $util.base64.encode(message.signer, 0, message.signer.length)
1711
+ : options.bytes === Array
1712
+ ? Array.prototype.slice.call(message.signer)
1713
+ : message.signer;
1714
+ return object;
1715
+ };
1716
+
1717
+ /**
1718
+ * Converts this MsgDeposit to JSON.
1719
+ * @function toJSON
1720
+ * @memberof types.MsgDeposit
1721
+ * @instance
1722
+ * @returns {Object.<string,*>} JSON object
1723
+ */
1724
+ MsgDeposit.prototype.toJSON = function toJSON() {
1725
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
1726
+ };
1727
+
1728
+ return MsgDeposit;
1729
+ })();
1730
+
1731
+ types.MsgSend = (() => {
1732
+ /**
1733
+ * Properties of a MsgSend.
1734
+ * @memberof types
1735
+ * @interface IMsgSend
1736
+ * @property {Uint8Array|null} [fromAddress] MsgSend fromAddress
1737
+ * @property {Uint8Array|null} [toAddress] MsgSend toAddress
1738
+ * @property {Array.<cosmos.base.v1beta1.ICoin>|null} [amount] MsgSend amount
1739
+ */
1740
+
1741
+ /**
1742
+ * Constructs a new MsgSend.
1743
+ * @memberof types
1744
+ * @classdesc Represents a MsgSend.
1745
+ * @implements IMsgSend
1746
+ * @constructor
1747
+ * @param {types.IMsgSend=} [properties] Properties to set
1748
+ */
1749
+ function MsgSend(properties) {
1750
+ this.amount = [];
1751
+ if (properties)
1752
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
1753
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
1754
+ }
1755
+
1756
+ /**
1757
+ * MsgSend fromAddress.
1758
+ * @member {Uint8Array} fromAddress
1759
+ * @memberof types.MsgSend
1760
+ * @instance
1761
+ */
1762
+ MsgSend.prototype.fromAddress = $util.newBuffer([]);
1763
+
1764
+ /**
1765
+ * MsgSend toAddress.
1766
+ * @member {Uint8Array} toAddress
1767
+ * @memberof types.MsgSend
1768
+ * @instance
1769
+ */
1770
+ MsgSend.prototype.toAddress = $util.newBuffer([]);
1771
+
1772
+ /**
1773
+ * MsgSend amount.
1774
+ * @member {Array.<cosmos.base.v1beta1.ICoin>} amount
1775
+ * @memberof types.MsgSend
1776
+ * @instance
1777
+ */
1778
+ MsgSend.prototype.amount = $util.emptyArray;
1779
+
1780
+ /**
1781
+ * Creates a new MsgSend instance using the specified properties.
1782
+ * @function create
1783
+ * @memberof types.MsgSend
1784
+ * @static
1785
+ * @param {types.IMsgSend=} [properties] Properties to set
1786
+ * @returns {types.MsgSend} MsgSend instance
1787
+ */
1788
+ MsgSend.create = function create(properties) {
1789
+ return new MsgSend(properties);
1790
+ };
1791
+
1792
+ /**
1793
+ * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages.
1794
+ * @function encode
1795
+ * @memberof types.MsgSend
1796
+ * @static
1797
+ * @param {types.IMsgSend} message MsgSend message or plain object to encode
1798
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1799
+ * @returns {$protobuf.Writer} Writer
1800
+ */
1801
+ MsgSend.encode = function encode(message, writer) {
1802
+ if (!writer) writer = $Writer.create();
1803
+ if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress"))
1804
+ writer.uint32(/* id 1, wireType 2 =*/ 10).bytes(message.fromAddress);
1805
+ if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress"))
1806
+ writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.toAddress);
1807
+ if (message.amount?.length)
1808
+ for (let i = 0; i < message.amount.length; ++i)
1809
+ $root.cosmos.base.v1beta1.Coin.encode(
1810
+ message.amount[i],
1811
+ writer.uint32(/* id 3, wireType 2 =*/ 26).fork(),
1812
+ ).ldelim();
1813
+ return writer;
1814
+ };
1815
+
1816
+ /**
1817
+ * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages.
1818
+ * @function encodeDelimited
1819
+ * @memberof types.MsgSend
1820
+ * @static
1821
+ * @param {types.IMsgSend} message MsgSend message or plain object to encode
1822
+ * @param {$protobuf.Writer} [writer] Writer to encode to
1823
+ * @returns {$protobuf.Writer} Writer
1824
+ */
1825
+ MsgSend.encodeDelimited = function encodeDelimited(message, writer) {
1826
+ return this.encode(message, writer).ldelim();
1827
+ };
1828
+
1829
+ /**
1830
+ * Decodes a MsgSend message from the specified reader or buffer.
1831
+ * @function decode
1832
+ * @memberof types.MsgSend
1833
+ * @static
1834
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1835
+ * @param {number} [length] Message length if known beforehand
1836
+ * @returns {types.MsgSend} MsgSend
1837
+ * @throws {Error} If the payload is not a reader or valid buffer
1838
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1839
+ */
1840
+ MsgSend.decode = function decode(reader, length) {
1841
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
1842
+ const end = length === undefined ? reader.len : reader.pos + length,
1843
+ message = new $root.types.MsgSend();
1844
+ while (reader.pos < end) {
1845
+ const tag = reader.uint32();
1846
+ switch (tag >>> 3) {
1847
+ case 1:
1848
+ message.fromAddress = reader.bytes();
1849
+ break;
1850
+ case 2:
1851
+ message.toAddress = reader.bytes();
1852
+ break;
1853
+ case 3:
1854
+ if (!message.amount?.length) message.amount = [];
1855
+ message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32()));
1856
+ break;
1857
+ default:
1858
+ reader.skipType(tag & 7);
1859
+ break;
1860
+ }
1861
+ }
1862
+ return message;
1863
+ };
1864
+
1865
+ /**
1866
+ * Decodes a MsgSend message from the specified reader or buffer, length delimited.
1867
+ * @function decodeDelimited
1868
+ * @memberof types.MsgSend
1869
+ * @static
1870
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
1871
+ * @returns {types.MsgSend} MsgSend
1872
+ * @throws {Error} If the payload is not a reader or valid buffer
1873
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
1874
+ */
1875
+ MsgSend.decodeDelimited = function decodeDelimited(reader) {
1876
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
1877
+ return this.decode(reader, reader.uint32());
1878
+ };
1879
+
1880
+ /**
1881
+ * Verifies a MsgSend message.
1882
+ * @function verify
1883
+ * @memberof types.MsgSend
1884
+ * @static
1885
+ * @param {Object.<string,*>} message Plain object to verify
1886
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
1887
+ */
1888
+ MsgSend.verify = function verify(message) {
1889
+ if (typeof message !== "object" || message === null) return "object expected";
1890
+ if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
1891
+ if (
1892
+ !(
1893
+ (message.fromAddress && typeof message.fromAddress.length === "number") ||
1894
+ $util.isString(message.fromAddress)
1895
+ )
1896
+ )
1897
+ return "fromAddress: buffer expected";
1898
+ if (message.toAddress != null && message.hasOwnProperty("toAddress"))
1899
+ if (
1900
+ !(
1901
+ (message.toAddress && typeof message.toAddress.length === "number") ||
1902
+ $util.isString(message.toAddress)
1903
+ )
1904
+ )
1905
+ return "toAddress: buffer expected";
1906
+ if (message.amount != null && message.hasOwnProperty("amount")) {
1907
+ if (!Array.isArray(message.amount)) return "amount: array expected";
1908
+ for (let i = 0; i < message.amount.length; ++i) {
1909
+ const error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]);
1910
+ if (error) return "amount." + error;
1911
+ }
1912
+ }
1913
+ return null;
1914
+ };
1915
+
1916
+ /**
1917
+ * Creates a MsgSend message from a plain object. Also converts values to their respective internal types.
1918
+ * @function fromObject
1919
+ * @memberof types.MsgSend
1920
+ * @static
1921
+ * @param {Object.<string,*>} object Plain object
1922
+ * @returns {types.MsgSend} MsgSend
1923
+ */
1924
+ MsgSend.fromObject = function fromObject(object) {
1925
+ if (object instanceof $root.types.MsgSend) return object;
1926
+ const message = new $root.types.MsgSend();
1927
+ if (object.fromAddress != null)
1928
+ if (typeof object.fromAddress === "string")
1929
+ $util.base64.decode(
1930
+ object.fromAddress,
1931
+ (message.fromAddress = $util.newBuffer($util.base64.length(object.fromAddress))),
1932
+ 0,
1933
+ );
1934
+ else if (object.fromAddress.length) message.fromAddress = object.fromAddress;
1935
+ if (object.toAddress != null)
1936
+ if (typeof object.toAddress === "string")
1937
+ $util.base64.decode(
1938
+ object.toAddress,
1939
+ (message.toAddress = $util.newBuffer($util.base64.length(object.toAddress))),
1940
+ 0,
1941
+ );
1942
+ else if (object.toAddress.length) message.toAddress = object.toAddress;
1943
+ if (object.amount) {
1944
+ if (!Array.isArray(object.amount)) throw TypeError(".types.MsgSend.amount: array expected");
1945
+ message.amount = [];
1946
+ for (let i = 0; i < object.amount.length; ++i) {
1947
+ if (typeof object.amount[i] !== "object")
1948
+ throw TypeError(".types.MsgSend.amount: object expected");
1949
+ message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]);
1950
+ }
1951
+ }
1952
+ return message;
1953
+ };
1954
+
1955
+ /**
1956
+ * Creates a plain object from a MsgSend message. Also converts values to other types if specified.
1957
+ * @function toObject
1958
+ * @memberof types.MsgSend
1959
+ * @static
1960
+ * @param {types.MsgSend} message MsgSend
1961
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
1962
+ * @returns {Object.<string,*>} Plain object
1963
+ */
1964
+ MsgSend.toObject = function toObject(message, options) {
1965
+ if (!options) options = {};
1966
+ const object = {};
1967
+ if (options.arrays || options.defaults) object.amount = [];
1968
+ if (options.defaults) {
1969
+ if (options.bytes === String) object.fromAddress = "";
1970
+ else {
1971
+ object.fromAddress = [];
1972
+ if (options.bytes !== Array) object.fromAddress = $util.newBuffer(object.fromAddress);
1973
+ }
1974
+ if (options.bytes === String) object.toAddress = "";
1975
+ else {
1976
+ object.toAddress = [];
1977
+ if (options.bytes !== Array) object.toAddress = $util.newBuffer(object.toAddress);
1978
+ }
1979
+ }
1980
+ if (message.fromAddress != null && message.hasOwnProperty("fromAddress"))
1981
+ object.fromAddress =
1982
+ options.bytes === String
1983
+ ? $util.base64.encode(message.fromAddress, 0, message.fromAddress.length)
1984
+ : options.bytes === Array
1985
+ ? Array.prototype.slice.call(message.fromAddress)
1986
+ : message.fromAddress;
1987
+ if (message.toAddress != null && message.hasOwnProperty("toAddress"))
1988
+ object.toAddress =
1989
+ options.bytes === String
1990
+ ? $util.base64.encode(message.toAddress, 0, message.toAddress.length)
1991
+ : options.bytes === Array
1992
+ ? Array.prototype.slice.call(message.toAddress)
1993
+ : message.toAddress;
1994
+ if (message.amount?.length) {
1995
+ object.amount = [];
1996
+ for (let j = 0; j < message.amount.length; ++j)
1997
+ object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options);
1998
+ }
1999
+ return object;
2000
+ };
2001
+
2002
+ /**
2003
+ * Converts this MsgSend to JSON.
2004
+ * @function toJSON
2005
+ * @memberof types.MsgSend
2006
+ * @instance
2007
+ * @returns {Object.<string,*>} JSON object
2008
+ */
2009
+ MsgSend.prototype.toJSON = function toJSON() {
2010
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2011
+ };
2012
+
2013
+ return MsgSend;
2014
+ })();
2015
+
2016
+ return types;
2017
+ })();
2018
+
2019
+ $root.cosmos = (() => {
2020
+ /**
2021
+ * Namespace cosmos.
2022
+ * @exports cosmos
2023
+ * @namespace
2024
+ */
2025
+ const cosmos = {};
2026
+
2027
+ cosmos.base = (() => {
2028
+ /**
2029
+ * Namespace base.
2030
+ * @memberof cosmos
2031
+ * @namespace
2032
+ */
2033
+ const base = {};
2034
+
2035
+ base.v1beta1 = (() => {
2036
+ /**
2037
+ * Namespace v1beta1.
2038
+ * @memberof cosmos.base
2039
+ * @namespace
2040
+ */
2041
+ const v1beta1 = {};
2042
+
2043
+ v1beta1.Coin = (() => {
2044
+ /**
2045
+ * Properties of a Coin.
2046
+ * @memberof cosmos.base.v1beta1
2047
+ * @interface ICoin
2048
+ * @property {string|null} [denom] Coin denom
2049
+ * @property {string|null} [amount] Coin amount
2050
+ */
2051
+
2052
+ /**
2053
+ * Constructs a new Coin.
2054
+ * @memberof cosmos.base.v1beta1
2055
+ * @classdesc Represents a Coin.
2056
+ * @implements ICoin
2057
+ * @constructor
2058
+ * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set
2059
+ */
2060
+ function Coin(properties) {
2061
+ if (properties)
2062
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2063
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
2064
+ }
2065
+
2066
+ /**
2067
+ * Coin denom.
2068
+ * @member {string} denom
2069
+ * @memberof cosmos.base.v1beta1.Coin
2070
+ * @instance
2071
+ */
2072
+ Coin.prototype.denom = "";
2073
+
2074
+ /**
2075
+ * Coin amount.
2076
+ * @member {string} amount
2077
+ * @memberof cosmos.base.v1beta1.Coin
2078
+ * @instance
2079
+ */
2080
+ Coin.prototype.amount = "";
2081
+
2082
+ /**
2083
+ * Creates a new Coin instance using the specified properties.
2084
+ * @function create
2085
+ * @memberof cosmos.base.v1beta1.Coin
2086
+ * @static
2087
+ * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set
2088
+ * @returns {cosmos.base.v1beta1.Coin} Coin instance
2089
+ */
2090
+ Coin.create = function create(properties) {
2091
+ return new Coin(properties);
2092
+ };
2093
+
2094
+ /**
2095
+ * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages.
2096
+ * @function encode
2097
+ * @memberof cosmos.base.v1beta1.Coin
2098
+ * @static
2099
+ * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode
2100
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2101
+ * @returns {$protobuf.Writer} Writer
2102
+ */
2103
+ Coin.encode = function encode(message, writer) {
2104
+ if (!writer) writer = $Writer.create();
2105
+ if (message.denom != null && Object.hasOwnProperty.call(message, "denom"))
2106
+ writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.denom);
2107
+ if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
2108
+ writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.amount);
2109
+ return writer;
2110
+ };
2111
+
2112
+ /**
2113
+ * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages.
2114
+ * @function encodeDelimited
2115
+ * @memberof cosmos.base.v1beta1.Coin
2116
+ * @static
2117
+ * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode
2118
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2119
+ * @returns {$protobuf.Writer} Writer
2120
+ */
2121
+ Coin.encodeDelimited = function encodeDelimited(message, writer) {
2122
+ return this.encode(message, writer).ldelim();
2123
+ };
2124
+
2125
+ /**
2126
+ * Decodes a Coin message from the specified reader or buffer.
2127
+ * @function decode
2128
+ * @memberof cosmos.base.v1beta1.Coin
2129
+ * @static
2130
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2131
+ * @param {number} [length] Message length if known beforehand
2132
+ * @returns {cosmos.base.v1beta1.Coin} Coin
2133
+ * @throws {Error} If the payload is not a reader or valid buffer
2134
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2135
+ */
2136
+ Coin.decode = function decode(reader, length) {
2137
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
2138
+ const end = length === undefined ? reader.len : reader.pos + length,
2139
+ message = new $root.cosmos.base.v1beta1.Coin();
2140
+ while (reader.pos < end) {
2141
+ const tag = reader.uint32();
2142
+ switch (tag >>> 3) {
2143
+ case 1:
2144
+ message.denom = reader.string();
2145
+ break;
2146
+ case 2:
2147
+ message.amount = reader.string();
2148
+ break;
2149
+ default:
2150
+ reader.skipType(tag & 7);
2151
+ break;
2152
+ }
2153
+ }
2154
+ return message;
2155
+ };
2156
+
2157
+ /**
2158
+ * Decodes a Coin message from the specified reader or buffer, length delimited.
2159
+ * @function decodeDelimited
2160
+ * @memberof cosmos.base.v1beta1.Coin
2161
+ * @static
2162
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2163
+ * @returns {cosmos.base.v1beta1.Coin} Coin
2164
+ * @throws {Error} If the payload is not a reader or valid buffer
2165
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2166
+ */
2167
+ Coin.decodeDelimited = function decodeDelimited(reader) {
2168
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
2169
+ return this.decode(reader, reader.uint32());
2170
+ };
2171
+
2172
+ /**
2173
+ * Verifies a Coin message.
2174
+ * @function verify
2175
+ * @memberof cosmos.base.v1beta1.Coin
2176
+ * @static
2177
+ * @param {Object.<string,*>} message Plain object to verify
2178
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2179
+ */
2180
+ Coin.verify = function verify(message) {
2181
+ if (typeof message !== "object" || message === null) return "object expected";
2182
+ if (message.denom != null && message.hasOwnProperty("denom"))
2183
+ if (!$util.isString(message.denom)) return "denom: string expected";
2184
+ if (message.amount != null && message.hasOwnProperty("amount"))
2185
+ if (!$util.isString(message.amount)) return "amount: string expected";
2186
+ return null;
2187
+ };
2188
+
2189
+ /**
2190
+ * Creates a Coin message from a plain object. Also converts values to their respective internal types.
2191
+ * @function fromObject
2192
+ * @memberof cosmos.base.v1beta1.Coin
2193
+ * @static
2194
+ * @param {Object.<string,*>} object Plain object
2195
+ * @returns {cosmos.base.v1beta1.Coin} Coin
2196
+ */
2197
+ Coin.fromObject = function fromObject(object) {
2198
+ if (object instanceof $root.cosmos.base.v1beta1.Coin) return object;
2199
+ const message = new $root.cosmos.base.v1beta1.Coin();
2200
+ if (object.denom != null) message.denom = String(object.denom);
2201
+ if (object.amount != null) message.amount = String(object.amount);
2202
+ return message;
2203
+ };
2204
+
2205
+ /**
2206
+ * Creates a plain object from a Coin message. Also converts values to other types if specified.
2207
+ * @function toObject
2208
+ * @memberof cosmos.base.v1beta1.Coin
2209
+ * @static
2210
+ * @param {cosmos.base.v1beta1.Coin} message Coin
2211
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2212
+ * @returns {Object.<string,*>} Plain object
2213
+ */
2214
+ Coin.toObject = function toObject(message, options) {
2215
+ if (!options) options = {};
2216
+ const object = {};
2217
+ if (options.defaults) {
2218
+ object.denom = "";
2219
+ object.amount = "";
2220
+ }
2221
+ if (message.denom != null && message.hasOwnProperty("denom"))
2222
+ object.denom = message.denom;
2223
+ if (message.amount != null && message.hasOwnProperty("amount"))
2224
+ object.amount = message.amount;
2225
+ return object;
2226
+ };
2227
+
2228
+ /**
2229
+ * Converts this Coin to JSON.
2230
+ * @function toJSON
2231
+ * @memberof cosmos.base.v1beta1.Coin
2232
+ * @instance
2233
+ * @returns {Object.<string,*>} JSON object
2234
+ */
2235
+ Coin.prototype.toJSON = function toJSON() {
2236
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2237
+ };
2238
+
2239
+ return Coin;
2240
+ })();
2241
+
2242
+ v1beta1.DecCoin = (() => {
2243
+ /**
2244
+ * Properties of a DecCoin.
2245
+ * @memberof cosmos.base.v1beta1
2246
+ * @interface IDecCoin
2247
+ * @property {string|null} [denom] DecCoin denom
2248
+ * @property {string|null} [amount] DecCoin amount
2249
+ */
2250
+
2251
+ /**
2252
+ * Constructs a new DecCoin.
2253
+ * @memberof cosmos.base.v1beta1
2254
+ * @classdesc Represents a DecCoin.
2255
+ * @implements IDecCoin
2256
+ * @constructor
2257
+ * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set
2258
+ */
2259
+ function DecCoin(properties) {
2260
+ if (properties)
2261
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2262
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
2263
+ }
2264
+
2265
+ /**
2266
+ * DecCoin denom.
2267
+ * @member {string} denom
2268
+ * @memberof cosmos.base.v1beta1.DecCoin
2269
+ * @instance
2270
+ */
2271
+ DecCoin.prototype.denom = "";
2272
+
2273
+ /**
2274
+ * DecCoin amount.
2275
+ * @member {string} amount
2276
+ * @memberof cosmos.base.v1beta1.DecCoin
2277
+ * @instance
2278
+ */
2279
+ DecCoin.prototype.amount = "";
2280
+
2281
+ /**
2282
+ * Creates a new DecCoin instance using the specified properties.
2283
+ * @function create
2284
+ * @memberof cosmos.base.v1beta1.DecCoin
2285
+ * @static
2286
+ * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set
2287
+ * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance
2288
+ */
2289
+ DecCoin.create = function create(properties) {
2290
+ return new DecCoin(properties);
2291
+ };
2292
+
2293
+ /**
2294
+ * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages.
2295
+ * @function encode
2296
+ * @memberof cosmos.base.v1beta1.DecCoin
2297
+ * @static
2298
+ * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode
2299
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2300
+ * @returns {$protobuf.Writer} Writer
2301
+ */
2302
+ DecCoin.encode = function encode(message, writer) {
2303
+ if (!writer) writer = $Writer.create();
2304
+ if (message.denom != null && Object.hasOwnProperty.call(message, "denom"))
2305
+ writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.denom);
2306
+ if (message.amount != null && Object.hasOwnProperty.call(message, "amount"))
2307
+ writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.amount);
2308
+ return writer;
2309
+ };
2310
+
2311
+ /**
2312
+ * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages.
2313
+ * @function encodeDelimited
2314
+ * @memberof cosmos.base.v1beta1.DecCoin
2315
+ * @static
2316
+ * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode
2317
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2318
+ * @returns {$protobuf.Writer} Writer
2319
+ */
2320
+ DecCoin.encodeDelimited = function encodeDelimited(message, writer) {
2321
+ return this.encode(message, writer).ldelim();
2322
+ };
2323
+
2324
+ /**
2325
+ * Decodes a DecCoin message from the specified reader or buffer.
2326
+ * @function decode
2327
+ * @memberof cosmos.base.v1beta1.DecCoin
2328
+ * @static
2329
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2330
+ * @param {number} [length] Message length if known beforehand
2331
+ * @returns {cosmos.base.v1beta1.DecCoin} DecCoin
2332
+ * @throws {Error} If the payload is not a reader or valid buffer
2333
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2334
+ */
2335
+ DecCoin.decode = function decode(reader, length) {
2336
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
2337
+ const end = length === undefined ? reader.len : reader.pos + length,
2338
+ message = new $root.cosmos.base.v1beta1.DecCoin();
2339
+ while (reader.pos < end) {
2340
+ const tag = reader.uint32();
2341
+ switch (tag >>> 3) {
2342
+ case 1:
2343
+ message.denom = reader.string();
2344
+ break;
2345
+ case 2:
2346
+ message.amount = reader.string();
2347
+ break;
2348
+ default:
2349
+ reader.skipType(tag & 7);
2350
+ break;
2351
+ }
2352
+ }
2353
+ return message;
2354
+ };
2355
+
2356
+ /**
2357
+ * Decodes a DecCoin message from the specified reader or buffer, length delimited.
2358
+ * @function decodeDelimited
2359
+ * @memberof cosmos.base.v1beta1.DecCoin
2360
+ * @static
2361
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2362
+ * @returns {cosmos.base.v1beta1.DecCoin} DecCoin
2363
+ * @throws {Error} If the payload is not a reader or valid buffer
2364
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2365
+ */
2366
+ DecCoin.decodeDelimited = function decodeDelimited(reader) {
2367
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
2368
+ return this.decode(reader, reader.uint32());
2369
+ };
2370
+
2371
+ /**
2372
+ * Verifies a DecCoin message.
2373
+ * @function verify
2374
+ * @memberof cosmos.base.v1beta1.DecCoin
2375
+ * @static
2376
+ * @param {Object.<string,*>} message Plain object to verify
2377
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2378
+ */
2379
+ DecCoin.verify = function verify(message) {
2380
+ if (typeof message !== "object" || message === null) return "object expected";
2381
+ if (message.denom != null && message.hasOwnProperty("denom"))
2382
+ if (!$util.isString(message.denom)) return "denom: string expected";
2383
+ if (message.amount != null && message.hasOwnProperty("amount"))
2384
+ if (!$util.isString(message.amount)) return "amount: string expected";
2385
+ return null;
2386
+ };
2387
+
2388
+ /**
2389
+ * Creates a DecCoin message from a plain object. Also converts values to their respective internal types.
2390
+ * @function fromObject
2391
+ * @memberof cosmos.base.v1beta1.DecCoin
2392
+ * @static
2393
+ * @param {Object.<string,*>} object Plain object
2394
+ * @returns {cosmos.base.v1beta1.DecCoin} DecCoin
2395
+ */
2396
+ DecCoin.fromObject = function fromObject(object) {
2397
+ if (object instanceof $root.cosmos.base.v1beta1.DecCoin) return object;
2398
+ const message = new $root.cosmos.base.v1beta1.DecCoin();
2399
+ if (object.denom != null) message.denom = String(object.denom);
2400
+ if (object.amount != null) message.amount = String(object.amount);
2401
+ return message;
2402
+ };
2403
+
2404
+ /**
2405
+ * Creates a plain object from a DecCoin message. Also converts values to other types if specified.
2406
+ * @function toObject
2407
+ * @memberof cosmos.base.v1beta1.DecCoin
2408
+ * @static
2409
+ * @param {cosmos.base.v1beta1.DecCoin} message DecCoin
2410
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2411
+ * @returns {Object.<string,*>} Plain object
2412
+ */
2413
+ DecCoin.toObject = function toObject(message, options) {
2414
+ if (!options) options = {};
2415
+ const object = {};
2416
+ if (options.defaults) {
2417
+ object.denom = "";
2418
+ object.amount = "";
2419
+ }
2420
+ if (message.denom != null && message.hasOwnProperty("denom"))
2421
+ object.denom = message.denom;
2422
+ if (message.amount != null && message.hasOwnProperty("amount"))
2423
+ object.amount = message.amount;
2424
+ return object;
2425
+ };
2426
+
2427
+ /**
2428
+ * Converts this DecCoin to JSON.
2429
+ * @function toJSON
2430
+ * @memberof cosmos.base.v1beta1.DecCoin
2431
+ * @instance
2432
+ * @returns {Object.<string,*>} JSON object
2433
+ */
2434
+ DecCoin.prototype.toJSON = function toJSON() {
2435
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2436
+ };
2437
+
2438
+ return DecCoin;
2439
+ })();
2440
+
2441
+ v1beta1.IntProto = (() => {
2442
+ /**
2443
+ * Properties of an IntProto.
2444
+ * @memberof cosmos.base.v1beta1
2445
+ * @interface IIntProto
2446
+ * @property {string|null} [int] IntProto int
2447
+ */
2448
+
2449
+ /**
2450
+ * Constructs a new IntProto.
2451
+ * @memberof cosmos.base.v1beta1
2452
+ * @classdesc Represents an IntProto.
2453
+ * @implements IIntProto
2454
+ * @constructor
2455
+ * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set
2456
+ */
2457
+ function IntProto(properties) {
2458
+ if (properties)
2459
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2460
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
2461
+ }
2462
+
2463
+ /**
2464
+ * IntProto int.
2465
+ * @member {string} int
2466
+ * @memberof cosmos.base.v1beta1.IntProto
2467
+ * @instance
2468
+ */
2469
+ IntProto.prototype.int = "";
2470
+
2471
+ /**
2472
+ * Creates a new IntProto instance using the specified properties.
2473
+ * @function create
2474
+ * @memberof cosmos.base.v1beta1.IntProto
2475
+ * @static
2476
+ * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set
2477
+ * @returns {cosmos.base.v1beta1.IntProto} IntProto instance
2478
+ */
2479
+ IntProto.create = function create(properties) {
2480
+ return new IntProto(properties);
2481
+ };
2482
+
2483
+ /**
2484
+ * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages.
2485
+ * @function encode
2486
+ * @memberof cosmos.base.v1beta1.IntProto
2487
+ * @static
2488
+ * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode
2489
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2490
+ * @returns {$protobuf.Writer} Writer
2491
+ */
2492
+ IntProto.encode = function encode(message, writer) {
2493
+ if (!writer) writer = $Writer.create();
2494
+ if (message.int != null && Object.hasOwnProperty.call(message, "int"))
2495
+ writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.int);
2496
+ return writer;
2497
+ };
2498
+
2499
+ /**
2500
+ * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages.
2501
+ * @function encodeDelimited
2502
+ * @memberof cosmos.base.v1beta1.IntProto
2503
+ * @static
2504
+ * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode
2505
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2506
+ * @returns {$protobuf.Writer} Writer
2507
+ */
2508
+ IntProto.encodeDelimited = function encodeDelimited(message, writer) {
2509
+ return this.encode(message, writer).ldelim();
2510
+ };
2511
+
2512
+ /**
2513
+ * Decodes an IntProto message from the specified reader or buffer.
2514
+ * @function decode
2515
+ * @memberof cosmos.base.v1beta1.IntProto
2516
+ * @static
2517
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2518
+ * @param {number} [length] Message length if known beforehand
2519
+ * @returns {cosmos.base.v1beta1.IntProto} IntProto
2520
+ * @throws {Error} If the payload is not a reader or valid buffer
2521
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2522
+ */
2523
+ IntProto.decode = function decode(reader, length) {
2524
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
2525
+ const end = length === undefined ? reader.len : reader.pos + length,
2526
+ message = new $root.cosmos.base.v1beta1.IntProto();
2527
+ while (reader.pos < end) {
2528
+ const tag = reader.uint32();
2529
+ switch (tag >>> 3) {
2530
+ case 1:
2531
+ message.int = reader.string();
2532
+ break;
2533
+ default:
2534
+ reader.skipType(tag & 7);
2535
+ break;
2536
+ }
2537
+ }
2538
+ return message;
2539
+ };
2540
+
2541
+ /**
2542
+ * Decodes an IntProto message from the specified reader or buffer, length delimited.
2543
+ * @function decodeDelimited
2544
+ * @memberof cosmos.base.v1beta1.IntProto
2545
+ * @static
2546
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2547
+ * @returns {cosmos.base.v1beta1.IntProto} IntProto
2548
+ * @throws {Error} If the payload is not a reader or valid buffer
2549
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2550
+ */
2551
+ IntProto.decodeDelimited = function decodeDelimited(reader) {
2552
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
2553
+ return this.decode(reader, reader.uint32());
2554
+ };
2555
+
2556
+ /**
2557
+ * Verifies an IntProto message.
2558
+ * @function verify
2559
+ * @memberof cosmos.base.v1beta1.IntProto
2560
+ * @static
2561
+ * @param {Object.<string,*>} message Plain object to verify
2562
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2563
+ */
2564
+ IntProto.verify = function verify(message) {
2565
+ if (typeof message !== "object" || message === null) return "object expected";
2566
+ if (message.int != null && message.hasOwnProperty("int"))
2567
+ if (!$util.isString(message.int)) return "int: string expected";
2568
+ return null;
2569
+ };
2570
+
2571
+ /**
2572
+ * Creates an IntProto message from a plain object. Also converts values to their respective internal types.
2573
+ * @function fromObject
2574
+ * @memberof cosmos.base.v1beta1.IntProto
2575
+ * @static
2576
+ * @param {Object.<string,*>} object Plain object
2577
+ * @returns {cosmos.base.v1beta1.IntProto} IntProto
2578
+ */
2579
+ IntProto.fromObject = function fromObject(object) {
2580
+ if (object instanceof $root.cosmos.base.v1beta1.IntProto) return object;
2581
+ const message = new $root.cosmos.base.v1beta1.IntProto();
2582
+ if (object.int != null) message.int = String(object.int);
2583
+ return message;
2584
+ };
2585
+
2586
+ /**
2587
+ * Creates a plain object from an IntProto message. Also converts values to other types if specified.
2588
+ * @function toObject
2589
+ * @memberof cosmos.base.v1beta1.IntProto
2590
+ * @static
2591
+ * @param {cosmos.base.v1beta1.IntProto} message IntProto
2592
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2593
+ * @returns {Object.<string,*>} Plain object
2594
+ */
2595
+ IntProto.toObject = function toObject(message, options) {
2596
+ if (!options) options = {};
2597
+ const object = {};
2598
+ if (options.defaults) object.int = "";
2599
+ if (message.int != null && message.hasOwnProperty("int")) object.int = message.int;
2600
+ return object;
2601
+ };
2602
+
2603
+ /**
2604
+ * Converts this IntProto to JSON.
2605
+ * @function toJSON
2606
+ * @memberof cosmos.base.v1beta1.IntProto
2607
+ * @instance
2608
+ * @returns {Object.<string,*>} JSON object
2609
+ */
2610
+ IntProto.prototype.toJSON = function toJSON() {
2611
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2612
+ };
2613
+
2614
+ return IntProto;
2615
+ })();
2616
+
2617
+ v1beta1.DecProto = (() => {
2618
+ /**
2619
+ * Properties of a DecProto.
2620
+ * @memberof cosmos.base.v1beta1
2621
+ * @interface IDecProto
2622
+ * @property {string|null} [dec] DecProto dec
2623
+ */
2624
+
2625
+ /**
2626
+ * Constructs a new DecProto.
2627
+ * @memberof cosmos.base.v1beta1
2628
+ * @classdesc Represents a DecProto.
2629
+ * @implements IDecProto
2630
+ * @constructor
2631
+ * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set
2632
+ */
2633
+ function DecProto(properties) {
2634
+ if (properties)
2635
+ for (let keys = Object.keys(properties), i = 0; i < keys.length; ++i)
2636
+ if (properties[keys[i]] != null) this[keys[i]] = properties[keys[i]];
2637
+ }
2638
+
2639
+ /**
2640
+ * DecProto dec.
2641
+ * @member {string} dec
2642
+ * @memberof cosmos.base.v1beta1.DecProto
2643
+ * @instance
2644
+ */
2645
+ DecProto.prototype.dec = "";
2646
+
2647
+ /**
2648
+ * Creates a new DecProto instance using the specified properties.
2649
+ * @function create
2650
+ * @memberof cosmos.base.v1beta1.DecProto
2651
+ * @static
2652
+ * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set
2653
+ * @returns {cosmos.base.v1beta1.DecProto} DecProto instance
2654
+ */
2655
+ DecProto.create = function create(properties) {
2656
+ return new DecProto(properties);
2657
+ };
2658
+
2659
+ /**
2660
+ * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages.
2661
+ * @function encode
2662
+ * @memberof cosmos.base.v1beta1.DecProto
2663
+ * @static
2664
+ * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode
2665
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2666
+ * @returns {$protobuf.Writer} Writer
2667
+ */
2668
+ DecProto.encode = function encode(message, writer) {
2669
+ if (!writer) writer = $Writer.create();
2670
+ if (message.dec != null && Object.hasOwnProperty.call(message, "dec"))
2671
+ writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.dec);
2672
+ return writer;
2673
+ };
2674
+
2675
+ /**
2676
+ * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages.
2677
+ * @function encodeDelimited
2678
+ * @memberof cosmos.base.v1beta1.DecProto
2679
+ * @static
2680
+ * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode
2681
+ * @param {$protobuf.Writer} [writer] Writer to encode to
2682
+ * @returns {$protobuf.Writer} Writer
2683
+ */
2684
+ DecProto.encodeDelimited = function encodeDelimited(message, writer) {
2685
+ return this.encode(message, writer).ldelim();
2686
+ };
2687
+
2688
+ /**
2689
+ * Decodes a DecProto message from the specified reader or buffer.
2690
+ * @function decode
2691
+ * @memberof cosmos.base.v1beta1.DecProto
2692
+ * @static
2693
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2694
+ * @param {number} [length] Message length if known beforehand
2695
+ * @returns {cosmos.base.v1beta1.DecProto} DecProto
2696
+ * @throws {Error} If the payload is not a reader or valid buffer
2697
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2698
+ */
2699
+ DecProto.decode = function decode(reader, length) {
2700
+ if (!(reader instanceof $Reader)) reader = $Reader.create(reader);
2701
+ const end = length === undefined ? reader.len : reader.pos + length,
2702
+ message = new $root.cosmos.base.v1beta1.DecProto();
2703
+ while (reader.pos < end) {
2704
+ const tag = reader.uint32();
2705
+ switch (tag >>> 3) {
2706
+ case 1:
2707
+ message.dec = reader.string();
2708
+ break;
2709
+ default:
2710
+ reader.skipType(tag & 7);
2711
+ break;
2712
+ }
2713
+ }
2714
+ return message;
2715
+ };
2716
+
2717
+ /**
2718
+ * Decodes a DecProto message from the specified reader or buffer, length delimited.
2719
+ * @function decodeDelimited
2720
+ * @memberof cosmos.base.v1beta1.DecProto
2721
+ * @static
2722
+ * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
2723
+ * @returns {cosmos.base.v1beta1.DecProto} DecProto
2724
+ * @throws {Error} If the payload is not a reader or valid buffer
2725
+ * @throws {$protobuf.util.ProtocolError} If required fields are missing
2726
+ */
2727
+ DecProto.decodeDelimited = function decodeDelimited(reader) {
2728
+ if (!(reader instanceof $Reader)) reader = new $Reader(reader);
2729
+ return this.decode(reader, reader.uint32());
2730
+ };
2731
+
2732
+ /**
2733
+ * Verifies a DecProto message.
2734
+ * @function verify
2735
+ * @memberof cosmos.base.v1beta1.DecProto
2736
+ * @static
2737
+ * @param {Object.<string,*>} message Plain object to verify
2738
+ * @returns {string|null} `null` if valid, otherwise the reason why it is not
2739
+ */
2740
+ DecProto.verify = function verify(message) {
2741
+ if (typeof message !== "object" || message === null) return "object expected";
2742
+ if (message.dec != null && message.hasOwnProperty("dec"))
2743
+ if (!$util.isString(message.dec)) return "dec: string expected";
2744
+ return null;
2745
+ };
2746
+
2747
+ /**
2748
+ * Creates a DecProto message from a plain object. Also converts values to their respective internal types.
2749
+ * @function fromObject
2750
+ * @memberof cosmos.base.v1beta1.DecProto
2751
+ * @static
2752
+ * @param {Object.<string,*>} object Plain object
2753
+ * @returns {cosmos.base.v1beta1.DecProto} DecProto
2754
+ */
2755
+ DecProto.fromObject = function fromObject(object) {
2756
+ if (object instanceof $root.cosmos.base.v1beta1.DecProto) return object;
2757
+ const message = new $root.cosmos.base.v1beta1.DecProto();
2758
+ if (object.dec != null) message.dec = String(object.dec);
2759
+ return message;
2760
+ };
2761
+
2762
+ /**
2763
+ * Creates a plain object from a DecProto message. Also converts values to other types if specified.
2764
+ * @function toObject
2765
+ * @memberof cosmos.base.v1beta1.DecProto
2766
+ * @static
2767
+ * @param {cosmos.base.v1beta1.DecProto} message DecProto
2768
+ * @param {$protobuf.IConversionOptions} [options] Conversion options
2769
+ * @returns {Object.<string,*>} Plain object
2770
+ */
2771
+ DecProto.toObject = function toObject(message, options) {
2772
+ if (!options) options = {};
2773
+ const object = {};
2774
+ if (options.defaults) object.dec = "";
2775
+ if (message.dec != null && message.hasOwnProperty("dec")) object.dec = message.dec;
2776
+ return object;
2777
+ };
2778
+
2779
+ /**
2780
+ * Converts this DecProto to JSON.
2781
+ * @function toJSON
2782
+ * @memberof cosmos.base.v1beta1.DecProto
2783
+ * @instance
2784
+ * @returns {Object.<string,*>} JSON object
2785
+ */
2786
+ DecProto.prototype.toJSON = function toJSON() {
2787
+ return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
2788
+ };
2789
+
2790
+ return DecProto;
2791
+ })();
2792
+
2793
+ return v1beta1;
2794
+ })();
2795
+
2796
+ return base;
2797
+ })();
2798
+
2799
+ return cosmos;
2800
+ })();