tronwb 6.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (318) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +201 -0
  3. package/dist/TronWeb.js +3 -0
  4. package/dist/TronWeb.js.LICENSE.txt +12 -0
  5. package/dist/TronWeb.js.map +1 -0
  6. package/dist/TronWeb.node.js +2 -0
  7. package/dist/TronWeb.node.js.map +1 -0
  8. package/kj9btptx.cjs +1 -0
  9. package/lib/commonjs/index.d.ts +64 -0
  10. package/lib/commonjs/index.js +37 -0
  11. package/lib/commonjs/index.js.map +1 -0
  12. package/lib/commonjs/lib/TransactionBuilder/TransactionBuilder.d.ts +127 -0
  13. package/lib/commonjs/lib/TransactionBuilder/TransactionBuilder.js +1771 -0
  14. package/lib/commonjs/lib/TransactionBuilder/TransactionBuilder.js.map +1 -0
  15. package/lib/commonjs/lib/TransactionBuilder/helper.d.ts +28 -0
  16. package/lib/commonjs/lib/TransactionBuilder/helper.js +122 -0
  17. package/lib/commonjs/lib/TransactionBuilder/helper.js.map +1 -0
  18. package/lib/commonjs/lib/contract/index.d.ts +29 -0
  19. package/lib/commonjs/lib/contract/index.js +124 -0
  20. package/lib/commonjs/lib/contract/index.js.map +1 -0
  21. package/lib/commonjs/lib/contract/method.d.ts +50 -0
  22. package/lib/commonjs/lib/contract/method.js +238 -0
  23. package/lib/commonjs/lib/contract/method.js.map +1 -0
  24. package/lib/commonjs/lib/event.d.ts +85 -0
  25. package/lib/commonjs/lib/event.js +137 -0
  26. package/lib/commonjs/lib/event.js.map +1 -0
  27. package/lib/commonjs/lib/plugin.d.ts +28 -0
  28. package/lib/commonjs/lib/plugin.js +84 -0
  29. package/lib/commonjs/lib/plugin.js.map +1 -0
  30. package/lib/commonjs/lib/providers/HttpProvider.d.ts +15 -0
  31. package/lib/commonjs/lib/providers/HttpProvider.js +63 -0
  32. package/lib/commonjs/lib/providers/HttpProvider.js.map +1 -0
  33. package/lib/commonjs/lib/providers/index.d.ts +6 -0
  34. package/lib/commonjs/lib/providers/index.js +8 -0
  35. package/lib/commonjs/lib/providers/index.js.map +1 -0
  36. package/lib/commonjs/lib/trx.d.ts +315 -0
  37. package/lib/commonjs/lib/trx.js +965 -0
  38. package/lib/commonjs/lib/trx.js.map +1 -0
  39. package/lib/commonjs/package.json +1 -0
  40. package/lib/commonjs/paramValidator/index.d.ts +19 -0
  41. package/lib/commonjs/paramValidator/index.js +110 -0
  42. package/lib/commonjs/paramValidator/index.js.map +1 -0
  43. package/lib/commonjs/protocol/core/Tron_pb.cjs +7524 -0
  44. package/lib/commonjs/protocol/core/contract/account_contract_pb.cjs +961 -0
  45. package/lib/commonjs/protocol/core/contract/asset_issue_contract_pb.cjs +2196 -0
  46. package/lib/commonjs/protocol/core/contract/balance_contract_pb.cjs +3826 -0
  47. package/lib/commonjs/protocol/core/contract/common_pb.cjs +34 -0
  48. package/lib/commonjs/protocol/core/contract/exchange_contract_pb.cjs +1268 -0
  49. package/lib/commonjs/protocol/core/contract/proposal_contract_pb.cjs +675 -0
  50. package/lib/commonjs/protocol/core/contract/smart_contract_pb.cjs +2960 -0
  51. package/lib/commonjs/protocol/core/contract/storage_contract_pb.cjs +848 -0
  52. package/lib/commonjs/protocol/core/contract/vote_asset_contract_pb.cjs +340 -0
  53. package/lib/commonjs/protocol/core/contract/witness_contract_pb.cjs +956 -0
  54. package/lib/commonjs/tronweb.d.ts +111 -0
  55. package/lib/commonjs/tronweb.js +365 -0
  56. package/lib/commonjs/tronweb.js.map +1 -0
  57. package/lib/commonjs/types/ABI.d.ts +59 -0
  58. package/lib/commonjs/types/ABI.js +3 -0
  59. package/lib/commonjs/types/ABI.js.map +1 -0
  60. package/lib/commonjs/types/APIResponse.d.ts +31 -0
  61. package/lib/commonjs/types/APIResponse.js +3 -0
  62. package/lib/commonjs/types/APIResponse.js.map +1 -0
  63. package/lib/commonjs/types/Contract.d.ts +287 -0
  64. package/lib/commonjs/types/Contract.js +63 -0
  65. package/lib/commonjs/types/Contract.js.map +1 -0
  66. package/lib/commonjs/types/Providers.d.ts +8 -0
  67. package/lib/commonjs/types/Providers.js +3 -0
  68. package/lib/commonjs/types/Providers.js.map +1 -0
  69. package/lib/commonjs/types/Transaction.d.ts +65 -0
  70. package/lib/commonjs/types/Transaction.js +3 -0
  71. package/lib/commonjs/types/Transaction.js.map +1 -0
  72. package/lib/commonjs/types/TransactionBuilder.d.ts +270 -0
  73. package/lib/commonjs/types/TransactionBuilder.js +3 -0
  74. package/lib/commonjs/types/TransactionBuilder.js.map +1 -0
  75. package/lib/commonjs/types/TronWeb.d.ts +20 -0
  76. package/lib/commonjs/types/TronWeb.js +3 -0
  77. package/lib/commonjs/types/TronWeb.js.map +1 -0
  78. package/lib/commonjs/types/Trx.d.ts +263 -0
  79. package/lib/commonjs/types/Trx.js +42 -0
  80. package/lib/commonjs/types/Trx.js.map +1 -0
  81. package/lib/commonjs/types/UtilsTypes.d.ts +23 -0
  82. package/lib/commonjs/types/UtilsTypes.js +3 -0
  83. package/lib/commonjs/types/UtilsTypes.js.map +1 -0
  84. package/lib/commonjs/types/index.d.ts +9 -0
  85. package/lib/commonjs/types/index.js +13 -0
  86. package/lib/commonjs/types/index.js.map +1 -0
  87. package/lib/commonjs/utils/abi.d.ts +5 -0
  88. package/lib/commonjs/utils/abi.js +251 -0
  89. package/lib/commonjs/utils/abi.js.map +1 -0
  90. package/lib/commonjs/utils/accounts.d.ts +22 -0
  91. package/lib/commonjs/utils/accounts.js +51 -0
  92. package/lib/commonjs/utils/accounts.js.map +1 -0
  93. package/lib/commonjs/utils/address.d.ts +12 -0
  94. package/lib/commonjs/utils/address.js +91 -0
  95. package/lib/commonjs/utils/address.js.map +1 -0
  96. package/lib/commonjs/utils/base58.d.ts +3 -0
  97. package/lib/commonjs/utils/base58.js +68 -0
  98. package/lib/commonjs/utils/base58.js.map +1 -0
  99. package/lib/commonjs/utils/base64.d.ts +10 -0
  100. package/lib/commonjs/utils/base64.js +173 -0
  101. package/lib/commonjs/utils/base64.js.map +1 -0
  102. package/lib/commonjs/utils/bytes.d.ts +7 -0
  103. package/lib/commonjs/utils/bytes.js +61 -0
  104. package/lib/commonjs/utils/bytes.js.map +1 -0
  105. package/lib/commonjs/utils/code.d.ts +12 -0
  106. package/lib/commonjs/utils/code.js +166 -0
  107. package/lib/commonjs/utils/code.js.map +1 -0
  108. package/lib/commonjs/utils/crypto.d.ts +25 -0
  109. package/lib/commonjs/utils/crypto.js +222 -0
  110. package/lib/commonjs/utils/crypto.js.map +1 -0
  111. package/lib/commonjs/utils/ethersUtils.d.ts +14 -0
  112. package/lib/commonjs/utils/ethersUtils.js +39 -0
  113. package/lib/commonjs/utils/ethersUtils.js.map +1 -0
  114. package/lib/commonjs/utils/fragments.d.ts +465 -0
  115. package/lib/commonjs/utils/fragments.js +1342 -0
  116. package/lib/commonjs/utils/fragments.js.map +1 -0
  117. package/lib/commonjs/utils/help.d.ts +8 -0
  118. package/lib/commonjs/utils/help.js +61 -0
  119. package/lib/commonjs/utils/help.js.map +1 -0
  120. package/lib/commonjs/utils/index.d.ts +56 -0
  121. package/lib/commonjs/utils/index.js +43 -0
  122. package/lib/commonjs/utils/index.js.map +1 -0
  123. package/lib/commonjs/utils/interface.d.ts +381 -0
  124. package/lib/commonjs/utils/interface.js +1121 -0
  125. package/lib/commonjs/utils/interface.js.map +1 -0
  126. package/lib/commonjs/utils/message.d.ts +4 -0
  127. package/lib/commonjs/utils/message.js +38 -0
  128. package/lib/commonjs/utils/message.js.map +1 -0
  129. package/lib/commonjs/utils/transaction.d.ts +17 -0
  130. package/lib/commonjs/utils/transaction.js +678 -0
  131. package/lib/commonjs/utils/transaction.js.map +1 -0
  132. package/lib/commonjs/utils/typedData.d.ts +148 -0
  133. package/lib/commonjs/utils/typedData.js +498 -0
  134. package/lib/commonjs/utils/typedData.js.map +1 -0
  135. package/lib/commonjs/utils/validations.d.ts +22 -0
  136. package/lib/commonjs/utils/validations.js +128 -0
  137. package/lib/commonjs/utils/validations.js.map +1 -0
  138. package/lib/esm/index.d.ts +64 -0
  139. package/lib/esm/index.js +33 -0
  140. package/lib/esm/index.js.map +1 -0
  141. package/lib/esm/lib/TransactionBuilder/TransactionBuilder.d.ts +127 -0
  142. package/lib/esm/lib/TransactionBuilder/TransactionBuilder.js +1767 -0
  143. package/lib/esm/lib/TransactionBuilder/TransactionBuilder.js.map +1 -0
  144. package/lib/esm/lib/TransactionBuilder/helper.d.ts +28 -0
  145. package/lib/esm/lib/TransactionBuilder/helper.js +112 -0
  146. package/lib/esm/lib/TransactionBuilder/helper.js.map +1 -0
  147. package/lib/esm/lib/contract/index.d.ts +29 -0
  148. package/lib/esm/lib/contract/index.js +118 -0
  149. package/lib/esm/lib/contract/index.js.map +1 -0
  150. package/lib/esm/lib/contract/method.d.ts +50 -0
  151. package/lib/esm/lib/contract/method.js +233 -0
  152. package/lib/esm/lib/contract/method.js.map +1 -0
  153. package/lib/esm/lib/event.d.ts +85 -0
  154. package/lib/esm/lib/event.js +132 -0
  155. package/lib/esm/lib/event.js.map +1 -0
  156. package/lib/esm/lib/plugin.d.ts +28 -0
  157. package/lib/esm/lib/plugin.js +79 -0
  158. package/lib/esm/lib/plugin.js.map +1 -0
  159. package/lib/esm/lib/providers/HttpProvider.d.ts +15 -0
  160. package/lib/esm/lib/providers/HttpProvider.js +59 -0
  161. package/lib/esm/lib/providers/HttpProvider.js.map +1 -0
  162. package/lib/esm/lib/providers/index.d.ts +6 -0
  163. package/lib/esm/lib/providers/index.js +4 -0
  164. package/lib/esm/lib/providers/index.js.map +1 -0
  165. package/lib/esm/lib/trx.d.ts +315 -0
  166. package/lib/esm/lib/trx.js +960 -0
  167. package/lib/esm/lib/trx.js.map +1 -0
  168. package/lib/esm/package.json +1 -0
  169. package/lib/esm/paramValidator/index.d.ts +19 -0
  170. package/lib/esm/paramValidator/index.js +106 -0
  171. package/lib/esm/paramValidator/index.js.map +1 -0
  172. package/lib/esm/protocol/core/Tron_pb.cjs +7524 -0
  173. package/lib/esm/protocol/core/contract/account_contract_pb.cjs +961 -0
  174. package/lib/esm/protocol/core/contract/asset_issue_contract_pb.cjs +2196 -0
  175. package/lib/esm/protocol/core/contract/balance_contract_pb.cjs +3826 -0
  176. package/lib/esm/protocol/core/contract/common_pb.cjs +34 -0
  177. package/lib/esm/protocol/core/contract/exchange_contract_pb.cjs +1268 -0
  178. package/lib/esm/protocol/core/contract/proposal_contract_pb.cjs +675 -0
  179. package/lib/esm/protocol/core/contract/smart_contract_pb.cjs +2960 -0
  180. package/lib/esm/protocol/core/contract/storage_contract_pb.cjs +848 -0
  181. package/lib/esm/protocol/core/contract/vote_asset_contract_pb.cjs +340 -0
  182. package/lib/esm/protocol/core/contract/witness_contract_pb.cjs +956 -0
  183. package/lib/esm/tronweb.d.ts +111 -0
  184. package/lib/esm/tronweb.js +360 -0
  185. package/lib/esm/tronweb.js.map +1 -0
  186. package/lib/esm/types/ABI.d.ts +59 -0
  187. package/lib/esm/types/ABI.js +2 -0
  188. package/lib/esm/types/ABI.js.map +1 -0
  189. package/lib/esm/types/APIResponse.d.ts +31 -0
  190. package/lib/esm/types/APIResponse.js +2 -0
  191. package/lib/esm/types/APIResponse.js.map +1 -0
  192. package/lib/esm/types/Contract.d.ts +287 -0
  193. package/lib/esm/types/Contract.js +60 -0
  194. package/lib/esm/types/Contract.js.map +1 -0
  195. package/lib/esm/types/Providers.d.ts +8 -0
  196. package/lib/esm/types/Providers.js +2 -0
  197. package/lib/esm/types/Providers.js.map +1 -0
  198. package/lib/esm/types/Transaction.d.ts +65 -0
  199. package/lib/esm/types/Transaction.js +2 -0
  200. package/lib/esm/types/Transaction.js.map +1 -0
  201. package/lib/esm/types/TransactionBuilder.d.ts +270 -0
  202. package/lib/esm/types/TransactionBuilder.js +2 -0
  203. package/lib/esm/types/TransactionBuilder.js.map +1 -0
  204. package/lib/esm/types/TronWeb.d.ts +20 -0
  205. package/lib/esm/types/TronWeb.js +2 -0
  206. package/lib/esm/types/TronWeb.js.map +1 -0
  207. package/lib/esm/types/Trx.d.ts +263 -0
  208. package/lib/esm/types/Trx.js +39 -0
  209. package/lib/esm/types/Trx.js.map +1 -0
  210. package/lib/esm/types/UtilsTypes.d.ts +23 -0
  211. package/lib/esm/types/UtilsTypes.js +2 -0
  212. package/lib/esm/types/UtilsTypes.js.map +1 -0
  213. package/lib/esm/types/index.d.ts +9 -0
  214. package/lib/esm/types/index.js +10 -0
  215. package/lib/esm/types/index.js.map +1 -0
  216. package/lib/esm/utils/abi.d.ts +5 -0
  217. package/lib/esm/utils/abi.js +245 -0
  218. package/lib/esm/utils/abi.js.map +1 -0
  219. package/lib/esm/utils/accounts.d.ts +22 -0
  220. package/lib/esm/utils/accounts.js +46 -0
  221. package/lib/esm/utils/accounts.js.map +1 -0
  222. package/lib/esm/utils/address.d.ts +12 -0
  223. package/lib/esm/utils/address.js +82 -0
  224. package/lib/esm/utils/address.js.map +1 -0
  225. package/lib/esm/utils/base58.d.ts +3 -0
  226. package/lib/esm/utils/base58.js +64 -0
  227. package/lib/esm/utils/base58.js.map +1 -0
  228. package/lib/esm/utils/base64.d.ts +10 -0
  229. package/lib/esm/utils/base64.js +169 -0
  230. package/lib/esm/utils/base64.js.map +1 -0
  231. package/lib/esm/utils/bytes.d.ts +7 -0
  232. package/lib/esm/utils/bytes.js +53 -0
  233. package/lib/esm/utils/bytes.js.map +1 -0
  234. package/lib/esm/utils/code.d.ts +12 -0
  235. package/lib/esm/utils/code.js +149 -0
  236. package/lib/esm/utils/code.js.map +1 -0
  237. package/lib/esm/utils/crypto.d.ts +25 -0
  238. package/lib/esm/utils/crypto.js +198 -0
  239. package/lib/esm/utils/crypto.js.map +1 -0
  240. package/lib/esm/utils/ethersUtils.d.ts +14 -0
  241. package/lib/esm/utils/ethersUtils.js +17 -0
  242. package/lib/esm/utils/ethersUtils.js.map +1 -0
  243. package/lib/esm/utils/fragments.d.ts +465 -0
  244. package/lib/esm/utils/fragments.js +1330 -0
  245. package/lib/esm/utils/fragments.js.map +1 -0
  246. package/lib/esm/utils/help.d.ts +8 -0
  247. package/lib/esm/utils/help.js +51 -0
  248. package/lib/esm/utils/help.js.map +1 -0
  249. package/lib/esm/utils/index.d.ts +56 -0
  250. package/lib/esm/utils/index.js +40 -0
  251. package/lib/esm/utils/index.js.map +1 -0
  252. package/lib/esm/utils/interface.d.ts +381 -0
  253. package/lib/esm/utils/interface.js +1112 -0
  254. package/lib/esm/utils/interface.js.map +1 -0
  255. package/lib/esm/utils/message.d.ts +4 -0
  256. package/lib/esm/utils/message.js +32 -0
  257. package/lib/esm/utils/message.js.map +1 -0
  258. package/lib/esm/utils/transaction.d.ts +17 -0
  259. package/lib/esm/utils/transaction.js +669 -0
  260. package/lib/esm/utils/transaction.js.map +1 -0
  261. package/lib/esm/utils/typedData.d.ts +148 -0
  262. package/lib/esm/utils/typedData.js +493 -0
  263. package/lib/esm/utils/typedData.js.map +1 -0
  264. package/lib/esm/utils/validations.d.ts +22 -0
  265. package/lib/esm/utils/validations.js +108 -0
  266. package/lib/esm/utils/validations.js.map +1 -0
  267. package/package.json +110 -0
  268. package/src/index.ts +42 -0
  269. package/src/lib/TransactionBuilder/TransactionBuilder.ts +2272 -0
  270. package/src/lib/TransactionBuilder/helper.ts +139 -0
  271. package/src/lib/contract/index.ts +151 -0
  272. package/src/lib/contract/method.ts +336 -0
  273. package/src/lib/event.ts +248 -0
  274. package/src/lib/plugin.ts +102 -0
  275. package/src/lib/providers/HttpProvider.ts +66 -0
  276. package/src/lib/providers/index.ts +6 -0
  277. package/src/lib/trx.ts +1463 -0
  278. package/src/paramValidator/index.ts +136 -0
  279. package/src/protocol/core/Tron_pb.cjs +7524 -0
  280. package/src/protocol/core/contract/account_contract_pb.cjs +961 -0
  281. package/src/protocol/core/contract/asset_issue_contract_pb.cjs +2196 -0
  282. package/src/protocol/core/contract/balance_contract_pb.cjs +3826 -0
  283. package/src/protocol/core/contract/common_pb.cjs +34 -0
  284. package/src/protocol/core/contract/exchange_contract_pb.cjs +1268 -0
  285. package/src/protocol/core/contract/proposal_contract_pb.cjs +675 -0
  286. package/src/protocol/core/contract/smart_contract_pb.cjs +2960 -0
  287. package/src/protocol/core/contract/storage_contract_pb.cjs +848 -0
  288. package/src/protocol/core/contract/vote_asset_contract_pb.cjs +340 -0
  289. package/src/protocol/core/contract/witness_contract_pb.cjs +956 -0
  290. package/src/tronweb.ts +437 -0
  291. package/src/types/ABI.ts +82 -0
  292. package/src/types/APIResponse.ts +34 -0
  293. package/src/types/Contract.ts +352 -0
  294. package/src/types/Providers.ts +7 -0
  295. package/src/types/Transaction.ts +70 -0
  296. package/src/types/TransactionBuilder.ts +281 -0
  297. package/src/types/TronWeb.ts +23 -0
  298. package/src/types/Trx.ts +285 -0
  299. package/src/types/UtilsTypes.ts +25 -0
  300. package/src/types/index.ts +9 -0
  301. package/src/types/interface.d.ts +1 -0
  302. package/src/utils/abi.ts +257 -0
  303. package/src/utils/accounts.ts +60 -0
  304. package/src/utils/address.ts +89 -0
  305. package/src/utils/base58.ts +78 -0
  306. package/src/utils/base64.ts +200 -0
  307. package/src/utils/bytes.ts +68 -0
  308. package/src/utils/code.ts +172 -0
  309. package/src/utils/crypto.ts +264 -0
  310. package/src/utils/ethersUtils.ts +60 -0
  311. package/src/utils/fragments.ts +1738 -0
  312. package/src/utils/help.ts +59 -0
  313. package/src/utils/index.ts +42 -0
  314. package/src/utils/interface.ts +1362 -0
  315. package/src/utils/message.ts +38 -0
  316. package/src/utils/transaction.ts +991 -0
  317. package/src/utils/typedData.ts +688 -0
  318. package/src/utils/validations.ts +130 -0
@@ -0,0 +1,956 @@
1
+ // source: core/contract/witness_contract.proto
2
+ /**
3
+ * @fileoverview
4
+ * @enhanceable
5
+ * @suppress {missingRequire} reports error on implicit type usages.
6
+ * @suppress {messageConventions} JS Compiler reports an error if a variable or
7
+ * field starts with 'MSG_' and isn't a translatable message.
8
+ * @public
9
+ */
10
+ // GENERATED CODE -- DO NOT EDIT!
11
+ /* eslint-disable */
12
+ // @ts-nocheck
13
+
14
+ var jspb = require('@tronweb3/google-protobuf');
15
+ var goog = jspb;
16
+ var global =
17
+ (typeof globalThis !== 'undefined' && globalThis) ||
18
+ (typeof window !== 'undefined' && window) ||
19
+ (typeof global !== 'undefined' && global) ||
20
+ (typeof self !== 'undefined' && self) ||
21
+ (function () { return this; }).call(null) ||
22
+ Function('return this')();
23
+
24
+ goog.exportSymbol('TronWebProto.VoteWitnessContract', null, global);
25
+ goog.exportSymbol('TronWebProto.VoteWitnessContract.Vote', null, global);
26
+ goog.exportSymbol('TronWebProto.WitnessCreateContract', null, global);
27
+ goog.exportSymbol('TronWebProto.WitnessUpdateContract', null, global);
28
+ /**
29
+ * Generated by JsPbCodeGenerator.
30
+ * @param {Array=} opt_data Optional initial data array, typically from a
31
+ * server response, or constructed directly in Javascript. The array is used
32
+ * in place and becomes part of the constructed object. It is not cloned.
33
+ * If no data is provided, the constructed object will be empty, but still
34
+ * valid.
35
+ * @extends {jspb.Message}
36
+ * @constructor
37
+ */
38
+ TronWebProto.WitnessCreateContract = function(opt_data) {
39
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
40
+ };
41
+ goog.inherits(TronWebProto.WitnessCreateContract, jspb.Message);
42
+ if (goog.DEBUG && !COMPILED) {
43
+ /**
44
+ * @public
45
+ * @override
46
+ */
47
+ TronWebProto.WitnessCreateContract.displayName = 'TronWebProto.WitnessCreateContract';
48
+ }
49
+ /**
50
+ * Generated by JsPbCodeGenerator.
51
+ * @param {Array=} opt_data Optional initial data array, typically from a
52
+ * server response, or constructed directly in Javascript. The array is used
53
+ * in place and becomes part of the constructed object. It is not cloned.
54
+ * If no data is provided, the constructed object will be empty, but still
55
+ * valid.
56
+ * @extends {jspb.Message}
57
+ * @constructor
58
+ */
59
+ TronWebProto.WitnessUpdateContract = function(opt_data) {
60
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
61
+ };
62
+ goog.inherits(TronWebProto.WitnessUpdateContract, jspb.Message);
63
+ if (goog.DEBUG && !COMPILED) {
64
+ /**
65
+ * @public
66
+ * @override
67
+ */
68
+ TronWebProto.WitnessUpdateContract.displayName = 'TronWebProto.WitnessUpdateContract';
69
+ }
70
+ /**
71
+ * Generated by JsPbCodeGenerator.
72
+ * @param {Array=} opt_data Optional initial data array, typically from a
73
+ * server response, or constructed directly in Javascript. The array is used
74
+ * in place and becomes part of the constructed object. It is not cloned.
75
+ * If no data is provided, the constructed object will be empty, but still
76
+ * valid.
77
+ * @extends {jspb.Message}
78
+ * @constructor
79
+ */
80
+ TronWebProto.VoteWitnessContract = function(opt_data) {
81
+ jspb.Message.initialize(this, opt_data, 0, -1, TronWebProto.VoteWitnessContract.repeatedFields_, null);
82
+ };
83
+ goog.inherits(TronWebProto.VoteWitnessContract, jspb.Message);
84
+ if (goog.DEBUG && !COMPILED) {
85
+ /**
86
+ * @public
87
+ * @override
88
+ */
89
+ TronWebProto.VoteWitnessContract.displayName = 'TronWebProto.VoteWitnessContract';
90
+ }
91
+ /**
92
+ * Generated by JsPbCodeGenerator.
93
+ * @param {Array=} opt_data Optional initial data array, typically from a
94
+ * server response, or constructed directly in Javascript. The array is used
95
+ * in place and becomes part of the constructed object. It is not cloned.
96
+ * If no data is provided, the constructed object will be empty, but still
97
+ * valid.
98
+ * @extends {jspb.Message}
99
+ * @constructor
100
+ */
101
+ TronWebProto.VoteWitnessContract.Vote = function(opt_data) {
102
+ jspb.Message.initialize(this, opt_data, 0, -1, null, null);
103
+ };
104
+ goog.inherits(TronWebProto.VoteWitnessContract.Vote, jspb.Message);
105
+ if (goog.DEBUG && !COMPILED) {
106
+ /**
107
+ * @public
108
+ * @override
109
+ */
110
+ TronWebProto.VoteWitnessContract.Vote.displayName = 'TronWebProto.VoteWitnessContract.Vote';
111
+ }
112
+
113
+
114
+
115
+ if (jspb.Message.GENERATE_TO_OBJECT) {
116
+ /**
117
+ * Creates an object representation of this proto.
118
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
119
+ * Optional fields that are not set will be set to undefined.
120
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
121
+ * For the list of reserved names please see:
122
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
123
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
124
+ * JSPB instance for transitional soy proto support:
125
+ * http://goto/soy-param-migration
126
+ * @return {!Object}
127
+ */
128
+ TronWebProto.WitnessCreateContract.prototype.toObject = function(opt_includeInstance) {
129
+ return TronWebProto.WitnessCreateContract.toObject(opt_includeInstance, this);
130
+ };
131
+
132
+
133
+ /**
134
+ * Static version of the {@see toObject} method.
135
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
136
+ * the JSPB instance for transitional soy proto support:
137
+ * http://goto/soy-param-migration
138
+ * @param {!TronWebProto.WitnessCreateContract} msg The msg instance to transform.
139
+ * @return {!Object}
140
+ * @suppress {unusedLocalVariables} f is only used for nested messages
141
+ */
142
+ TronWebProto.WitnessCreateContract.toObject = function(includeInstance, msg) {
143
+ var f, obj = {
144
+ ownerAddress: msg.getOwnerAddress_asB64(),
145
+ url: msg.getUrl_asB64()
146
+ };
147
+
148
+ if (includeInstance) {
149
+ obj.$jspbMessageInstance = msg;
150
+ }
151
+ return obj;
152
+ };
153
+ }
154
+
155
+
156
+ /**
157
+ * Deserializes binary data (in protobuf wire format).
158
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
159
+ * @return {!TronWebProto.WitnessCreateContract}
160
+ */
161
+ TronWebProto.WitnessCreateContract.deserializeBinary = function(bytes) {
162
+ var reader = new jspb.BinaryReader(bytes);
163
+ var msg = new TronWebProto.WitnessCreateContract;
164
+ return TronWebProto.WitnessCreateContract.deserializeBinaryFromReader(msg, reader);
165
+ };
166
+
167
+
168
+ /**
169
+ * Deserializes binary data (in protobuf wire format) from the
170
+ * given reader into the given message object.
171
+ * @param {!TronWebProto.WitnessCreateContract} msg The message object to deserialize into.
172
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
173
+ * @return {!TronWebProto.WitnessCreateContract}
174
+ */
175
+ TronWebProto.WitnessCreateContract.deserializeBinaryFromReader = function(msg, reader) {
176
+ while (reader.nextField()) {
177
+ if (reader.isEndGroup()) {
178
+ break;
179
+ }
180
+ var field = reader.getFieldNumber();
181
+ switch (field) {
182
+ case 1:
183
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
184
+ msg.setOwnerAddress(value);
185
+ break;
186
+ case 2:
187
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
188
+ msg.setUrl(value);
189
+ break;
190
+ default:
191
+ reader.skipField();
192
+ break;
193
+ }
194
+ }
195
+ return msg;
196
+ };
197
+
198
+
199
+ /**
200
+ * Serializes the message to binary data (in protobuf wire format).
201
+ * @return {!Uint8Array}
202
+ */
203
+ TronWebProto.WitnessCreateContract.prototype.serializeBinary = function() {
204
+ var writer = new jspb.BinaryWriter();
205
+ TronWebProto.WitnessCreateContract.serializeBinaryToWriter(this, writer);
206
+ return writer.getResultBuffer();
207
+ };
208
+
209
+
210
+ /**
211
+ * Serializes the given message to binary data (in protobuf wire
212
+ * format), writing to the given BinaryWriter.
213
+ * @param {!TronWebProto.WitnessCreateContract} message
214
+ * @param {!jspb.BinaryWriter} writer
215
+ * @suppress {unusedLocalVariables} f is only used for nested messages
216
+ */
217
+ TronWebProto.WitnessCreateContract.serializeBinaryToWriter = function(message, writer) {
218
+ var f = undefined;
219
+ f = message.getOwnerAddress_asU8();
220
+ if (f.length > 0) {
221
+ writer.writeBytes(
222
+ 1,
223
+ f
224
+ );
225
+ }
226
+ f = message.getUrl_asU8();
227
+ if (f.length > 0) {
228
+ writer.writeBytes(
229
+ 2,
230
+ f
231
+ );
232
+ }
233
+ };
234
+
235
+
236
+ /**
237
+ * optional bytes owner_address = 1;
238
+ * @return {!(string|Uint8Array)}
239
+ */
240
+ TronWebProto.WitnessCreateContract.prototype.getOwnerAddress = function() {
241
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
242
+ };
243
+
244
+
245
+ /**
246
+ * optional bytes owner_address = 1;
247
+ * This is a type-conversion wrapper around `getOwnerAddress()`
248
+ * @return {string}
249
+ */
250
+ TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asB64 = function() {
251
+ return /** @type {string} */ (jspb.Message.bytesAsB64(
252
+ this.getOwnerAddress()));
253
+ };
254
+
255
+
256
+ /**
257
+ * optional bytes owner_address = 1;
258
+ * Note that Uint8Array is not supported on all browsers.
259
+ * @see http://caniuse.com/Uint8Array
260
+ * This is a type-conversion wrapper around `getOwnerAddress()`
261
+ * @return {!Uint8Array}
262
+ */
263
+ TronWebProto.WitnessCreateContract.prototype.getOwnerAddress_asU8 = function() {
264
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
265
+ this.getOwnerAddress()));
266
+ };
267
+
268
+
269
+ /**
270
+ * @param {!(string|Uint8Array)} value
271
+ * @return {!TronWebProto.WitnessCreateContract} returns this
272
+ */
273
+ TronWebProto.WitnessCreateContract.prototype.setOwnerAddress = function(value) {
274
+ return jspb.Message.setProto3BytesField(this, 1, value);
275
+ };
276
+
277
+
278
+ /**
279
+ * optional bytes url = 2;
280
+ * @return {!(string|Uint8Array)}
281
+ */
282
+ TronWebProto.WitnessCreateContract.prototype.getUrl = function() {
283
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 2, ""));
284
+ };
285
+
286
+
287
+ /**
288
+ * optional bytes url = 2;
289
+ * This is a type-conversion wrapper around `getUrl()`
290
+ * @return {string}
291
+ */
292
+ TronWebProto.WitnessCreateContract.prototype.getUrl_asB64 = function() {
293
+ return /** @type {string} */ (jspb.Message.bytesAsB64(
294
+ this.getUrl()));
295
+ };
296
+
297
+
298
+ /**
299
+ * optional bytes url = 2;
300
+ * Note that Uint8Array is not supported on all browsers.
301
+ * @see http://caniuse.com/Uint8Array
302
+ * This is a type-conversion wrapper around `getUrl()`
303
+ * @return {!Uint8Array}
304
+ */
305
+ TronWebProto.WitnessCreateContract.prototype.getUrl_asU8 = function() {
306
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
307
+ this.getUrl()));
308
+ };
309
+
310
+
311
+ /**
312
+ * @param {!(string|Uint8Array)} value
313
+ * @return {!TronWebProto.WitnessCreateContract} returns this
314
+ */
315
+ TronWebProto.WitnessCreateContract.prototype.setUrl = function(value) {
316
+ return jspb.Message.setProto3BytesField(this, 2, value);
317
+ };
318
+
319
+
320
+
321
+
322
+
323
+ if (jspb.Message.GENERATE_TO_OBJECT) {
324
+ /**
325
+ * Creates an object representation of this proto.
326
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
327
+ * Optional fields that are not set will be set to undefined.
328
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
329
+ * For the list of reserved names please see:
330
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
331
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
332
+ * JSPB instance for transitional soy proto support:
333
+ * http://goto/soy-param-migration
334
+ * @return {!Object}
335
+ */
336
+ TronWebProto.WitnessUpdateContract.prototype.toObject = function(opt_includeInstance) {
337
+ return TronWebProto.WitnessUpdateContract.toObject(opt_includeInstance, this);
338
+ };
339
+
340
+
341
+ /**
342
+ * Static version of the {@see toObject} method.
343
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
344
+ * the JSPB instance for transitional soy proto support:
345
+ * http://goto/soy-param-migration
346
+ * @param {!TronWebProto.WitnessUpdateContract} msg The msg instance to transform.
347
+ * @return {!Object}
348
+ * @suppress {unusedLocalVariables} f is only used for nested messages
349
+ */
350
+ TronWebProto.WitnessUpdateContract.toObject = function(includeInstance, msg) {
351
+ var f, obj = {
352
+ ownerAddress: msg.getOwnerAddress_asB64(),
353
+ updateUrl: msg.getUpdateUrl_asB64()
354
+ };
355
+
356
+ if (includeInstance) {
357
+ obj.$jspbMessageInstance = msg;
358
+ }
359
+ return obj;
360
+ };
361
+ }
362
+
363
+
364
+ /**
365
+ * Deserializes binary data (in protobuf wire format).
366
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
367
+ * @return {!TronWebProto.WitnessUpdateContract}
368
+ */
369
+ TronWebProto.WitnessUpdateContract.deserializeBinary = function(bytes) {
370
+ var reader = new jspb.BinaryReader(bytes);
371
+ var msg = new TronWebProto.WitnessUpdateContract;
372
+ return TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader(msg, reader);
373
+ };
374
+
375
+
376
+ /**
377
+ * Deserializes binary data (in protobuf wire format) from the
378
+ * given reader into the given message object.
379
+ * @param {!TronWebProto.WitnessUpdateContract} msg The message object to deserialize into.
380
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
381
+ * @return {!TronWebProto.WitnessUpdateContract}
382
+ */
383
+ TronWebProto.WitnessUpdateContract.deserializeBinaryFromReader = function(msg, reader) {
384
+ while (reader.nextField()) {
385
+ if (reader.isEndGroup()) {
386
+ break;
387
+ }
388
+ var field = reader.getFieldNumber();
389
+ switch (field) {
390
+ case 1:
391
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
392
+ msg.setOwnerAddress(value);
393
+ break;
394
+ case 12:
395
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
396
+ msg.setUpdateUrl(value);
397
+ break;
398
+ default:
399
+ reader.skipField();
400
+ break;
401
+ }
402
+ }
403
+ return msg;
404
+ };
405
+
406
+
407
+ /**
408
+ * Serializes the message to binary data (in protobuf wire format).
409
+ * @return {!Uint8Array}
410
+ */
411
+ TronWebProto.WitnessUpdateContract.prototype.serializeBinary = function() {
412
+ var writer = new jspb.BinaryWriter();
413
+ TronWebProto.WitnessUpdateContract.serializeBinaryToWriter(this, writer);
414
+ return writer.getResultBuffer();
415
+ };
416
+
417
+
418
+ /**
419
+ * Serializes the given message to binary data (in protobuf wire
420
+ * format), writing to the given BinaryWriter.
421
+ * @param {!TronWebProto.WitnessUpdateContract} message
422
+ * @param {!jspb.BinaryWriter} writer
423
+ * @suppress {unusedLocalVariables} f is only used for nested messages
424
+ */
425
+ TronWebProto.WitnessUpdateContract.serializeBinaryToWriter = function(message, writer) {
426
+ var f = undefined;
427
+ f = message.getOwnerAddress_asU8();
428
+ if (f.length > 0) {
429
+ writer.writeBytes(
430
+ 1,
431
+ f
432
+ );
433
+ }
434
+ f = message.getUpdateUrl_asU8();
435
+ if (f.length > 0) {
436
+ writer.writeBytes(
437
+ 12,
438
+ f
439
+ );
440
+ }
441
+ };
442
+
443
+
444
+ /**
445
+ * optional bytes owner_address = 1;
446
+ * @return {!(string|Uint8Array)}
447
+ */
448
+ TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress = function() {
449
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
450
+ };
451
+
452
+
453
+ /**
454
+ * optional bytes owner_address = 1;
455
+ * This is a type-conversion wrapper around `getOwnerAddress()`
456
+ * @return {string}
457
+ */
458
+ TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asB64 = function() {
459
+ return /** @type {string} */ (jspb.Message.bytesAsB64(
460
+ this.getOwnerAddress()));
461
+ };
462
+
463
+
464
+ /**
465
+ * optional bytes owner_address = 1;
466
+ * Note that Uint8Array is not supported on all browsers.
467
+ * @see http://caniuse.com/Uint8Array
468
+ * This is a type-conversion wrapper around `getOwnerAddress()`
469
+ * @return {!Uint8Array}
470
+ */
471
+ TronWebProto.WitnessUpdateContract.prototype.getOwnerAddress_asU8 = function() {
472
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
473
+ this.getOwnerAddress()));
474
+ };
475
+
476
+
477
+ /**
478
+ * @param {!(string|Uint8Array)} value
479
+ * @return {!TronWebProto.WitnessUpdateContract} returns this
480
+ */
481
+ TronWebProto.WitnessUpdateContract.prototype.setOwnerAddress = function(value) {
482
+ return jspb.Message.setProto3BytesField(this, 1, value);
483
+ };
484
+
485
+
486
+ /**
487
+ * optional bytes update_url = 12;
488
+ * @return {!(string|Uint8Array)}
489
+ */
490
+ TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl = function() {
491
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 12, ""));
492
+ };
493
+
494
+
495
+ /**
496
+ * optional bytes update_url = 12;
497
+ * This is a type-conversion wrapper around `getUpdateUrl()`
498
+ * @return {string}
499
+ */
500
+ TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asB64 = function() {
501
+ return /** @type {string} */ (jspb.Message.bytesAsB64(
502
+ this.getUpdateUrl()));
503
+ };
504
+
505
+
506
+ /**
507
+ * optional bytes update_url = 12;
508
+ * Note that Uint8Array is not supported on all browsers.
509
+ * @see http://caniuse.com/Uint8Array
510
+ * This is a type-conversion wrapper around `getUpdateUrl()`
511
+ * @return {!Uint8Array}
512
+ */
513
+ TronWebProto.WitnessUpdateContract.prototype.getUpdateUrl_asU8 = function() {
514
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
515
+ this.getUpdateUrl()));
516
+ };
517
+
518
+
519
+ /**
520
+ * @param {!(string|Uint8Array)} value
521
+ * @return {!TronWebProto.WitnessUpdateContract} returns this
522
+ */
523
+ TronWebProto.WitnessUpdateContract.prototype.setUpdateUrl = function(value) {
524
+ return jspb.Message.setProto3BytesField(this, 12, value);
525
+ };
526
+
527
+
528
+
529
+ /**
530
+ * List of repeated fields within this message type.
531
+ * @private {!Array<number>}
532
+ * @const
533
+ */
534
+ TronWebProto.VoteWitnessContract.repeatedFields_ = [2];
535
+
536
+
537
+
538
+ if (jspb.Message.GENERATE_TO_OBJECT) {
539
+ /**
540
+ * Creates an object representation of this proto.
541
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
542
+ * Optional fields that are not set will be set to undefined.
543
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
544
+ * For the list of reserved names please see:
545
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
546
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
547
+ * JSPB instance for transitional soy proto support:
548
+ * http://goto/soy-param-migration
549
+ * @return {!Object}
550
+ */
551
+ TronWebProto.VoteWitnessContract.prototype.toObject = function(opt_includeInstance) {
552
+ return TronWebProto.VoteWitnessContract.toObject(opt_includeInstance, this);
553
+ };
554
+
555
+
556
+ /**
557
+ * Static version of the {@see toObject} method.
558
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
559
+ * the JSPB instance for transitional soy proto support:
560
+ * http://goto/soy-param-migration
561
+ * @param {!TronWebProto.VoteWitnessContract} msg The msg instance to transform.
562
+ * @return {!Object}
563
+ * @suppress {unusedLocalVariables} f is only used for nested messages
564
+ */
565
+ TronWebProto.VoteWitnessContract.toObject = function(includeInstance, msg) {
566
+ var f, obj = {
567
+ ownerAddress: msg.getOwnerAddress_asB64(),
568
+ votesList: jspb.Message.toObjectList(msg.getVotesList(),
569
+ TronWebProto.VoteWitnessContract.Vote.toObject, includeInstance),
570
+ support: jspb.Message.getBooleanFieldWithDefault(msg, 3, false)
571
+ };
572
+
573
+ if (includeInstance) {
574
+ obj.$jspbMessageInstance = msg;
575
+ }
576
+ return obj;
577
+ };
578
+ }
579
+
580
+
581
+ /**
582
+ * Deserializes binary data (in protobuf wire format).
583
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
584
+ * @return {!TronWebProto.VoteWitnessContract}
585
+ */
586
+ TronWebProto.VoteWitnessContract.deserializeBinary = function(bytes) {
587
+ var reader = new jspb.BinaryReader(bytes);
588
+ var msg = new TronWebProto.VoteWitnessContract;
589
+ return TronWebProto.VoteWitnessContract.deserializeBinaryFromReader(msg, reader);
590
+ };
591
+
592
+
593
+ /**
594
+ * Deserializes binary data (in protobuf wire format) from the
595
+ * given reader into the given message object.
596
+ * @param {!TronWebProto.VoteWitnessContract} msg The message object to deserialize into.
597
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
598
+ * @return {!TronWebProto.VoteWitnessContract}
599
+ */
600
+ TronWebProto.VoteWitnessContract.deserializeBinaryFromReader = function(msg, reader) {
601
+ while (reader.nextField()) {
602
+ if (reader.isEndGroup()) {
603
+ break;
604
+ }
605
+ var field = reader.getFieldNumber();
606
+ switch (field) {
607
+ case 1:
608
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
609
+ msg.setOwnerAddress(value);
610
+ break;
611
+ case 2:
612
+ var value = new TronWebProto.VoteWitnessContract.Vote;
613
+ reader.readMessage(value,TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader);
614
+ msg.addVotes(value);
615
+ break;
616
+ case 3:
617
+ var value = /** @type {boolean} */ (reader.readBool());
618
+ msg.setSupport(value);
619
+ break;
620
+ default:
621
+ reader.skipField();
622
+ break;
623
+ }
624
+ }
625
+ return msg;
626
+ };
627
+
628
+
629
+ /**
630
+ * Serializes the message to binary data (in protobuf wire format).
631
+ * @return {!Uint8Array}
632
+ */
633
+ TronWebProto.VoteWitnessContract.prototype.serializeBinary = function() {
634
+ var writer = new jspb.BinaryWriter();
635
+ TronWebProto.VoteWitnessContract.serializeBinaryToWriter(this, writer);
636
+ return writer.getResultBuffer();
637
+ };
638
+
639
+
640
+ /**
641
+ * Serializes the given message to binary data (in protobuf wire
642
+ * format), writing to the given BinaryWriter.
643
+ * @param {!TronWebProto.VoteWitnessContract} message
644
+ * @param {!jspb.BinaryWriter} writer
645
+ * @suppress {unusedLocalVariables} f is only used for nested messages
646
+ */
647
+ TronWebProto.VoteWitnessContract.serializeBinaryToWriter = function(message, writer) {
648
+ var f = undefined;
649
+ f = message.getOwnerAddress_asU8();
650
+ if (f.length > 0) {
651
+ writer.writeBytes(
652
+ 1,
653
+ f
654
+ );
655
+ }
656
+ f = message.getVotesList();
657
+ if (f.length > 0) {
658
+ writer.writeRepeatedMessage(
659
+ 2,
660
+ f,
661
+ TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter
662
+ );
663
+ }
664
+ f = message.getSupport();
665
+ if (f) {
666
+ writer.writeBool(
667
+ 3,
668
+ f
669
+ );
670
+ }
671
+ };
672
+
673
+
674
+
675
+
676
+
677
+ if (jspb.Message.GENERATE_TO_OBJECT) {
678
+ /**
679
+ * Creates an object representation of this proto.
680
+ * Field names that are reserved in JavaScript and will be renamed to pb_name.
681
+ * Optional fields that are not set will be set to undefined.
682
+ * To access a reserved field use, foo.pb_<name>, eg, foo.pb_default.
683
+ * For the list of reserved names please see:
684
+ * net/proto2/compiler/js/internal/generator.cc#kKeyword.
685
+ * @param {boolean=} opt_includeInstance Deprecated. whether to include the
686
+ * JSPB instance for transitional soy proto support:
687
+ * http://goto/soy-param-migration
688
+ * @return {!Object}
689
+ */
690
+ TronWebProto.VoteWitnessContract.Vote.prototype.toObject = function(opt_includeInstance) {
691
+ return TronWebProto.VoteWitnessContract.Vote.toObject(opt_includeInstance, this);
692
+ };
693
+
694
+
695
+ /**
696
+ * Static version of the {@see toObject} method.
697
+ * @param {boolean|undefined} includeInstance Deprecated. Whether to include
698
+ * the JSPB instance for transitional soy proto support:
699
+ * http://goto/soy-param-migration
700
+ * @param {!TronWebProto.VoteWitnessContract.Vote} msg The msg instance to transform.
701
+ * @return {!Object}
702
+ * @suppress {unusedLocalVariables} f is only used for nested messages
703
+ */
704
+ TronWebProto.VoteWitnessContract.Vote.toObject = function(includeInstance, msg) {
705
+ var f, obj = {
706
+ voteAddress: msg.getVoteAddress_asB64(),
707
+ voteCount: jspb.Message.getFieldWithDefault(msg, 2, 0)
708
+ };
709
+
710
+ if (includeInstance) {
711
+ obj.$jspbMessageInstance = msg;
712
+ }
713
+ return obj;
714
+ };
715
+ }
716
+
717
+
718
+ /**
719
+ * Deserializes binary data (in protobuf wire format).
720
+ * @param {jspb.ByteSource} bytes The bytes to deserialize.
721
+ * @return {!TronWebProto.VoteWitnessContract.Vote}
722
+ */
723
+ TronWebProto.VoteWitnessContract.Vote.deserializeBinary = function(bytes) {
724
+ var reader = new jspb.BinaryReader(bytes);
725
+ var msg = new TronWebProto.VoteWitnessContract.Vote;
726
+ return TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader(msg, reader);
727
+ };
728
+
729
+
730
+ /**
731
+ * Deserializes binary data (in protobuf wire format) from the
732
+ * given reader into the given message object.
733
+ * @param {!TronWebProto.VoteWitnessContract.Vote} msg The message object to deserialize into.
734
+ * @param {!jspb.BinaryReader} reader The BinaryReader to use.
735
+ * @return {!TronWebProto.VoteWitnessContract.Vote}
736
+ */
737
+ TronWebProto.VoteWitnessContract.Vote.deserializeBinaryFromReader = function(msg, reader) {
738
+ while (reader.nextField()) {
739
+ if (reader.isEndGroup()) {
740
+ break;
741
+ }
742
+ var field = reader.getFieldNumber();
743
+ switch (field) {
744
+ case 1:
745
+ var value = /** @type {!Uint8Array} */ (reader.readBytes());
746
+ msg.setVoteAddress(value);
747
+ break;
748
+ case 2:
749
+ var value = /** @type {number} */ (reader.readInt64());
750
+ msg.setVoteCount(value);
751
+ break;
752
+ default:
753
+ reader.skipField();
754
+ break;
755
+ }
756
+ }
757
+ return msg;
758
+ };
759
+
760
+
761
+ /**
762
+ * Serializes the message to binary data (in protobuf wire format).
763
+ * @return {!Uint8Array}
764
+ */
765
+ TronWebProto.VoteWitnessContract.Vote.prototype.serializeBinary = function() {
766
+ var writer = new jspb.BinaryWriter();
767
+ TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter(this, writer);
768
+ return writer.getResultBuffer();
769
+ };
770
+
771
+
772
+ /**
773
+ * Serializes the given message to binary data (in protobuf wire
774
+ * format), writing to the given BinaryWriter.
775
+ * @param {!TronWebProto.VoteWitnessContract.Vote} message
776
+ * @param {!jspb.BinaryWriter} writer
777
+ * @suppress {unusedLocalVariables} f is only used for nested messages
778
+ */
779
+ TronWebProto.VoteWitnessContract.Vote.serializeBinaryToWriter = function(message, writer) {
780
+ var f = undefined;
781
+ f = message.getVoteAddress_asU8();
782
+ if (f.length > 0) {
783
+ writer.writeBytes(
784
+ 1,
785
+ f
786
+ );
787
+ }
788
+ f = message.getVoteCount();
789
+ if (f !== 0) {
790
+ writer.writeInt64(
791
+ 2,
792
+ f
793
+ );
794
+ }
795
+ };
796
+
797
+
798
+ /**
799
+ * optional bytes vote_address = 1;
800
+ * @return {!(string|Uint8Array)}
801
+ */
802
+ TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress = function() {
803
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
804
+ };
805
+
806
+
807
+ /**
808
+ * optional bytes vote_address = 1;
809
+ * This is a type-conversion wrapper around `getVoteAddress()`
810
+ * @return {string}
811
+ */
812
+ TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asB64 = function() {
813
+ return /** @type {string} */ (jspb.Message.bytesAsB64(
814
+ this.getVoteAddress()));
815
+ };
816
+
817
+
818
+ /**
819
+ * optional bytes vote_address = 1;
820
+ * Note that Uint8Array is not supported on all browsers.
821
+ * @see http://caniuse.com/Uint8Array
822
+ * This is a type-conversion wrapper around `getVoteAddress()`
823
+ * @return {!Uint8Array}
824
+ */
825
+ TronWebProto.VoteWitnessContract.Vote.prototype.getVoteAddress_asU8 = function() {
826
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
827
+ this.getVoteAddress()));
828
+ };
829
+
830
+
831
+ /**
832
+ * @param {!(string|Uint8Array)} value
833
+ * @return {!TronWebProto.VoteWitnessContract.Vote} returns this
834
+ */
835
+ TronWebProto.VoteWitnessContract.Vote.prototype.setVoteAddress = function(value) {
836
+ return jspb.Message.setProto3BytesField(this, 1, value);
837
+ };
838
+
839
+
840
+ /**
841
+ * optional int64 vote_count = 2;
842
+ * @return {number}
843
+ */
844
+ TronWebProto.VoteWitnessContract.Vote.prototype.getVoteCount = function() {
845
+ return /** @type {number} */ (jspb.Message.getFieldWithDefault(this, 2, 0));
846
+ };
847
+
848
+
849
+ /**
850
+ * @param {number} value
851
+ * @return {!TronWebProto.VoteWitnessContract.Vote} returns this
852
+ */
853
+ TronWebProto.VoteWitnessContract.Vote.prototype.setVoteCount = function(value) {
854
+ return jspb.Message.setProto3IntField(this, 2, value);
855
+ };
856
+
857
+
858
+ /**
859
+ * optional bytes owner_address = 1;
860
+ * @return {!(string|Uint8Array)}
861
+ */
862
+ TronWebProto.VoteWitnessContract.prototype.getOwnerAddress = function() {
863
+ return /** @type {!(string|Uint8Array)} */ (jspb.Message.getFieldWithDefault(this, 1, ""));
864
+ };
865
+
866
+
867
+ /**
868
+ * optional bytes owner_address = 1;
869
+ * This is a type-conversion wrapper around `getOwnerAddress()`
870
+ * @return {string}
871
+ */
872
+ TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asB64 = function() {
873
+ return /** @type {string} */ (jspb.Message.bytesAsB64(
874
+ this.getOwnerAddress()));
875
+ };
876
+
877
+
878
+ /**
879
+ * optional bytes owner_address = 1;
880
+ * Note that Uint8Array is not supported on all browsers.
881
+ * @see http://caniuse.com/Uint8Array
882
+ * This is a type-conversion wrapper around `getOwnerAddress()`
883
+ * @return {!Uint8Array}
884
+ */
885
+ TronWebProto.VoteWitnessContract.prototype.getOwnerAddress_asU8 = function() {
886
+ return /** @type {!Uint8Array} */ (jspb.Message.bytesAsU8(
887
+ this.getOwnerAddress()));
888
+ };
889
+
890
+
891
+ /**
892
+ * @param {!(string|Uint8Array)} value
893
+ * @return {!TronWebProto.VoteWitnessContract} returns this
894
+ */
895
+ TronWebProto.VoteWitnessContract.prototype.setOwnerAddress = function(value) {
896
+ return jspb.Message.setProto3BytesField(this, 1, value);
897
+ };
898
+
899
+
900
+ /**
901
+ * repeated Vote votes = 2;
902
+ * @return {!Array<!TronWebProto.VoteWitnessContract.Vote>}
903
+ */
904
+ TronWebProto.VoteWitnessContract.prototype.getVotesList = function() {
905
+ return /** @type{!Array<!TronWebProto.VoteWitnessContract.Vote>} */ (
906
+ jspb.Message.getRepeatedWrapperField(this, TronWebProto.VoteWitnessContract.Vote, 2));
907
+ };
908
+
909
+
910
+ /**
911
+ * @param {!Array<!TronWebProto.VoteWitnessContract.Vote>} value
912
+ * @return {!TronWebProto.VoteWitnessContract} returns this
913
+ */
914
+ TronWebProto.VoteWitnessContract.prototype.setVotesList = function(value) {
915
+ return jspb.Message.setRepeatedWrapperField(this, 2, value);
916
+ };
917
+
918
+
919
+ /**
920
+ * @param {!TronWebProto.VoteWitnessContract.Vote=} opt_value
921
+ * @param {number=} opt_index
922
+ * @return {!TronWebProto.VoteWitnessContract.Vote}
923
+ */
924
+ TronWebProto.VoteWitnessContract.prototype.addVotes = function(opt_value, opt_index) {
925
+ return jspb.Message.addToRepeatedWrapperField(this, 2, opt_value, TronWebProto.VoteWitnessContract.Vote, opt_index);
926
+ };
927
+
928
+
929
+ /**
930
+ * Clears the list making it empty but non-null.
931
+ * @return {!TronWebProto.VoteWitnessContract} returns this
932
+ */
933
+ TronWebProto.VoteWitnessContract.prototype.clearVotesList = function() {
934
+ return this.setVotesList([]);
935
+ };
936
+
937
+
938
+ /**
939
+ * optional bool support = 3;
940
+ * @return {boolean}
941
+ */
942
+ TronWebProto.VoteWitnessContract.prototype.getSupport = function() {
943
+ return /** @type {boolean} */ (jspb.Message.getBooleanFieldWithDefault(this, 3, false));
944
+ };
945
+
946
+
947
+ /**
948
+ * @param {boolean} value
949
+ * @return {!TronWebProto.VoteWitnessContract} returns this
950
+ */
951
+ TronWebProto.VoteWitnessContract.prototype.setSupport = function(value) {
952
+ return jspb.Message.setProto3BooleanField(this, 3, value);
953
+ };
954
+
955
+
956
+ goog.object.extend(exports, TronWebProto);