@hiero-ledger/sdk 2.77.0 → 2.78.0-beta.2

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 (729) hide show
  1. package/README.md +6 -6
  2. package/dist/umd.js +592 -592
  3. package/dist/umd.min.js +2 -2
  4. package/lib/Cache.cjs +6 -6
  5. package/lib/Cache.d.ts +12 -12
  6. package/lib/Cache.js.map +1 -1
  7. package/lib/Duration.cjs +1 -1
  8. package/lib/Duration.d.ts +2 -2
  9. package/lib/Duration.js.map +1 -1
  10. package/lib/EntityIdHelper.cjs +1 -1
  11. package/lib/EntityIdHelper.js +1 -1
  12. package/lib/EntityIdHelper.js.map +1 -1
  13. package/lib/EthereumFlow.cjs +7 -7
  14. package/lib/EthereumFlow.d.ts +14 -14
  15. package/lib/EthereumFlow.js.map +1 -1
  16. package/lib/EthereumTransaction.cjs +7 -7
  17. package/lib/EthereumTransaction.d.ts +14 -14
  18. package/lib/EthereumTransaction.js.map +1 -1
  19. package/lib/EvmAddress.cjs +1 -1
  20. package/lib/EvmAddress.d.ts +2 -2
  21. package/lib/EvmAddress.js.map +1 -1
  22. package/lib/ExchangeRate.cjs +2 -2
  23. package/lib/ExchangeRate.d.ts +4 -4
  24. package/lib/ExchangeRate.js.map +1 -1
  25. package/lib/ExchangeRates.cjs +1 -1
  26. package/lib/ExchangeRates.d.ts +1 -1
  27. package/lib/ExchangeRates.js +1 -1
  28. package/lib/ExchangeRates.js.map +1 -1
  29. package/lib/FeeComponents.cjs +1 -1
  30. package/lib/FeeComponents.d.ts +1 -1
  31. package/lib/FeeComponents.js +1 -1
  32. package/lib/FeeComponents.js.map +1 -1
  33. package/lib/FeeData.cjs +1 -1
  34. package/lib/FeeData.d.ts +1 -1
  35. package/lib/FeeData.js +1 -1
  36. package/lib/FeeData.js.map +1 -1
  37. package/lib/FeeDataType.cjs +1 -1
  38. package/lib/FeeDataType.d.ts +2 -2
  39. package/lib/FeeDataType.js.map +1 -1
  40. package/lib/FeeSchedule.cjs +1 -1
  41. package/lib/FeeSchedule.d.ts +1 -1
  42. package/lib/FeeSchedule.js +1 -1
  43. package/lib/FeeSchedule.js.map +1 -1
  44. package/lib/FeeSchedules.cjs +1 -1
  45. package/lib/FeeSchedules.d.ts +1 -1
  46. package/lib/FeeSchedules.js +1 -1
  47. package/lib/FeeSchedules.js.map +1 -1
  48. package/lib/FreezeType.cjs +1 -1
  49. package/lib/FreezeType.d.ts +2 -2
  50. package/lib/FreezeType.js.map +1 -1
  51. package/lib/Key.cjs +1 -1
  52. package/lib/Key.d.ts +2 -2
  53. package/lib/Key.js.map +1 -1
  54. package/lib/KeyList.cjs +3 -3
  55. package/lib/KeyList.d.ts +6 -6
  56. package/lib/KeyList.js.map +1 -1
  57. package/lib/Mnemonic.cjs +1 -1
  58. package/lib/Mnemonic.d.ts +1 -1
  59. package/lib/Mnemonic.js +1 -1
  60. package/lib/Mnemonic.js.map +1 -1
  61. package/lib/PrivateKey.cjs +7 -7
  62. package/lib/PrivateKey.d.ts +11 -11
  63. package/lib/PrivateKey.js +1 -1
  64. package/lib/PrivateKey.js.map +1 -1
  65. package/lib/PrngTransaction.cjs +9 -9
  66. package/lib/PrngTransaction.d.ts +18 -18
  67. package/lib/PrngTransaction.js.map +1 -1
  68. package/lib/PublicKey.cjs +5 -5
  69. package/lib/PublicKey.d.ts +9 -9
  70. package/lib/PublicKey.js +1 -1
  71. package/lib/PublicKey.js.map +1 -1
  72. package/lib/RequestType.cjs +1 -1
  73. package/lib/RequestType.d.ts +2 -2
  74. package/lib/RequestType.js.map +1 -1
  75. package/lib/StakingInfo.cjs +1 -1
  76. package/lib/StakingInfo.d.ts +1 -1
  77. package/lib/StakingInfo.js +1 -1
  78. package/lib/StakingInfo.js.map +1 -1
  79. package/lib/Status.cjs +1 -1
  80. package/lib/Status.d.ts +2 -2
  81. package/lib/Status.js.map +1 -1
  82. package/lib/Timestamp.cjs +1 -1
  83. package/lib/Timestamp.d.ts +1 -1
  84. package/lib/Timestamp.js.map +1 -1
  85. package/lib/TransactionFeeSchedule.cjs +1 -1
  86. package/lib/TransactionFeeSchedule.d.ts +1 -1
  87. package/lib/TransactionFeeSchedule.js +1 -1
  88. package/lib/TransactionFeeSchedule.js.map +1 -1
  89. package/lib/Transfer.cjs +2 -2
  90. package/lib/Transfer.d.ts +4 -4
  91. package/lib/Transfer.js.map +1 -1
  92. package/lib/account/AccountAllowanceAdjustTransaction.cjs +7 -7
  93. package/lib/account/AccountAllowanceAdjustTransaction.d.ts +14 -14
  94. package/lib/account/AccountAllowanceAdjustTransaction.js.map +1 -1
  95. package/lib/account/AccountAllowanceApproveTransaction.cjs +8 -8
  96. package/lib/account/AccountAllowanceApproveTransaction.d.ts +16 -16
  97. package/lib/account/AccountAllowanceApproveTransaction.js.map +1 -1
  98. package/lib/account/AccountAllowanceDeleteTransaction.cjs +7 -7
  99. package/lib/account/AccountAllowanceDeleteTransaction.d.ts +14 -14
  100. package/lib/account/AccountAllowanceDeleteTransaction.js.map +1 -1
  101. package/lib/account/AccountBalance.cjs +1 -1
  102. package/lib/account/AccountBalance.d.ts +1 -1
  103. package/lib/account/AccountBalance.js +1 -1
  104. package/lib/account/AccountBalance.js.map +1 -1
  105. package/lib/account/AccountBalanceQuery.cjs +6 -6
  106. package/lib/account/AccountBalanceQuery.d.ts +12 -12
  107. package/lib/account/AccountBalanceQuery.js.map +1 -1
  108. package/lib/account/AccountCreateTransaction.cjs +1 -1
  109. package/lib/account/AccountCreateTransaction.d.ts +1 -1
  110. package/lib/account/AccountCreateTransaction.js +1 -1
  111. package/lib/account/AccountCreateTransaction.js.map +1 -1
  112. package/lib/account/AccountDeleteTransaction.cjs +7 -7
  113. package/lib/account/AccountDeleteTransaction.d.ts +14 -14
  114. package/lib/account/AccountDeleteTransaction.js.map +1 -1
  115. package/lib/account/AccountId.cjs +1 -1
  116. package/lib/account/AccountId.d.ts +1 -1
  117. package/lib/account/AccountId.js +1 -1
  118. package/lib/account/AccountId.js.map +1 -1
  119. package/lib/account/AccountInfo.cjs +1 -1
  120. package/lib/account/AccountInfo.d.ts +1 -1
  121. package/lib/account/AccountInfo.js +1 -1
  122. package/lib/account/AccountInfo.js.map +1 -1
  123. package/lib/account/AccountInfoQuery.cjs +7 -7
  124. package/lib/account/AccountInfoQuery.d.ts +14 -14
  125. package/lib/account/AccountInfoQuery.js.map +1 -1
  126. package/lib/account/AccountRecordsQuery.cjs +7 -7
  127. package/lib/account/AccountRecordsQuery.d.ts +14 -14
  128. package/lib/account/AccountRecordsQuery.js.map +1 -1
  129. package/lib/account/AccountUpdateTransaction.cjs +7 -7
  130. package/lib/account/AccountUpdateTransaction.d.ts +14 -14
  131. package/lib/account/AccountUpdateTransaction.js.map +1 -1
  132. package/lib/account/HbarAllowance.cjs +3 -3
  133. package/lib/account/HbarAllowance.d.ts +6 -6
  134. package/lib/account/HbarAllowance.js.map +1 -1
  135. package/lib/account/HbarTransferMap.cjs +2 -2
  136. package/lib/account/HbarTransferMap.d.ts +4 -4
  137. package/lib/account/HbarTransferMap.js.map +1 -1
  138. package/lib/account/LiveHash.cjs +3 -3
  139. package/lib/account/LiveHash.d.ts +6 -6
  140. package/lib/account/LiveHash.js.map +1 -1
  141. package/lib/account/LiveHashAddTransaction.cjs +7 -7
  142. package/lib/account/LiveHashAddTransaction.d.ts +14 -14
  143. package/lib/account/LiveHashAddTransaction.js.map +1 -1
  144. package/lib/account/LiveHashDeleteTransaction.cjs +6 -6
  145. package/lib/account/LiveHashDeleteTransaction.d.ts +12 -12
  146. package/lib/account/LiveHashDeleteTransaction.js.map +1 -1
  147. package/lib/account/LiveHashQuery.cjs +7 -7
  148. package/lib/account/LiveHashQuery.d.ts +14 -14
  149. package/lib/account/LiveHashQuery.js.map +1 -1
  150. package/lib/account/NullableTokenDecimalMap.cjs +2 -2
  151. package/lib/account/NullableTokenDecimalMap.d.ts +4 -4
  152. package/lib/account/NullableTokenDecimalMap.js.map +1 -1
  153. package/lib/account/ProxyStaker.cjs +2 -2
  154. package/lib/account/ProxyStaker.d.ts +4 -4
  155. package/lib/account/ProxyStaker.js.map +1 -1
  156. package/lib/account/TokenAllowance.cjs +4 -4
  157. package/lib/account/TokenAllowance.d.ts +8 -8
  158. package/lib/account/TokenAllowance.js.map +1 -1
  159. package/lib/account/TokenBalanceMap.cjs +2 -2
  160. package/lib/account/TokenBalanceMap.d.ts +4 -4
  161. package/lib/account/TokenBalanceMap.js.map +1 -1
  162. package/lib/account/TokenDecimalMap.cjs +2 -2
  163. package/lib/account/TokenDecimalMap.d.ts +4 -4
  164. package/lib/account/TokenDecimalMap.js.map +1 -1
  165. package/lib/account/TokenNftAllowance.cjs +5 -5
  166. package/lib/account/TokenNftAllowance.d.ts +10 -10
  167. package/lib/account/TokenNftAllowance.js.map +1 -1
  168. package/lib/account/TokenNftTransferMap.cjs +5 -5
  169. package/lib/account/TokenNftTransferMap.d.ts +10 -10
  170. package/lib/account/TokenNftTransferMap.js.map +1 -1
  171. package/lib/account/TokenRelationship.cjs +4 -4
  172. package/lib/account/TokenRelationship.d.ts +8 -8
  173. package/lib/account/TokenRelationship.js.map +1 -1
  174. package/lib/account/TokenRelationshipMap.cjs +2 -2
  175. package/lib/account/TokenRelationshipMap.d.ts +4 -4
  176. package/lib/account/TokenRelationshipMap.js.map +1 -1
  177. package/lib/account/TokenTransferMap.cjs +4 -4
  178. package/lib/account/TokenTransferMap.d.ts +8 -8
  179. package/lib/account/TokenTransferMap.js.map +1 -1
  180. package/lib/account/TransferTransaction.cjs +6 -6
  181. package/lib/account/TransferTransaction.d.ts +12 -12
  182. package/lib/account/TransferTransaction.js.map +1 -1
  183. package/lib/address_book/AddressBooks.cjs +1 -1
  184. package/lib/address_book/AddressBooks.js +1 -1
  185. package/lib/address_book/AddressBooks.js.map +1 -1
  186. package/lib/address_book/Endpoint.cjs +1 -1
  187. package/lib/address_book/Endpoint.d.ts +2 -2
  188. package/lib/address_book/Endpoint.js.map +1 -1
  189. package/lib/address_book/NodeAddress.cjs +1 -1
  190. package/lib/address_book/NodeAddress.d.ts +2 -2
  191. package/lib/address_book/NodeAddress.js.map +1 -1
  192. package/lib/address_book/NodeAddressBook.cjs +1 -1
  193. package/lib/address_book/NodeAddressBook.d.ts +1 -1
  194. package/lib/address_book/NodeAddressBook.js +1 -1
  195. package/lib/address_book/NodeAddressBook.js.map +1 -1
  196. package/lib/browser.js +1 -1
  197. package/lib/channel/Channel.cjs +1 -1
  198. package/lib/channel/Channel.d.ts +1 -1
  199. package/lib/channel/Channel.js +1 -1
  200. package/lib/channel/Channel.js.map +1 -1
  201. package/lib/contract/ContractByteCodeQuery.cjs +6 -6
  202. package/lib/contract/ContractByteCodeQuery.d.ts +12 -12
  203. package/lib/contract/ContractByteCodeQuery.js.map +1 -1
  204. package/lib/contract/ContractCallQuery.cjs +1 -1
  205. package/lib/contract/ContractCallQuery.d.ts +1 -1
  206. package/lib/contract/ContractCallQuery.js +1 -1
  207. package/lib/contract/ContractCallQuery.js.map +1 -1
  208. package/lib/contract/ContractCreateTransaction.cjs +8 -8
  209. package/lib/contract/ContractCreateTransaction.d.ts +16 -16
  210. package/lib/contract/ContractCreateTransaction.js.map +1 -1
  211. package/lib/contract/ContractDeleteTransaction.cjs +8 -8
  212. package/lib/contract/ContractDeleteTransaction.d.ts +16 -16
  213. package/lib/contract/ContractDeleteTransaction.js.map +1 -1
  214. package/lib/contract/ContractExecuteTransaction.cjs +9 -9
  215. package/lib/contract/ContractExecuteTransaction.d.ts +18 -18
  216. package/lib/contract/ContractExecuteTransaction.js.map +1 -1
  217. package/lib/contract/ContractFunctionResult.cjs +2 -2
  218. package/lib/contract/ContractFunctionResult.d.ts +4 -4
  219. package/lib/contract/ContractFunctionResult.js.map +1 -1
  220. package/lib/contract/ContractId.cjs +1 -1
  221. package/lib/contract/ContractId.d.ts +1 -1
  222. package/lib/contract/ContractId.js +1 -1
  223. package/lib/contract/ContractId.js.map +1 -1
  224. package/lib/contract/ContractInfo.cjs +1 -1
  225. package/lib/contract/ContractInfo.d.ts +1 -1
  226. package/lib/contract/ContractInfo.js +1 -1
  227. package/lib/contract/ContractInfo.js.map +1 -1
  228. package/lib/contract/ContractInfoQuery.cjs +7 -7
  229. package/lib/contract/ContractInfoQuery.d.ts +14 -14
  230. package/lib/contract/ContractInfoQuery.js.map +1 -1
  231. package/lib/contract/ContractLogInfo.cjs +2 -2
  232. package/lib/contract/ContractLogInfo.d.ts +4 -4
  233. package/lib/contract/ContractLogInfo.js.map +1 -1
  234. package/lib/contract/ContractNonceInfo.cjs +3 -3
  235. package/lib/contract/ContractNonceInfo.d.ts +4 -4
  236. package/lib/contract/ContractNonceInfo.js +1 -1
  237. package/lib/contract/ContractNonceInfo.js.map +1 -1
  238. package/lib/contract/ContractStateChange.cjs +1 -1
  239. package/lib/contract/ContractStateChange.d.ts +1 -1
  240. package/lib/contract/ContractUpdateTransaction.cjs +10 -10
  241. package/lib/contract/ContractUpdateTransaction.d.ts +18 -18
  242. package/lib/contract/ContractUpdateTransaction.js +1 -1
  243. package/lib/contract/ContractUpdateTransaction.js.map +1 -1
  244. package/lib/contract/DelegateContractId.cjs +2 -2
  245. package/lib/contract/DelegateContractId.d.ts +4 -4
  246. package/lib/contract/DelegateContractId.js.map +1 -1
  247. package/lib/contract/StorageChange.cjs +1 -1
  248. package/lib/contract/StorageChange.d.ts +1 -1
  249. package/lib/exports.cjs +1 -1
  250. package/lib/exports.d.ts +1 -1
  251. package/lib/exports.js +1 -1
  252. package/lib/exports.js.map +1 -1
  253. package/lib/file/FileAppendTransaction.cjs +7 -7
  254. package/lib/file/FileAppendTransaction.d.ts +14 -14
  255. package/lib/file/FileAppendTransaction.js.map +1 -1
  256. package/lib/file/FileContentsQuery.cjs +7 -7
  257. package/lib/file/FileContentsQuery.d.ts +14 -14
  258. package/lib/file/FileContentsQuery.js.map +1 -1
  259. package/lib/file/FileCreateTransaction.cjs +6 -6
  260. package/lib/file/FileCreateTransaction.d.ts +12 -12
  261. package/lib/file/FileCreateTransaction.js.map +1 -1
  262. package/lib/file/FileDeleteTransaction.cjs +7 -7
  263. package/lib/file/FileDeleteTransaction.d.ts +14 -14
  264. package/lib/file/FileDeleteTransaction.js.map +1 -1
  265. package/lib/file/FileId.cjs +1 -1
  266. package/lib/file/FileId.d.ts +1 -1
  267. package/lib/file/FileId.js +1 -1
  268. package/lib/file/FileId.js.map +1 -1
  269. package/lib/file/FileInfo.cjs +1 -1
  270. package/lib/file/FileInfo.d.ts +1 -1
  271. package/lib/file/FileInfo.js +1 -1
  272. package/lib/file/FileInfo.js.map +1 -1
  273. package/lib/file/FileInfoQuery.cjs +7 -7
  274. package/lib/file/FileInfoQuery.d.ts +14 -14
  275. package/lib/file/FileInfoQuery.js.map +1 -1
  276. package/lib/file/FileUpdateTransaction.cjs +6 -6
  277. package/lib/file/FileUpdateTransaction.d.ts +12 -12
  278. package/lib/file/FileUpdateTransaction.js.map +1 -1
  279. package/lib/index.js +1 -1
  280. package/lib/native.js +1 -1
  281. package/lib/network/AddressBookQuery.cjs +1 -1
  282. package/lib/network/AddressBookQuery.js +1 -1
  283. package/lib/network/AddressBookQuery.js.map +1 -1
  284. package/lib/network/NetworkVersionInfo.cjs +1 -1
  285. package/lib/network/NetworkVersionInfo.d.ts +1 -1
  286. package/lib/network/NetworkVersionInfo.js +1 -1
  287. package/lib/network/NetworkVersionInfo.js.map +1 -1
  288. package/lib/network/NetworkVersionInfoQuery.cjs +6 -6
  289. package/lib/network/NetworkVersionInfoQuery.d.ts +12 -12
  290. package/lib/network/NetworkVersionInfoQuery.js.map +1 -1
  291. package/lib/network/SemanticVersion.cjs +1 -1
  292. package/lib/network/SemanticVersion.d.ts +1 -1
  293. package/lib/network/SemanticVersion.js +1 -1
  294. package/lib/network/SemanticVersion.js.map +1 -1
  295. package/lib/node/NodeCreateTransaction.cjs +6 -6
  296. package/lib/node/NodeCreateTransaction.d.ts +12 -12
  297. package/lib/node/NodeCreateTransaction.js.map +1 -1
  298. package/lib/node/NodeDeleteTransaction.cjs +6 -6
  299. package/lib/node/NodeDeleteTransaction.d.ts +12 -12
  300. package/lib/node/NodeDeleteTransaction.js.map +1 -1
  301. package/lib/node/NodeUpdateTransaction.cjs +6 -6
  302. package/lib/node/NodeUpdateTransaction.d.ts +12 -12
  303. package/lib/node/NodeUpdateTransaction.js.map +1 -1
  304. package/lib/node/ServiceEndpoint.cjs +1 -1
  305. package/lib/node/ServiceEndpoint.d.ts +2 -2
  306. package/lib/node/ServiceEndpoint.js.map +1 -1
  307. package/lib/query/CostQuery.cjs +1 -1
  308. package/lib/query/CostQuery.d.ts +1 -1
  309. package/lib/query/CostQuery.js +1 -1
  310. package/lib/query/CostQuery.js.map +1 -1
  311. package/lib/query/Query.cjs +1 -1
  312. package/lib/query/Query.d.ts +1 -1
  313. package/lib/query/Query.js +1 -1
  314. package/lib/query/Query.js.map +1 -1
  315. package/lib/query/QueryBase.cjs +1 -1
  316. package/lib/query/QueryBase.d.ts +1 -1
  317. package/lib/query/QueryBase.js +1 -1
  318. package/lib/query/QueryBase.js.map +1 -1
  319. package/lib/schedule/ScheduleCreateTransaction.cjs +1 -1
  320. package/lib/schedule/ScheduleCreateTransaction.d.ts +1 -1
  321. package/lib/schedule/ScheduleCreateTransaction.js +1 -1
  322. package/lib/schedule/ScheduleCreateTransaction.js.map +1 -1
  323. package/lib/schedule/ScheduleDeleteTransaction.cjs +8 -8
  324. package/lib/schedule/ScheduleDeleteTransaction.d.ts +16 -16
  325. package/lib/schedule/ScheduleDeleteTransaction.js.map +1 -1
  326. package/lib/schedule/ScheduleId.cjs +1 -1
  327. package/lib/schedule/ScheduleId.d.ts +1 -1
  328. package/lib/schedule/ScheduleId.js +1 -1
  329. package/lib/schedule/ScheduleId.js.map +1 -1
  330. package/lib/schedule/ScheduleInfo.cjs +1 -1
  331. package/lib/schedule/ScheduleInfo.d.ts +1 -1
  332. package/lib/schedule/ScheduleInfo.js +1 -1
  333. package/lib/schedule/ScheduleInfo.js.map +1 -1
  334. package/lib/schedule/ScheduleInfoQuery.cjs +7 -7
  335. package/lib/schedule/ScheduleInfoQuery.d.ts +14 -14
  336. package/lib/schedule/ScheduleInfoQuery.js.map +1 -1
  337. package/lib/schedule/ScheduleSignTransaction.cjs +10 -10
  338. package/lib/schedule/ScheduleSignTransaction.d.ts +20 -20
  339. package/lib/schedule/ScheduleSignTransaction.js.map +1 -1
  340. package/lib/system/FreezeTransaction.cjs +6 -6
  341. package/lib/system/FreezeTransaction.d.ts +12 -12
  342. package/lib/system/FreezeTransaction.js.map +1 -1
  343. package/lib/system/SystemDeleteTransaction.cjs +8 -8
  344. package/lib/system/SystemDeleteTransaction.d.ts +16 -16
  345. package/lib/system/SystemDeleteTransaction.js.map +1 -1
  346. package/lib/system/SystemUndeleteTransaction.cjs +8 -8
  347. package/lib/system/SystemUndeleteTransaction.d.ts +16 -16
  348. package/lib/system/SystemUndeleteTransaction.js.map +1 -1
  349. package/lib/token/AbstractTokenTransferTransaction.cjs +1 -1
  350. package/lib/token/AbstractTokenTransferTransaction.d.ts +2 -2
  351. package/lib/token/AbstractTokenTransferTransaction.js.map +1 -1
  352. package/lib/token/AssessedCustomFee.cjs +1 -1
  353. package/lib/token/AssessedCustomFee.d.ts +2 -2
  354. package/lib/token/AssessedCustomFee.js.map +1 -1
  355. package/lib/token/CustomFee.cjs +1 -1
  356. package/lib/token/CustomFee.d.ts +2 -2
  357. package/lib/token/CustomFee.js.map +1 -1
  358. package/lib/token/CustomFixedFee.cjs +3 -3
  359. package/lib/token/CustomFixedFee.d.ts +6 -6
  360. package/lib/token/CustomFixedFee.js.map +1 -1
  361. package/lib/token/CustomFractionalFee.cjs +3 -3
  362. package/lib/token/CustomFractionalFee.d.ts +6 -6
  363. package/lib/token/CustomFractionalFee.js.map +1 -1
  364. package/lib/token/CustomRoyaltyFee.cjs +4 -4
  365. package/lib/token/CustomRoyaltyFee.d.ts +8 -8
  366. package/lib/token/CustomRoyaltyFee.js.map +1 -1
  367. package/lib/token/NftId.cjs +1 -1
  368. package/lib/token/NftId.d.ts +1 -1
  369. package/lib/token/NftId.js +1 -1
  370. package/lib/token/NftId.js.map +1 -1
  371. package/lib/token/PendingAirdropId.cjs +1 -1
  372. package/lib/token/PendingAirdropId.d.ts +1 -1
  373. package/lib/token/PendingAirdropId.js.map +1 -1
  374. package/lib/token/PendingAirdropRecord.cjs +1 -1
  375. package/lib/token/PendingAirdropRecord.d.ts +1 -1
  376. package/lib/token/PendingAirdropRecord.js.map +1 -1
  377. package/lib/token/TokenAirdropTransaction.cjs +8 -8
  378. package/lib/token/TokenAirdropTransaction.d.ts +16 -16
  379. package/lib/token/TokenAirdropTransaction.js.map +1 -1
  380. package/lib/token/TokenAssociateTransaction.cjs +7 -7
  381. package/lib/token/TokenAssociateTransaction.d.ts +14 -14
  382. package/lib/token/TokenAssociateTransaction.js.map +1 -1
  383. package/lib/token/TokenAssociation.cjs +1 -1
  384. package/lib/token/TokenAssociation.d.ts +2 -2
  385. package/lib/token/TokenAssociation.js.map +1 -1
  386. package/lib/token/TokenBurnTransaction.cjs +7 -7
  387. package/lib/token/TokenBurnTransaction.d.ts +14 -14
  388. package/lib/token/TokenBurnTransaction.js.map +1 -1
  389. package/lib/token/TokenCancelAirdropTransaction.cjs +6 -6
  390. package/lib/token/TokenCancelAirdropTransaction.d.ts +12 -12
  391. package/lib/token/TokenCancelAirdropTransaction.js.map +1 -1
  392. package/lib/token/TokenClaimAirdropTransaction.cjs +6 -6
  393. package/lib/token/TokenClaimAirdropTransaction.d.ts +12 -12
  394. package/lib/token/TokenClaimAirdropTransaction.js.map +1 -1
  395. package/lib/token/TokenCreateTransaction.cjs +7 -7
  396. package/lib/token/TokenCreateTransaction.d.ts +14 -14
  397. package/lib/token/TokenCreateTransaction.js.map +1 -1
  398. package/lib/token/TokenDeleteTransaction.cjs +7 -7
  399. package/lib/token/TokenDeleteTransaction.d.ts +14 -14
  400. package/lib/token/TokenDeleteTransaction.js.map +1 -1
  401. package/lib/token/TokenDissociateTransaction.cjs +7 -7
  402. package/lib/token/TokenDissociateTransaction.d.ts +14 -14
  403. package/lib/token/TokenDissociateTransaction.js.map +1 -1
  404. package/lib/token/TokenFeeScheduleUpdateTransaction.cjs +7 -7
  405. package/lib/token/TokenFeeScheduleUpdateTransaction.d.ts +14 -14
  406. package/lib/token/TokenFeeScheduleUpdateTransaction.js.map +1 -1
  407. package/lib/token/TokenFreezeTransaction.cjs +7 -7
  408. package/lib/token/TokenFreezeTransaction.d.ts +14 -14
  409. package/lib/token/TokenFreezeTransaction.js.map +1 -1
  410. package/lib/token/TokenGrantKycTransaction.cjs +7 -7
  411. package/lib/token/TokenGrantKycTransaction.d.ts +14 -14
  412. package/lib/token/TokenGrantKycTransaction.js.map +1 -1
  413. package/lib/token/TokenId.cjs +1 -1
  414. package/lib/token/TokenId.d.ts +1 -1
  415. package/lib/token/TokenId.js +1 -1
  416. package/lib/token/TokenId.js.map +1 -1
  417. package/lib/token/TokenInfo.cjs +1 -1
  418. package/lib/token/TokenInfo.d.ts +1 -1
  419. package/lib/token/TokenInfo.js +1 -1
  420. package/lib/token/TokenInfo.js.map +1 -1
  421. package/lib/token/TokenInfoQuery.cjs +7 -7
  422. package/lib/token/TokenInfoQuery.d.ts +14 -14
  423. package/lib/token/TokenInfoQuery.js.map +1 -1
  424. package/lib/token/TokenKeyValidation.cjs +1 -1
  425. package/lib/token/TokenKeyValidation.d.ts +2 -2
  426. package/lib/token/TokenKeyValidation.js.map +1 -1
  427. package/lib/token/TokenMintTransaction.cjs +7 -7
  428. package/lib/token/TokenMintTransaction.d.ts +14 -14
  429. package/lib/token/TokenMintTransaction.js.map +1 -1
  430. package/lib/token/TokenNftInfo.cjs +10 -10
  431. package/lib/token/TokenNftInfo.d.ts +20 -20
  432. package/lib/token/TokenNftInfo.js.map +1 -1
  433. package/lib/token/TokenNftInfoQuery.cjs +11 -11
  434. package/lib/token/TokenNftInfoQuery.d.ts +22 -22
  435. package/lib/token/TokenNftInfoQuery.js.map +1 -1
  436. package/lib/token/TokenNftTransfer.cjs +5 -5
  437. package/lib/token/TokenNftTransfer.d.ts +10 -10
  438. package/lib/token/TokenNftTransfer.js.map +1 -1
  439. package/lib/token/TokenNftsUpdateTransaction.cjs +7 -7
  440. package/lib/token/TokenNftsUpdateTransaction.d.ts +14 -14
  441. package/lib/token/TokenPauseTransaction.cjs +7 -7
  442. package/lib/token/TokenPauseTransaction.d.ts +14 -14
  443. package/lib/token/TokenPauseTransaction.js.map +1 -1
  444. package/lib/token/TokenReference.cjs +1 -1
  445. package/lib/token/TokenReference.d.ts +2 -2
  446. package/lib/token/TokenReference.js.map +1 -1
  447. package/lib/token/TokenRejectTransaction.cjs +7 -7
  448. package/lib/token/TokenRejectTransaction.d.ts +14 -14
  449. package/lib/token/TokenRejectTransaction.js.map +1 -1
  450. package/lib/token/TokenRevokeKycTransaction.cjs +7 -7
  451. package/lib/token/TokenRevokeKycTransaction.d.ts +14 -14
  452. package/lib/token/TokenRevokeKycTransaction.js.map +1 -1
  453. package/lib/token/TokenSupplyType.cjs +1 -1
  454. package/lib/token/TokenSupplyType.d.ts +2 -2
  455. package/lib/token/TokenSupplyType.js.map +1 -1
  456. package/lib/token/TokenTransfer.cjs +4 -4
  457. package/lib/token/TokenTransfer.d.ts +8 -8
  458. package/lib/token/TokenTransfer.js.map +1 -1
  459. package/lib/token/TokenType.cjs +1 -1
  460. package/lib/token/TokenType.d.ts +2 -2
  461. package/lib/token/TokenType.js.map +1 -1
  462. package/lib/token/TokenUnfreezeTransaction.cjs +7 -7
  463. package/lib/token/TokenUnfreezeTransaction.d.ts +14 -14
  464. package/lib/token/TokenUnfreezeTransaction.js.map +1 -1
  465. package/lib/token/TokenUnpauseTransaction.cjs +7 -7
  466. package/lib/token/TokenUnpauseTransaction.d.ts +14 -14
  467. package/lib/token/TokenUnpauseTransaction.js.map +1 -1
  468. package/lib/token/TokenUpdateNftsTransaction.cjs +7 -7
  469. package/lib/token/TokenUpdateNftsTransaction.d.ts +14 -14
  470. package/lib/token/TokenUpdateNftsTransaction.js.map +1 -1
  471. package/lib/token/TokenUpdateTransaction.cjs +7 -7
  472. package/lib/token/TokenUpdateTransaction.d.ts +14 -14
  473. package/lib/token/TokenUpdateTransaction.js.map +1 -1
  474. package/lib/token/TokenWipeTransaction.cjs +7 -7
  475. package/lib/token/TokenWipeTransaction.d.ts +14 -14
  476. package/lib/token/TokenWipeTransaction.js.map +1 -1
  477. package/lib/topic/TopicCreateTransaction.cjs +6 -6
  478. package/lib/topic/TopicCreateTransaction.d.ts +12 -12
  479. package/lib/topic/TopicCreateTransaction.js.map +1 -1
  480. package/lib/topic/TopicDeleteTransaction.cjs +6 -6
  481. package/lib/topic/TopicDeleteTransaction.d.ts +12 -12
  482. package/lib/topic/TopicDeleteTransaction.js.map +1 -1
  483. package/lib/topic/TopicId.cjs +1 -1
  484. package/lib/topic/TopicId.d.ts +1 -1
  485. package/lib/topic/TopicId.js +1 -1
  486. package/lib/topic/TopicId.js.map +1 -1
  487. package/lib/topic/TopicInfo.cjs +1 -1
  488. package/lib/topic/TopicInfo.d.ts +1 -1
  489. package/lib/topic/TopicInfo.js +1 -1
  490. package/lib/topic/TopicInfo.js.map +1 -1
  491. package/lib/topic/TopicInfoQuery.cjs +7 -7
  492. package/lib/topic/TopicInfoQuery.d.ts +14 -14
  493. package/lib/topic/TopicInfoQuery.js.map +1 -1
  494. package/lib/topic/TopicMessage.cjs +2 -2
  495. package/lib/topic/TopicMessage.d.ts +4 -4
  496. package/lib/topic/TopicMessage.js.map +1 -1
  497. package/lib/topic/TopicMessageChunk.cjs +2 -2
  498. package/lib/topic/TopicMessageChunk.d.ts +4 -4
  499. package/lib/topic/TopicMessageChunk.js.map +1 -1
  500. package/lib/topic/TopicMessageQuery.cjs +1 -1
  501. package/lib/topic/TopicMessageQuery.js +1 -1
  502. package/lib/topic/TopicMessageQuery.js.map +1 -1
  503. package/lib/topic/TopicMessageSubmitTransaction.cjs +9 -9
  504. package/lib/topic/TopicMessageSubmitTransaction.d.ts +18 -18
  505. package/lib/topic/TopicMessageSubmitTransaction.js.map +1 -1
  506. package/lib/topic/TopicUpdateTransaction.cjs +6 -6
  507. package/lib/topic/TopicUpdateTransaction.d.ts +12 -12
  508. package/lib/topic/TopicUpdateTransaction.js.map +1 -1
  509. package/lib/transaction/BatchTransaction.cjs +5 -5
  510. package/lib/transaction/BatchTransaction.d.ts +9 -9
  511. package/lib/transaction/BatchTransaction.js +1 -1
  512. package/lib/transaction/BatchTransaction.js.map +1 -1
  513. package/lib/transaction/CustomFeeLimit.cjs +2 -2
  514. package/lib/transaction/CustomFeeLimit.d.ts +4 -4
  515. package/lib/transaction/CustomFeeLimit.js.map +1 -1
  516. package/lib/transaction/NodeAccountIdSignatureMap.cjs +2 -2
  517. package/lib/transaction/NodeAccountIdSignatureMap.d.ts +2 -2
  518. package/lib/transaction/NodeAccountIdSignatureMap.js +1 -1
  519. package/lib/transaction/NodeAccountIdSignatureMap.js.map +1 -1
  520. package/lib/transaction/NodeAccountIdSignatureMapLegacy.cjs +1 -1
  521. package/lib/transaction/NodeAccountIdSignatureMapLegacy.d.ts +2 -2
  522. package/lib/transaction/NodeAccountIdSignatureMapLegacy.js.map +1 -1
  523. package/lib/transaction/SignatureMap.cjs +1 -1
  524. package/lib/transaction/SignatureMap.js.map +1 -1
  525. package/lib/transaction/SignaturePairMap.cjs +1 -1
  526. package/lib/transaction/SignaturePairMap.d.ts +2 -2
  527. package/lib/transaction/SignaturePairMap.js.map +1 -1
  528. package/lib/transaction/Transaction.cjs +1 -1
  529. package/lib/transaction/Transaction.d.ts +1 -1
  530. package/lib/transaction/Transaction.js +1 -1
  531. package/lib/transaction/Transaction.js.map +1 -1
  532. package/lib/transaction/TransactionHashMap.cjs +1 -1
  533. package/lib/transaction/TransactionHashMap.d.ts +2 -2
  534. package/lib/transaction/TransactionHashMap.js.map +1 -1
  535. package/lib/transaction/TransactionId.cjs +1 -1
  536. package/lib/transaction/TransactionId.d.ts +1 -1
  537. package/lib/transaction/TransactionId.js +1 -1
  538. package/lib/transaction/TransactionId.js.map +1 -1
  539. package/lib/transaction/TransactionReceipt.cjs +1 -1
  540. package/lib/transaction/TransactionReceipt.d.ts +1 -1
  541. package/lib/transaction/TransactionReceipt.js +1 -1
  542. package/lib/transaction/TransactionReceipt.js.map +1 -1
  543. package/lib/transaction/TransactionReceiptQuery.cjs +1 -1
  544. package/lib/transaction/TransactionReceiptQuery.d.ts +1 -1
  545. package/lib/transaction/TransactionReceiptQuery.js +1 -1
  546. package/lib/transaction/TransactionReceiptQuery.js.map +1 -1
  547. package/lib/transaction/TransactionRecord.cjs +1 -1
  548. package/lib/transaction/TransactionRecord.d.ts +1 -1
  549. package/lib/transaction/TransactionRecord.js +1 -1
  550. package/lib/transaction/TransactionRecord.js.map +1 -1
  551. package/lib/transaction/TransactionRecordQuery.cjs +1 -1
  552. package/lib/transaction/TransactionRecordQuery.d.ts +1 -1
  553. package/lib/transaction/TransactionRecordQuery.js +1 -1
  554. package/lib/transaction/TransactionRecordQuery.js.map +1 -1
  555. package/lib/util/ASN1-Decoder.cjs +1 -1
  556. package/lib/util/ASN1-Decoder.js +1 -1
  557. package/lib/util/ASN1-Decoder.js.map +1 -1
  558. package/lib/version.js +1 -1
  559. package/package.json +3 -3
  560. package/src/Cache.js +6 -6
  561. package/src/Duration.js +1 -1
  562. package/src/EntityIdHelper.js +1 -1
  563. package/src/EthereumFlow.js +7 -7
  564. package/src/EthereumTransaction.js +7 -7
  565. package/src/EvmAddress.js +1 -1
  566. package/src/ExchangeRate.js +2 -2
  567. package/src/ExchangeRates.js +1 -1
  568. package/src/FeeComponents.js +1 -1
  569. package/src/FeeData.js +1 -1
  570. package/src/FeeDataType.js +1 -1
  571. package/src/FeeSchedule.js +1 -1
  572. package/src/FeeSchedules.js +1 -1
  573. package/src/FreezeType.js +1 -1
  574. package/src/Key.js +1 -1
  575. package/src/KeyList.js +3 -3
  576. package/src/Mnemonic.js +1 -1
  577. package/src/PrivateKey.js +7 -7
  578. package/src/PrngTransaction.js +9 -9
  579. package/src/PublicKey.js +5 -5
  580. package/src/RequestType.js +1 -1
  581. package/src/StakingInfo.js +1 -1
  582. package/src/Status.js +1 -1
  583. package/src/Timestamp.js +1 -1
  584. package/src/TransactionFeeSchedule.js +1 -1
  585. package/src/Transfer.js +2 -2
  586. package/src/account/AccountAllowanceAdjustTransaction.js +7 -7
  587. package/src/account/AccountAllowanceApproveTransaction.js +8 -8
  588. package/src/account/AccountAllowanceDeleteTransaction.js +7 -7
  589. package/src/account/AccountBalance.js +1 -1
  590. package/src/account/AccountBalanceQuery.js +6 -6
  591. package/src/account/AccountCreateTransaction.js +1 -1
  592. package/src/account/AccountDeleteTransaction.js +7 -7
  593. package/src/account/AccountId.js +1 -1
  594. package/src/account/AccountInfo.js +1 -1
  595. package/src/account/AccountInfoQuery.js +7 -7
  596. package/src/account/AccountRecordsQuery.js +7 -7
  597. package/src/account/AccountUpdateTransaction.js +7 -7
  598. package/src/account/HbarAllowance.js +3 -3
  599. package/src/account/HbarTransferMap.js +2 -2
  600. package/src/account/LiveHash.js +3 -3
  601. package/src/account/LiveHashAddTransaction.js +7 -7
  602. package/src/account/LiveHashDeleteTransaction.js +6 -6
  603. package/src/account/LiveHashQuery.js +7 -7
  604. package/src/account/NullableTokenDecimalMap.js +2 -2
  605. package/src/account/ProxyStaker.js +2 -2
  606. package/src/account/TokenAllowance.js +4 -4
  607. package/src/account/TokenBalanceMap.js +2 -2
  608. package/src/account/TokenDecimalMap.js +2 -2
  609. package/src/account/TokenNftAllowance.js +5 -5
  610. package/src/account/TokenNftTransferMap.js +5 -5
  611. package/src/account/TokenRelationship.js +4 -4
  612. package/src/account/TokenRelationshipMap.js +2 -2
  613. package/src/account/TokenTransferMap.js +4 -4
  614. package/src/account/TransferTransaction.js +6 -6
  615. package/src/address_book/AddressBooks.js +1 -1
  616. package/src/address_book/Endpoint.js +1 -1
  617. package/src/address_book/NodeAddress.js +1 -1
  618. package/src/address_book/NodeAddressBook.js +1 -1
  619. package/src/channel/Channel.js +1 -1
  620. package/src/contract/ContractByteCodeQuery.js +6 -6
  621. package/src/contract/ContractCallQuery.js +1 -1
  622. package/src/contract/ContractCreateTransaction.js +8 -8
  623. package/src/contract/ContractDeleteTransaction.js +8 -8
  624. package/src/contract/ContractExecuteTransaction.js +9 -9
  625. package/src/contract/ContractFunctionResult.js +2 -2
  626. package/src/contract/ContractId.js +1 -1
  627. package/src/contract/ContractInfo.js +1 -1
  628. package/src/contract/ContractInfoQuery.js +7 -7
  629. package/src/contract/ContractLogInfo.js +2 -2
  630. package/src/contract/ContractNonceInfo.js +3 -3
  631. package/src/contract/ContractStateChange.js +1 -1
  632. package/src/contract/ContractUpdateTransaction.js +10 -10
  633. package/src/contract/DelegateContractId.js +2 -2
  634. package/src/contract/StorageChange.js +1 -1
  635. package/src/exports.js +1 -1
  636. package/src/file/FileAppendTransaction.js +7 -7
  637. package/src/file/FileContentsQuery.js +7 -7
  638. package/src/file/FileCreateTransaction.js +6 -6
  639. package/src/file/FileDeleteTransaction.js +7 -7
  640. package/src/file/FileId.js +1 -1
  641. package/src/file/FileInfo.js +1 -1
  642. package/src/file/FileInfoQuery.js +7 -7
  643. package/src/file/FileUpdateTransaction.js +6 -6
  644. package/src/network/AddressBookQuery.js +1 -1
  645. package/src/network/NetworkVersionInfo.js +1 -1
  646. package/src/network/NetworkVersionInfoQuery.js +6 -6
  647. package/src/network/SemanticVersion.js +1 -1
  648. package/src/node/NodeCreateTransaction.js +6 -6
  649. package/src/node/NodeDeleteTransaction.js +6 -6
  650. package/src/node/NodeUpdateTransaction.js +6 -6
  651. package/src/node/ServiceEndpoint.js +1 -1
  652. package/src/query/CostQuery.js +1 -1
  653. package/src/query/Query.js +1 -1
  654. package/src/query/QueryBase.js +1 -1
  655. package/src/schedule/ScheduleCreateTransaction.js +1 -1
  656. package/src/schedule/ScheduleDeleteTransaction.js +8 -8
  657. package/src/schedule/ScheduleId.js +1 -1
  658. package/src/schedule/ScheduleInfo.js +1 -1
  659. package/src/schedule/ScheduleInfoQuery.js +7 -7
  660. package/src/schedule/ScheduleSignTransaction.js +10 -10
  661. package/src/system/FreezeTransaction.js +6 -6
  662. package/src/system/SystemDeleteTransaction.js +8 -8
  663. package/src/system/SystemUndeleteTransaction.js +8 -8
  664. package/src/token/AbstractTokenTransferTransaction.js +1 -1
  665. package/src/token/AssessedCustomFee.js +1 -1
  666. package/src/token/CustomFee.js +1 -1
  667. package/src/token/CustomFixedFee.js +3 -3
  668. package/src/token/CustomFractionalFee.js +3 -3
  669. package/src/token/CustomRoyaltyFee.js +4 -4
  670. package/src/token/NftId.js +1 -1
  671. package/src/token/PendingAirdropId.js +1 -1
  672. package/src/token/PendingAirdropRecord.js +1 -1
  673. package/src/token/TokenAirdropTransaction.js +8 -8
  674. package/src/token/TokenAssociateTransaction.js +7 -7
  675. package/src/token/TokenAssociation.js +1 -1
  676. package/src/token/TokenBurnTransaction.js +7 -7
  677. package/src/token/TokenCancelAirdropTransaction.js +6 -6
  678. package/src/token/TokenClaimAirdropTransaction.js +6 -6
  679. package/src/token/TokenCreateTransaction.js +7 -7
  680. package/src/token/TokenDeleteTransaction.js +7 -7
  681. package/src/token/TokenDissociateTransaction.js +7 -7
  682. package/src/token/TokenFeeScheduleUpdateTransaction.js +7 -7
  683. package/src/token/TokenFreezeTransaction.js +7 -7
  684. package/src/token/TokenGrantKycTransaction.js +7 -7
  685. package/src/token/TokenId.js +1 -1
  686. package/src/token/TokenInfo.js +1 -1
  687. package/src/token/TokenInfoQuery.js +7 -7
  688. package/src/token/TokenKeyValidation.js +1 -1
  689. package/src/token/TokenMintTransaction.js +7 -7
  690. package/src/token/TokenNftInfo.js +10 -10
  691. package/src/token/TokenNftInfoQuery.js +11 -11
  692. package/src/token/TokenNftTransfer.js +5 -5
  693. package/src/token/TokenNftsUpdateTransaction.js +7 -7
  694. package/src/token/TokenPauseTransaction.js +7 -7
  695. package/src/token/TokenReference.js +1 -1
  696. package/src/token/TokenRejectTransaction.js +7 -7
  697. package/src/token/TokenRevokeKycTransaction.js +7 -7
  698. package/src/token/TokenSupplyType.js +1 -1
  699. package/src/token/TokenTransfer.js +4 -4
  700. package/src/token/TokenType.js +1 -1
  701. package/src/token/TokenUnfreezeTransaction.js +7 -7
  702. package/src/token/TokenUnpauseTransaction.js +7 -7
  703. package/src/token/TokenUpdateNftsTransaction.js +7 -7
  704. package/src/token/TokenUpdateTransaction.js +7 -7
  705. package/src/token/TokenWipeTransaction.js +7 -7
  706. package/src/topic/TopicCreateTransaction.js +6 -6
  707. package/src/topic/TopicDeleteTransaction.js +6 -6
  708. package/src/topic/TopicId.js +1 -1
  709. package/src/topic/TopicInfo.js +1 -1
  710. package/src/topic/TopicInfoQuery.js +7 -7
  711. package/src/topic/TopicMessage.js +2 -2
  712. package/src/topic/TopicMessageChunk.js +2 -2
  713. package/src/topic/TopicMessageQuery.js +1 -1
  714. package/src/topic/TopicMessageSubmitTransaction.js +9 -9
  715. package/src/topic/TopicUpdateTransaction.js +6 -6
  716. package/src/transaction/BatchTransaction.js +5 -5
  717. package/src/transaction/CustomFeeLimit.js +2 -2
  718. package/src/transaction/NodeAccountIdSignatureMap.js +2 -2
  719. package/src/transaction/NodeAccountIdSignatureMapLegacy.js +1 -1
  720. package/src/transaction/SignatureMap.js +1 -1
  721. package/src/transaction/SignaturePairMap.js +1 -1
  722. package/src/transaction/Transaction.js +1 -1
  723. package/src/transaction/TransactionHashMap.js +1 -1
  724. package/src/transaction/TransactionId.js +1 -1
  725. package/src/transaction/TransactionReceipt.js +1 -1
  726. package/src/transaction/TransactionReceiptQuery.js +1 -1
  727. package/src/transaction/TransactionRecord.js +1 -1
  728. package/src/transaction/TransactionRecordQuery.js +1 -1
  729. package/src/util/ASN1-Decoder.js +1 -1
@@ -11,12 +11,12 @@ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e
11
11
 
12
12
  /**
13
13
  * @namespace proto
14
- * @typedef {import("@hashgraph/proto").proto.ITimestamp} HieroProto.proto.ITimestamp
14
+ * @typedef {import("@hiero-ledger/proto").proto.ITimestamp} HieroProto.proto.ITimestamp
15
15
  */
16
16
 
17
17
  /**
18
18
  * @namespace com
19
- * @typedef {import("@hashgraph/proto").com.hedera.mirror.api.proto.IConsensusTopicResponse} com.hedera.mirror.api.proto.IConsensusTopicResponse
19
+ * @typedef {import("@hiero-ledger/proto").com.hedera.mirror.api.proto.IConsensusTopicResponse} com.hedera.mirror.api.proto.IConsensusTopicResponse
20
20
  */
21
21
 
22
22
  class TopicMessageChunk {
@@ -1,10 +1,10 @@
1
1
  /**
2
2
  * @namespace proto
3
- * @typedef {import("@hashgraph/proto").proto.ITimestamp} HieroProto.proto.ITimestamp
3
+ * @typedef {import("@hiero-ledger/proto").proto.ITimestamp} HieroProto.proto.ITimestamp
4
4
  */
5
5
  /**
6
6
  * @namespace com
7
- * @typedef {import("@hashgraph/proto").com.hedera.mirror.api.proto.IConsensusTopicResponse} com.hedera.mirror.api.proto.IConsensusTopicResponse
7
+ * @typedef {import("@hiero-ledger/proto").com.hedera.mirror.api.proto.IConsensusTopicResponse} com.hedera.mirror.api.proto.IConsensusTopicResponse
8
8
  */
9
9
  export default class TopicMessageChunk {
10
10
  /**
@@ -38,7 +38,7 @@ export default class TopicMessageChunk {
38
38
  }
39
39
  export namespace HieroProto {
40
40
  namespace proto {
41
- type ITimestamp = import("@hashgraph/proto").proto.ITimestamp;
41
+ type ITimestamp = import("@hiero-ledger/proto").proto.ITimestamp;
42
42
  }
43
43
  }
44
44
  export namespace com {
@@ -46,7 +46,7 @@ export namespace com {
46
46
  namespace mirror {
47
47
  namespace api {
48
48
  namespace proto {
49
- type IConsensusTopicResponse = import("@hashgraph/proto").com.hedera.mirror.api.proto.IConsensusTopicResponse;
49
+ type IConsensusTopicResponse = import("@hiero-ledger/proto").com.hedera.mirror.api.proto.IConsensusTopicResponse;
50
50
  }
51
51
  }
52
52
  }
@@ -1 +1 @@
1
- {"version":3,"file":"TopicMessageChunk.js","sources":["../../src/topic/TopicMessageChunk.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Timestamp from \"../Timestamp.js\";\nimport Long from \"long\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hashgraph/proto\").proto.ITimestamp} HieroProto.proto.ITimestamp\n */\n\n/**\n * @namespace com\n * @typedef {import(\"@hashgraph/proto\").com.hedera.mirror.api.proto.IConsensusTopicResponse} com.hedera.mirror.api.proto.IConsensusTopicResponse\n */\n\nexport default class TopicMessageChunk {\n /**\n * @private\n * @param {object} props\n * @param {Timestamp} props.consensusTimestamp\n * @param {Uint8Array} props.contents\n * @param {Uint8Array} props.runningHash\n * @param {Long} props.sequenceNumber\n */\n constructor(props) {\n /** @readonly */\n this.consensusTimestamp = props.consensusTimestamp;\n /** @readonly */\n this.contents = props.contents;\n /** @readonly */\n this.runningHash = props.runningHash;\n /** @readonly */\n this.sequenceNumber = props.sequenceNumber;\n\n Object.freeze(this);\n }\n\n /**\n * @internal\n * @param {com.hedera.mirror.api.proto.IConsensusTopicResponse} response\n * @returns {TopicMessageChunk}\n */\n static _fromProtobuf(response) {\n return new TopicMessageChunk({\n consensusTimestamp: Timestamp._fromProtobuf(\n /** @type {HieroProto.proto.ITimestamp} */\n (response.consensusTimestamp),\n ),\n contents:\n response.message != null ? response.message : new Uint8Array(),\n runningHash:\n response.runningHash != null\n ? response.runningHash\n : new Uint8Array(),\n sequenceNumber:\n response.sequenceNumber != null\n ? response.sequenceNumber instanceof Long\n ? response.sequenceNumber\n : Long.fromValue(response.sequenceNumber)\n : Long.ZERO,\n });\n }\n\n /**\n * @internal\n * @returns {com.hedera.mirror.api.proto.IConsensusTopicResponse}\n */\n _toProtobuf() {\n return {\n consensusTimestamp: this.consensusTimestamp._toProtobuf(),\n message: this.contents,\n runningHash: this.runningHash,\n sequenceNumber: this.sequenceNumber,\n };\n }\n}\n"],"names":["TopicMessageChunk","constructor","props","this","consensusTimestamp","contents","runningHash","sequenceNumber","Object","freeze","_fromProtobuf","response","Timestamp","message","Uint8Array","Long","fromValue","ZERO","_toProtobuf"],"mappings":"mDAee,MAAMA,EASjB,WAAAC,CAAYC,GAERC,KAAKC,mBAAqBF,EAAME,mBAEhCD,KAAKE,SAAWH,EAAMG,SAEtBF,KAAKG,YAAcJ,EAAMI,YAEzBH,KAAKI,eAAiBL,EAAMK,eAE5BC,OAAOC,OAAON,KACtB,CAOI,oBAAOO,CAAcC,GACjB,OAAO,IAAIX,EAAkB,CACzBI,mBAAoBQ,EAAUF,cAEzBC,EAA2B,oBAEhCN,SACwB,MAApBM,EAASE,QAAkBF,EAASE,QAAU,IAAIC,WACtDR,YAC4B,MAAxBK,EAASL,YACHK,EAASL,YACT,IAAIQ,WACdP,eAC+B,MAA3BI,EAASJ,eACHI,EAASJ,0BAA0BQ,EAC/BJ,EAASJ,eACTQ,EAAKC,UAAUL,EAASJ,gBAC5BQ,EAAKE,MAE3B,CAMI,WAAAC,GACI,MAAO,CACHd,mBAAoBD,KAAKC,mBAAmBc,cAC5CL,QAASV,KAAKE,SACdC,YAAaH,KAAKG,YAClBC,eAAgBJ,KAAKI,eAEjC"}
1
+ {"version":3,"file":"TopicMessageChunk.js","sources":["../../src/topic/TopicMessageChunk.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Timestamp from \"../Timestamp.js\";\nimport Long from \"long\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITimestamp} HieroProto.proto.ITimestamp\n */\n\n/**\n * @namespace com\n * @typedef {import(\"@hiero-ledger/proto\").com.hedera.mirror.api.proto.IConsensusTopicResponse} com.hedera.mirror.api.proto.IConsensusTopicResponse\n */\n\nexport default class TopicMessageChunk {\n /**\n * @private\n * @param {object} props\n * @param {Timestamp} props.consensusTimestamp\n * @param {Uint8Array} props.contents\n * @param {Uint8Array} props.runningHash\n * @param {Long} props.sequenceNumber\n */\n constructor(props) {\n /** @readonly */\n this.consensusTimestamp = props.consensusTimestamp;\n /** @readonly */\n this.contents = props.contents;\n /** @readonly */\n this.runningHash = props.runningHash;\n /** @readonly */\n this.sequenceNumber = props.sequenceNumber;\n\n Object.freeze(this);\n }\n\n /**\n * @internal\n * @param {com.hedera.mirror.api.proto.IConsensusTopicResponse} response\n * @returns {TopicMessageChunk}\n */\n static _fromProtobuf(response) {\n return new TopicMessageChunk({\n consensusTimestamp: Timestamp._fromProtobuf(\n /** @type {HieroProto.proto.ITimestamp} */\n (response.consensusTimestamp),\n ),\n contents:\n response.message != null ? response.message : new Uint8Array(),\n runningHash:\n response.runningHash != null\n ? response.runningHash\n : new Uint8Array(),\n sequenceNumber:\n response.sequenceNumber != null\n ? response.sequenceNumber instanceof Long\n ? response.sequenceNumber\n : Long.fromValue(response.sequenceNumber)\n : Long.ZERO,\n });\n }\n\n /**\n * @internal\n * @returns {com.hedera.mirror.api.proto.IConsensusTopicResponse}\n */\n _toProtobuf() {\n return {\n consensusTimestamp: this.consensusTimestamp._toProtobuf(),\n message: this.contents,\n runningHash: this.runningHash,\n sequenceNumber: this.sequenceNumber,\n };\n }\n}\n"],"names":["TopicMessageChunk","constructor","props","this","consensusTimestamp","contents","runningHash","sequenceNumber","Object","freeze","_fromProtobuf","response","Timestamp","message","Uint8Array","Long","fromValue","ZERO","_toProtobuf"],"mappings":"mDAee,MAAMA,EASjB,WAAAC,CAAYC,GAERC,KAAKC,mBAAqBF,EAAME,mBAEhCD,KAAKE,SAAWH,EAAMG,SAEtBF,KAAKG,YAAcJ,EAAMI,YAEzBH,KAAKI,eAAiBL,EAAMK,eAE5BC,OAAOC,OAAON,KACtB,CAOI,oBAAOO,CAAcC,GACjB,OAAO,IAAIX,EAAkB,CACzBI,mBAAoBQ,EAAUF,cAEzBC,EAA2B,oBAEhCN,SACwB,MAApBM,EAASE,QAAkBF,EAASE,QAAU,IAAIC,WACtDR,YAC4B,MAAxBK,EAASL,YACHK,EAASL,YACT,IAAIQ,WACdP,eAC+B,MAA3BI,EAASJ,eACHI,EAASJ,0BAA0BQ,EAC/BJ,EAASJ,eACTQ,EAAKC,UAAUL,EAASJ,gBAC5BQ,EAAKE,MAE3B,CAMI,WAAAC,GACI,MAAO,CACHd,mBAAoBD,KAAKC,mBAAmBc,cAC5CL,QAASV,KAAKE,SACdC,YAAaH,KAAKG,YAClBC,eAAgBJ,KAAKI,eAEjC"}
@@ -7,7 +7,7 @@ exports.default = void 0;
7
7
  var _TransactionId = _interopRequireDefault(require("../transaction/TransactionId.cjs"));
8
8
  var _SubscriptionHandle = _interopRequireDefault(require("./SubscriptionHandle.cjs"));
9
9
  var _TopicMessage = _interopRequireDefault(require("./TopicMessage.cjs"));
10
- var HieroProto = _interopRequireWildcard(require("@hashgraph/proto"));
10
+ var HieroProto = _interopRequireWildcard(require("@hiero-ledger/proto"));
11
11
  var _TopicId = _interopRequireDefault(require("./TopicId.cjs"));
12
12
  var _long = _interopRequireDefault(require("long"));
13
13
  var _Timestamp = _interopRequireDefault(require("../Timestamp.cjs"));
@@ -1,2 +1,2 @@
1
- import t from"../transaction/TransactionId.js";import e from"./SubscriptionHandle.js";import r from"./TopicMessage.js";import*as i from"@hashgraph/proto";import s from"./TopicId.js";import n from"long";import o from"../Timestamp.js";import{RST_STREAM as l}from"../Executable.js";class a{constructor(t={}){this._topicId=null,null!=t.topicId&&this.setTopicId(t.topicId),this._startTime=null,null!=t.startTime&&this.setStartTime(t.startTime),this._endTime=null,null!=t.endTime&&this.setEndTime(t.endTime),this._limit=null,null!=t.limit&&this.setLimit(t.limit),this._errorHandler=(t,e)=>{console.error(`Error attempting to subscribe to topic: ${null!=this._topicId?this._topicId.toString():""}`)},null!=t.errorHandler&&(this._errorHandler=t.errorHandler),this._listener=null,this._completionHandler=()=>{console.log(`Subscription to topic ${null!=this._topicId?this._topicId.toString():""} complete`)},null!=t.completionHandler&&(this._completionHandler=t.completionHandler),this._maxAttempts=20,this._maxBackoff=8e3,this._retryHandler=t=>{if(null!=t){if(t instanceof Error)return!0;switch(t.code){case 13:return l.test(t.details.toString());case 5:case 8:case 14:case 17:return!0;default:return!1}}return!1},null!=t.retryHandler&&(this._retryHandler=t.retryHandler),this._attempt=0,this._handle=null,this.setMaxBackoff(8e3)}get topicId(){return this._topicId}setTopicId(t){return this.requireNotSubscribed(),this._topicId="string"==typeof t?s.fromString(t):t.clone(),this}get startTime(){return this._startTime}setStartTime(t){return this.requireNotSubscribed(),this._startTime=t instanceof o?t:t instanceof Date?o.fromDate(t):new o(t,0),this}get endTime(){return this._endTime}setEndTime(t){return this.requireNotSubscribed(),this._endTime=t instanceof o?t:t instanceof Date?o.fromDate(t):new o(t,0),this}get limit(){return this._limit}setLimit(t){return this.requireNotSubscribed(),this._limit=t instanceof n?t:n.fromValue(t),this}setErrorHandler(t){return this._errorHandler=t,this}setCompletionHandler(t){return this.requireNotSubscribed(),this._completionHandler=t,this}setMaxAttempts(t){return this.requireNotSubscribed(),this._maxAttempts=t,this}setMaxBackoff(t){return this.requireNotSubscribed(),this._maxBackoff=t,this}subscribe(t,r,i){return this._handle=new e,this._listener=i,null!=r&&(this._errorHandler=r),this._makeServerStreamRequest(t),this._handle}_makeServerStreamRequest(t){const e=this._buildConsensusRequest(),r=new Map,i=t._mirrorNetwork.getNextMirrorNode().getChannel().makeServerStreamRequest("ConsensusService","subscribeTopic",e,t=>this._handleMessage(t,r),e=>this._handleError(e,t),this._completionHandler);null!=this._handle&&this._handle._setCall(()=>i())}requireNotSubscribed(){if(null!=this._handle)throw new Error("Cannot change fields on an already subscribed query")}_passTopicMessage(t){try{if(null==this._listener)throw new Error("(BUG) listener is unexpectedly not set");this._listener(t)}catch(e){this._errorHandler(t,e)}}_buildConsensusRequest(){return i.com.hedera.mirror.api.proto.ConsensusTopicQuery.encode({topicID:this._topicId?._toProtobuf()??null,consensusStartTime:this._startTime?._toProtobuf()??null,consensusEndTime:this._endTime?._toProtobuf()??null,limit:this._limit}).finish()}_handleMessage(t,e){const s=i.com.hedera.mirror.api.proto.ConsensusTopicResponse.decode(t);this._limit?.gt(0)&&(this._limit=this._limit.sub(1)),this._startTime=o._fromProtobuf(s.consensusTimestamp).plusNanos(1),null==s.chunkInfo||null!=s.chunkInfo&&1===s.chunkInfo.total?this._passTopicMessage(r._ofSingle(s)):this._handleChunkedMessage(s,e)}_handleChunkedMessage(e,i){const s=e.chunkInfo,n=s.initialTransactionID,o=s.total,l=t._fromProtobuf(n).toString();let a=[];const h=i.get(l);if(null==h?i.set(l,a):a=h,a.push(e),a.length===o){const t=r._ofMany(a);i.delete(l),this._passTopicMessage(t)}}_handleError(t,e){const r=t instanceof Error?t.message:t.details;this._handle?._unsubscribed||(this.shouldRetry(t)?this._scheduleRetry(e,r):this._errorHandler(null,new Error(r)))}shouldRetry(t){return this._attempt<this._maxAttempts&&this._retryHandler(t)}_scheduleRetry(t,e){const r=Math.min(250*2**this._attempt,this._maxBackoff);console.warn(`Error subscribing to topic ${this._topicId?.toString()??"UNKNOWN"} during attempt ${this._attempt}. Waiting ${r} ms before next attempt: ${e}`),this._attempt+=1,setTimeout(()=>this._makeServerStreamRequest(t),r)}}export{a as default};
1
+ import t from"../transaction/TransactionId.js";import e from"./SubscriptionHandle.js";import r from"./TopicMessage.js";import*as i from"@hiero-ledger/proto";import s from"./TopicId.js";import n from"long";import o from"../Timestamp.js";import{RST_STREAM as l}from"../Executable.js";class a{constructor(t={}){this._topicId=null,null!=t.topicId&&this.setTopicId(t.topicId),this._startTime=null,null!=t.startTime&&this.setStartTime(t.startTime),this._endTime=null,null!=t.endTime&&this.setEndTime(t.endTime),this._limit=null,null!=t.limit&&this.setLimit(t.limit),this._errorHandler=(t,e)=>{console.error(`Error attempting to subscribe to topic: ${null!=this._topicId?this._topicId.toString():""}`)},null!=t.errorHandler&&(this._errorHandler=t.errorHandler),this._listener=null,this._completionHandler=()=>{console.log(`Subscription to topic ${null!=this._topicId?this._topicId.toString():""} complete`)},null!=t.completionHandler&&(this._completionHandler=t.completionHandler),this._maxAttempts=20,this._maxBackoff=8e3,this._retryHandler=t=>{if(null!=t){if(t instanceof Error)return!0;switch(t.code){case 13:return l.test(t.details.toString());case 5:case 8:case 14:case 17:return!0;default:return!1}}return!1},null!=t.retryHandler&&(this._retryHandler=t.retryHandler),this._attempt=0,this._handle=null,this.setMaxBackoff(8e3)}get topicId(){return this._topicId}setTopicId(t){return this.requireNotSubscribed(),this._topicId="string"==typeof t?s.fromString(t):t.clone(),this}get startTime(){return this._startTime}setStartTime(t){return this.requireNotSubscribed(),this._startTime=t instanceof o?t:t instanceof Date?o.fromDate(t):new o(t,0),this}get endTime(){return this._endTime}setEndTime(t){return this.requireNotSubscribed(),this._endTime=t instanceof o?t:t instanceof Date?o.fromDate(t):new o(t,0),this}get limit(){return this._limit}setLimit(t){return this.requireNotSubscribed(),this._limit=t instanceof n?t:n.fromValue(t),this}setErrorHandler(t){return this._errorHandler=t,this}setCompletionHandler(t){return this.requireNotSubscribed(),this._completionHandler=t,this}setMaxAttempts(t){return this.requireNotSubscribed(),this._maxAttempts=t,this}setMaxBackoff(t){return this.requireNotSubscribed(),this._maxBackoff=t,this}subscribe(t,r,i){return this._handle=new e,this._listener=i,null!=r&&(this._errorHandler=r),this._makeServerStreamRequest(t),this._handle}_makeServerStreamRequest(t){const e=this._buildConsensusRequest(),r=new Map,i=t._mirrorNetwork.getNextMirrorNode().getChannel().makeServerStreamRequest("ConsensusService","subscribeTopic",e,t=>this._handleMessage(t,r),e=>this._handleError(e,t),this._completionHandler);null!=this._handle&&this._handle._setCall(()=>i())}requireNotSubscribed(){if(null!=this._handle)throw new Error("Cannot change fields on an already subscribed query")}_passTopicMessage(t){try{if(null==this._listener)throw new Error("(BUG) listener is unexpectedly not set");this._listener(t)}catch(e){this._errorHandler(t,e)}}_buildConsensusRequest(){return i.com.hedera.mirror.api.proto.ConsensusTopicQuery.encode({topicID:this._topicId?._toProtobuf()??null,consensusStartTime:this._startTime?._toProtobuf()??null,consensusEndTime:this._endTime?._toProtobuf()??null,limit:this._limit}).finish()}_handleMessage(t,e){const s=i.com.hedera.mirror.api.proto.ConsensusTopicResponse.decode(t);this._limit?.gt(0)&&(this._limit=this._limit.sub(1)),this._startTime=o._fromProtobuf(s.consensusTimestamp).plusNanos(1),null==s.chunkInfo||null!=s.chunkInfo&&1===s.chunkInfo.total?this._passTopicMessage(r._ofSingle(s)):this._handleChunkedMessage(s,e)}_handleChunkedMessage(e,i){const s=e.chunkInfo,n=s.initialTransactionID,o=s.total,l=t._fromProtobuf(n).toString();let a=[];const h=i.get(l);if(null==h?i.set(l,a):a=h,a.push(e),a.length===o){const t=r._ofMany(a);i.delete(l),this._passTopicMessage(t)}}_handleError(t,e){const r=t instanceof Error?t.message:t.details;this._handle?._unsubscribed||(this.shouldRetry(t)?this._scheduleRetry(e,r):this._errorHandler(null,new Error(r)))}shouldRetry(t){return this._attempt<this._maxAttempts&&this._retryHandler(t)}_scheduleRetry(t,e){const r=Math.min(250*2**this._attempt,this._maxBackoff);console.warn(`Error subscribing to topic ${this._topicId?.toString()??"UNKNOWN"} during attempt ${this._attempt}. Waiting ${r} ms before next attempt: ${e}`),this._attempt+=1,setTimeout(()=>this._makeServerStreamRequest(t),r)}}export{a as default};
2
2
  //# sourceMappingURL=TopicMessageQuery.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TopicMessageQuery.js","sources":["../../src/topic/TopicMessageQuery.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport TransactionId from \"../transaction/TransactionId.js\";\nimport SubscriptionHandle from \"./SubscriptionHandle.js\";\nimport TopicMessage from \"./TopicMessage.js\";\nimport * as HieroProto from \"@hashgraph/proto\";\nimport TopicId from \"./TopicId.js\";\nimport Long from \"long\";\nimport Timestamp from \"../Timestamp.js\";\nimport { RST_STREAM } from \"../Executable.js\";\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../channel/MirrorChannel.js\").default} MirrorChannel\n * @typedef {import(\"../channel/MirrorChannel.js\").MirrorError} MirrorError\n */\n\n/**\n * @template {Channel} ChannelT\n * @typedef {import(\"../client/Client.js\").default<ChannelT, MirrorChannel>} Client<ChannelT, MirrorChannel>\n */\n\n/**\n * Represents a class that you can use to subscribe to\n * different topics on Hedera network.\n * @augments {Query<TopicMessageQuery>}\n */\nexport default class TopicMessageQuery {\n /**\n * @param {object} props\n * @param {TopicId | string} [props.topicId]\n * @param {Timestamp} [props.startTime]\n * @param {Timestamp} [props.endTime]\n * @param {(message: TopicMessage | null, error: Error)=> void} [props.errorHandler]\n * @param {() => void} [props.completionHandler]\n * @param {(error: MirrorError | Error | null) => boolean} [props.retryHandler]\n * @param {Long | number} [props.limit]\n */\n constructor(props = {}) {\n /**\n * @private\n * @type {?TopicId}\n */\n this._topicId = null;\n if (props.topicId != null) {\n this.setTopicId(props.topicId);\n }\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._startTime = null;\n if (props.startTime != null) {\n this.setStartTime(props.startTime);\n }\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._endTime = null;\n if (props.endTime != null) {\n this.setEndTime(props.endTime);\n }\n\n /**\n * @private\n * @type {?Long}\n */\n this._limit = null;\n if (props.limit != null) {\n this.setLimit(props.limit);\n }\n\n /**\n * @private\n * @type {(message: TopicMessage | null, error: Error) => void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n this._errorHandler = (message, error) => {\n console.error(\n `Error attempting to subscribe to topic: ${\n this._topicId != null ? this._topicId.toString() : \"\"\n }`,\n );\n };\n\n if (props.errorHandler != null) {\n this._errorHandler = props.errorHandler;\n }\n\n /*\n * @private\n * @type {((message: TopicMessage) => void) | null}\n */\n this._listener = null;\n\n /**\n * @private\n * @type {() => void}\n */\n this._completionHandler = () => {\n console.log(\n `Subscription to topic ${\n this._topicId != null ? this._topicId.toString() : \"\"\n } complete`,\n );\n };\n\n if (props.completionHandler != null) {\n this._completionHandler = props.completionHandler;\n }\n\n /* The number of times we can retry the grpc call\n *\n * @internal\n * @type {number}\n */\n this._maxAttempts = 20;\n\n /**\n * This is the request's max backoff\n *\n * @internal\n * @type {number}\n */\n this._maxBackoff = 8000;\n\n /**\n * @private\n * @type {(error: MirrorError | Error | null) => boolean}\n */\n this._retryHandler = (error) => {\n if (error != null) {\n if (error instanceof Error) {\n // Retry on all errors which are not `MirrorError` because they're\n // likely lower level HTTP/2 errors\n return true;\n } else {\n // Retry on `NOT_FOUND`, `RESOURCE_EXHAUSTED`, `UNAVAILABLE`, and conditionally on `INTERNAL`\n // if the message matches the right regex.\n switch (error.code) {\n // INTERNAL\n // eslint-disable-next-line no-fallthrough\n case 13:\n return RST_STREAM.test(error.details.toString());\n // NOT_FOUND\n // eslint-disable-next-line no-fallthrough\n case 5:\n // RESOURCE_EXHAUSTED\n // eslint-disable-next-line no-fallthrough\n case 8:\n // UNAVAILABLE\n // eslint-disable-next-line no-fallthrough\n case 14:\n case 17:\n return true;\n default:\n return false;\n }\n }\n }\n\n return false;\n };\n\n if (props.retryHandler != null) {\n this._retryHandler = props.retryHandler;\n }\n\n /**\n * @private\n * @type {number}\n */\n this._attempt = 0;\n\n /**\n * @private\n * @type {SubscriptionHandle | null}\n */\n this._handle = null;\n\n this.setMaxBackoff(8000);\n }\n\n /**\n * @returns {?TopicId}\n */\n get topicId() {\n return this._topicId;\n }\n\n /**\n * @param {TopicId | string} topicId\n * @returns {TopicMessageQuery}\n */\n setTopicId(topicId) {\n this.requireNotSubscribed();\n\n this._topicId =\n typeof topicId === \"string\"\n ? TopicId.fromString(topicId)\n : topicId.clone();\n\n return this;\n }\n\n /**\n * @returns {?Timestamp}\n */\n get startTime() {\n return this._startTime;\n }\n\n /**\n * @param {Timestamp | Date | number} startTime\n * @returns {TopicMessageQuery}\n */\n setStartTime(startTime) {\n this.requireNotSubscribed();\n\n this._startTime =\n startTime instanceof Timestamp\n ? startTime\n : startTime instanceof Date\n ? Timestamp.fromDate(startTime)\n : new Timestamp(startTime, 0);\n return this;\n }\n\n /**\n * @returns {?Timestamp}\n */\n get endTime() {\n return this._endTime;\n }\n\n /**\n * @param {Timestamp | Date | number} endTime\n * @returns {TopicMessageQuery}\n */\n setEndTime(endTime) {\n this.requireNotSubscribed();\n\n this._endTime =\n endTime instanceof Timestamp\n ? endTime\n : endTime instanceof Date\n ? Timestamp.fromDate(endTime)\n : new Timestamp(endTime, 0);\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get limit() {\n return this._limit;\n }\n\n /**\n * @param {Long | number} limit\n * @returns {TopicMessageQuery}\n */\n setLimit(limit) {\n this.requireNotSubscribed();\n\n this._limit = limit instanceof Long ? limit : Long.fromValue(limit);\n\n return this;\n }\n\n /**\n * @param {(message: TopicMessage | null, error: Error)=> void} errorHandler\n * @returns {TopicMessageQuery}\n */\n setErrorHandler(errorHandler) {\n this._errorHandler = errorHandler;\n\n return this;\n }\n\n /**\n * @param {() => void} completionHandler\n * @returns {TopicMessageQuery}\n */\n setCompletionHandler(completionHandler) {\n this.requireNotSubscribed();\n\n this._completionHandler = completionHandler;\n\n return this;\n }\n\n /**\n * @param {number} attempts\n * @returns {this}\n */\n setMaxAttempts(attempts) {\n this.requireNotSubscribed();\n this._maxAttempts = attempts;\n return this;\n }\n\n /**\n * @param {number} backoff\n * @returns {this}\n */\n setMaxBackoff(backoff) {\n this.requireNotSubscribed();\n this._maxBackoff = backoff;\n return this;\n }\n\n /**\n * @param {Client<Channel>} client\n * @param {((message: TopicMessage | null, error: Error) => void) | null} errorHandler\n * @param {(message: TopicMessage) => void} listener\n * @returns {SubscriptionHandle}\n */\n subscribe(client, errorHandler, listener) {\n this._handle = new SubscriptionHandle();\n this._listener = listener;\n\n if (errorHandler != null) {\n this._errorHandler = errorHandler;\n }\n\n this._makeServerStreamRequest(client);\n\n return this._handle;\n }\n\n /**\n * Makes a server stream request to subscribe to topic messages\n * @private\n * @param {Client<Channel>} client\n * @returns {void}\n */\n _makeServerStreamRequest(client) {\n const request = this._buildConsensusRequest();\n /** @type {Map<string, HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse[]>} */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const list = new Map();\n\n const streamHandler = client._mirrorNetwork\n .getNextMirrorNode()\n .getChannel()\n .makeServerStreamRequest(\n \"ConsensusService\",\n \"subscribeTopic\",\n request,\n (data) => this._handleMessage(data, list),\n (error) => this._handleError(error, client),\n this._completionHandler,\n );\n\n if (this._handle != null) {\n this._handle._setCall(() => streamHandler());\n }\n }\n\n requireNotSubscribed() {\n if (this._handle != null) {\n throw new Error(\n \"Cannot change fields on an already subscribed query\",\n );\n }\n }\n\n /**\n * @private\n * @param {TopicMessage} topicMessage\n */\n _passTopicMessage(topicMessage) {\n try {\n if (this._listener != null) {\n this._listener(topicMessage);\n } else {\n throw new Error(\"(BUG) listener is unexpectedly not set\");\n }\n } catch (error) {\n this._errorHandler(topicMessage, /** @type {Error} */ (error));\n }\n }\n\n /**\n * Builds the consensus topic query request\n * @private\n * @returns {Uint8Array} Encoded consensus topic query\n */\n _buildConsensusRequest() {\n return HieroProto.com.hedera.mirror.api.proto.ConsensusTopicQuery.encode(\n {\n topicID: this._topicId?._toProtobuf() ?? null,\n consensusStartTime: this._startTime?._toProtobuf() ?? null,\n consensusEndTime: this._endTime?._toProtobuf() ?? null,\n limit: this._limit,\n },\n ).finish();\n }\n\n /**\n * Handles an incoming message from the topic subscription\n * @private\n * @param {Uint8Array} data - Raw message data\n * @param {Map<string, HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse[]>} list\n */\n _handleMessage(data, list) {\n const message =\n HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse.decode(\n data,\n );\n\n if (this._limit?.gt(0)) {\n this._limit = this._limit.sub(1);\n }\n\n this._startTime = Timestamp._fromProtobuf(\n /** @type {HieroProto.proto.ITimestamp} */ (\n message.consensusTimestamp\n ),\n ).plusNanos(1);\n\n if (\n message.chunkInfo == null ||\n (message.chunkInfo != null && message.chunkInfo.total === 1)\n ) {\n this._passTopicMessage(TopicMessage._ofSingle(message));\n } else {\n this._handleChunkedMessage(message, list);\n }\n }\n\n /**\n * Handles a chunked message from the topic subscription\n * @private\n * @param {HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse} message - The message response\n * @param {Map<string, HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse[]>} list\n */\n _handleChunkedMessage(message, list) {\n const chunkInfo =\n /** @type {HieroProto.proto.IConsensusMessageChunkInfo} */ (\n message.chunkInfo\n );\n const initialTransactionID =\n /** @type {HieroProto.proto.ITransactionID} */ (\n chunkInfo.initialTransactionID\n );\n const total = /** @type {number} */ (chunkInfo.total);\n const transactionId =\n TransactionId._fromProtobuf(initialTransactionID).toString();\n\n /** @type {HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse[]} */\n let responses = [];\n\n const temp = list.get(transactionId);\n if (temp == null) {\n list.set(transactionId, responses);\n } else {\n responses = temp;\n }\n\n responses.push(message);\n\n if (responses.length === total) {\n const topicMessage = TopicMessage._ofMany(responses);\n list.delete(transactionId);\n this._passTopicMessage(topicMessage);\n }\n }\n\n /**\n * Handles errors from the topic subscription\n * @private\n * @param {MirrorError | Error} error - The error that occurred\n * @param {Client<Channel>} client - The client to use for retries\n * @returns {void}\n */\n _handleError(error, client) {\n const message = error instanceof Error ? error.message : error.details;\n\n if (this._handle?._unsubscribed) {\n return;\n }\n\n if (this.shouldRetry(error)) {\n this._scheduleRetry(client, message);\n } else {\n this._errorHandler(null, new Error(message));\n }\n }\n\n /**\n * Determines if a retry should be attempted\n * @private\n * @param {MirrorError | Error} error - The error to check\n * @returns {boolean} - Whether to retry\n */\n shouldRetry(error) {\n return this._attempt < this._maxAttempts && this._retryHandler(error);\n }\n\n /**\n * Schedules a retry of the server stream request\n * @private\n * @param {Client<Channel>} client - The client to use for the retry\n * @param {string} errorMessage - The error message for logging\n * @returns {void}\n */\n _scheduleRetry(client, errorMessage) {\n const delay = Math.min(250 * 2 ** this._attempt, this._maxBackoff);\n\n console.warn(\n `Error subscribing to topic ${\n this._topicId?.toString() ?? \"UNKNOWN\"\n } ` +\n `during attempt ${this._attempt}. Waiting ${delay} ms before next attempt: ${errorMessage}`,\n );\n\n this._attempt += 1;\n setTimeout(() => this._makeServerStreamRequest(client), delay);\n }\n}\n"],"names":["TopicMessageQuery","constructor","props","this","_topicId","topicId","setTopicId","_startTime","startTime","setStartTime","_endTime","endTime","setEndTime","_limit","limit","setLimit","_errorHandler","message","error","console","toString","errorHandler","_listener","_completionHandler","log","completionHandler","_maxAttempts","_maxBackoff","_retryHandler","Error","code","RST_STREAM","test","details","retryHandler","_attempt","_handle","setMaxBackoff","requireNotSubscribed","TopicId","fromString","clone","Timestamp","Date","fromDate","Long","fromValue","setErrorHandler","setCompletionHandler","setMaxAttempts","attempts","backoff","subscribe","client","listener","SubscriptionHandle","_makeServerStreamRequest","request","_buildConsensusRequest","list","Map","streamHandler","_mirrorNetwork","getNextMirrorNode","getChannel","makeServerStreamRequest","data","_handleMessage","_handleError","_setCall","_passTopicMessage","topicMessage","HieroProto","com","hedera","mirror","api","proto","ConsensusTopicQuery","encode","topicID","_toProtobuf","consensusStartTime","consensusEndTime","finish","ConsensusTopicResponse","decode","gt","sub","_fromProtobuf","plusNanos","chunkInfo","total","TopicMessage","_ofSingle","_handleChunkedMessage","initialTransactionID","transactionId","TransactionId","responses","temp","get","set","push","length","_ofMany","delete","_unsubscribed","shouldRetry","_scheduleRetry","errorMessage","delay","Math","min","warn","setTimeout"],"mappings":"uRA2Be,MAAMA,EAWjB,WAAAC,CAAYC,EAAQ,IAKhBC,KAAKC,SAAW,KACK,MAAjBF,EAAMG,SACNF,KAAKG,WAAWJ,EAAMG,SAO1BF,KAAKI,WAAa,KACK,MAAnBL,EAAMM,WACNL,KAAKM,aAAaP,EAAMM,WAO5BL,KAAKO,SAAW,KACK,MAAjBR,EAAMS,SACNR,KAAKS,WAAWV,EAAMS,SAO1BR,KAAKU,OAAS,KACK,MAAfX,EAAMY,OACNX,KAAKY,SAASb,EAAMY,OAQxBX,KAAKa,cAAgB,CAACC,EAASC,KAC3BC,QAAQD,MACJ,2CACqB,MAAjBf,KAAKC,SAAmBD,KAAKC,SA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K0G,eAAexD,EAAQpC,GAE5Bd,KAAKa,cAAc,KAAM,IAAIa,MAAMZ,IAE/C,CAQI,WAAA2F,CAAY1F,GACR,OAAOf,KAAKgC,SAAWhC,KAAKuB,cAAgBvB,KAAKyB,cAAcV,EACvE,CASI,cAAA2F,CAAexD,EAAQyD,GACnB,MAAMC,EAAQC,KAAKC,IAAI,IAAM,GAAK9G,KAAKgC,SAAUhC,KAAKwB,aAEtDR,QAAQ+F,KACJ,8BACI/G,KAAKC,UAAUgB,YAAc,4BAEXjB,KAAKgC,qBAAqB4E,6BAAiCD,KAGrF3G,KAAKgC,UAAY,EACjBgF,WAAW,IAAMhH,KAAKqD,yBAAyBH,GAAS0D,EAChE"}
1
+ {"version":3,"file":"TopicMessageQuery.js","sources":["../../src/topic/TopicMessageQuery.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport TransactionId from \"../transaction/TransactionId.js\";\nimport SubscriptionHandle from \"./SubscriptionHandle.js\";\nimport TopicMessage from \"./TopicMessage.js\";\nimport * as HieroProto from \"@hiero-ledger/proto\";\nimport TopicId from \"./TopicId.js\";\nimport Long from \"long\";\nimport Timestamp from \"../Timestamp.js\";\nimport { RST_STREAM } from \"../Executable.js\";\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../channel/MirrorChannel.js\").default} MirrorChannel\n * @typedef {import(\"../channel/MirrorChannel.js\").MirrorError} MirrorError\n */\n\n/**\n * @template {Channel} ChannelT\n * @typedef {import(\"../client/Client.js\").default<ChannelT, MirrorChannel>} Client<ChannelT, MirrorChannel>\n */\n\n/**\n * Represents a class that you can use to subscribe to\n * different topics on Hedera network.\n * @augments {Query<TopicMessageQuery>}\n */\nexport default class TopicMessageQuery {\n /**\n * @param {object} props\n * @param {TopicId | string} [props.topicId]\n * @param {Timestamp} [props.startTime]\n * @param {Timestamp} [props.endTime]\n * @param {(message: TopicMessage | null, error: Error)=> void} [props.errorHandler]\n * @param {() => void} [props.completionHandler]\n * @param {(error: MirrorError | Error | null) => boolean} [props.retryHandler]\n * @param {Long | number} [props.limit]\n */\n constructor(props = {}) {\n /**\n * @private\n * @type {?TopicId}\n */\n this._topicId = null;\n if (props.topicId != null) {\n this.setTopicId(props.topicId);\n }\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._startTime = null;\n if (props.startTime != null) {\n this.setStartTime(props.startTime);\n }\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._endTime = null;\n if (props.endTime != null) {\n this.setEndTime(props.endTime);\n }\n\n /**\n * @private\n * @type {?Long}\n */\n this._limit = null;\n if (props.limit != null) {\n this.setLimit(props.limit);\n }\n\n /**\n * @private\n * @type {(message: TopicMessage | null, error: Error) => void}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n this._errorHandler = (message, error) => {\n console.error(\n `Error attempting to subscribe to topic: ${\n this._topicId != null ? this._topicId.toString() : \"\"\n }`,\n );\n };\n\n if (props.errorHandler != null) {\n this._errorHandler = props.errorHandler;\n }\n\n /*\n * @private\n * @type {((message: TopicMessage) => void) | null}\n */\n this._listener = null;\n\n /**\n * @private\n * @type {() => void}\n */\n this._completionHandler = () => {\n console.log(\n `Subscription to topic ${\n this._topicId != null ? this._topicId.toString() : \"\"\n } complete`,\n );\n };\n\n if (props.completionHandler != null) {\n this._completionHandler = props.completionHandler;\n }\n\n /* The number of times we can retry the grpc call\n *\n * @internal\n * @type {number}\n */\n this._maxAttempts = 20;\n\n /**\n * This is the request's max backoff\n *\n * @internal\n * @type {number}\n */\n this._maxBackoff = 8000;\n\n /**\n * @private\n * @type {(error: MirrorError | Error | null) => boolean}\n */\n this._retryHandler = (error) => {\n if (error != null) {\n if (error instanceof Error) {\n // Retry on all errors which are not `MirrorError` because they're\n // likely lower level HTTP/2 errors\n return true;\n } else {\n // Retry on `NOT_FOUND`, `RESOURCE_EXHAUSTED`, `UNAVAILABLE`, and conditionally on `INTERNAL`\n // if the message matches the right regex.\n switch (error.code) {\n // INTERNAL\n // eslint-disable-next-line no-fallthrough\n case 13:\n return RST_STREAM.test(error.details.toString());\n // NOT_FOUND\n // eslint-disable-next-line no-fallthrough\n case 5:\n // RESOURCE_EXHAUSTED\n // eslint-disable-next-line no-fallthrough\n case 8:\n // UNAVAILABLE\n // eslint-disable-next-line no-fallthrough\n case 14:\n case 17:\n return true;\n default:\n return false;\n }\n }\n }\n\n return false;\n };\n\n if (props.retryHandler != null) {\n this._retryHandler = props.retryHandler;\n }\n\n /**\n * @private\n * @type {number}\n */\n this._attempt = 0;\n\n /**\n * @private\n * @type {SubscriptionHandle | null}\n */\n this._handle = null;\n\n this.setMaxBackoff(8000);\n }\n\n /**\n * @returns {?TopicId}\n */\n get topicId() {\n return this._topicId;\n }\n\n /**\n * @param {TopicId | string} topicId\n * @returns {TopicMessageQuery}\n */\n setTopicId(topicId) {\n this.requireNotSubscribed();\n\n this._topicId =\n typeof topicId === \"string\"\n ? TopicId.fromString(topicId)\n : topicId.clone();\n\n return this;\n }\n\n /**\n * @returns {?Timestamp}\n */\n get startTime() {\n return this._startTime;\n }\n\n /**\n * @param {Timestamp | Date | number} startTime\n * @returns {TopicMessageQuery}\n */\n setStartTime(startTime) {\n this.requireNotSubscribed();\n\n this._startTime =\n startTime instanceof Timestamp\n ? startTime\n : startTime instanceof Date\n ? Timestamp.fromDate(startTime)\n : new Timestamp(startTime, 0);\n return this;\n }\n\n /**\n * @returns {?Timestamp}\n */\n get endTime() {\n return this._endTime;\n }\n\n /**\n * @param {Timestamp | Date | number} endTime\n * @returns {TopicMessageQuery}\n */\n setEndTime(endTime) {\n this.requireNotSubscribed();\n\n this._endTime =\n endTime instanceof Timestamp\n ? endTime\n : endTime instanceof Date\n ? Timestamp.fromDate(endTime)\n : new Timestamp(endTime, 0);\n return this;\n }\n\n /**\n * @returns {?Long}\n */\n get limit() {\n return this._limit;\n }\n\n /**\n * @param {Long | number} limit\n * @returns {TopicMessageQuery}\n */\n setLimit(limit) {\n this.requireNotSubscribed();\n\n this._limit = limit instanceof Long ? limit : Long.fromValue(limit);\n\n return this;\n }\n\n /**\n * @param {(message: TopicMessage | null, error: Error)=> void} errorHandler\n * @returns {TopicMessageQuery}\n */\n setErrorHandler(errorHandler) {\n this._errorHandler = errorHandler;\n\n return this;\n }\n\n /**\n * @param {() => void} completionHandler\n * @returns {TopicMessageQuery}\n */\n setCompletionHandler(completionHandler) {\n this.requireNotSubscribed();\n\n this._completionHandler = completionHandler;\n\n return this;\n }\n\n /**\n * @param {number} attempts\n * @returns {this}\n */\n setMaxAttempts(attempts) {\n this.requireNotSubscribed();\n this._maxAttempts = attempts;\n return this;\n }\n\n /**\n * @param {number} backoff\n * @returns {this}\n */\n setMaxBackoff(backoff) {\n this.requireNotSubscribed();\n this._maxBackoff = backoff;\n return this;\n }\n\n /**\n * @param {Client<Channel>} client\n * @param {((message: TopicMessage | null, error: Error) => void) | null} errorHandler\n * @param {(message: TopicMessage) => void} listener\n * @returns {SubscriptionHandle}\n */\n subscribe(client, errorHandler, listener) {\n this._handle = new SubscriptionHandle();\n this._listener = listener;\n\n if (errorHandler != null) {\n this._errorHandler = errorHandler;\n }\n\n this._makeServerStreamRequest(client);\n\n return this._handle;\n }\n\n /**\n * Makes a server stream request to subscribe to topic messages\n * @private\n * @param {Client<Channel>} client\n * @returns {void}\n */\n _makeServerStreamRequest(client) {\n const request = this._buildConsensusRequest();\n /** @type {Map<string, HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse[]>} */\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n const list = new Map();\n\n const streamHandler = client._mirrorNetwork\n .getNextMirrorNode()\n .getChannel()\n .makeServerStreamRequest(\n \"ConsensusService\",\n \"subscribeTopic\",\n request,\n (data) => this._handleMessage(data, list),\n (error) => this._handleError(error, client),\n this._completionHandler,\n );\n\n if (this._handle != null) {\n this._handle._setCall(() => streamHandler());\n }\n }\n\n requireNotSubscribed() {\n if (this._handle != null) {\n throw new Error(\n \"Cannot change fields on an already subscribed query\",\n );\n }\n }\n\n /**\n * @private\n * @param {TopicMessage} topicMessage\n */\n _passTopicMessage(topicMessage) {\n try {\n if (this._listener != null) {\n this._listener(topicMessage);\n } else {\n throw new Error(\"(BUG) listener is unexpectedly not set\");\n }\n } catch (error) {\n this._errorHandler(topicMessage, /** @type {Error} */ (error));\n }\n }\n\n /**\n * Builds the consensus topic query request\n * @private\n * @returns {Uint8Array} Encoded consensus topic query\n */\n _buildConsensusRequest() {\n return HieroProto.com.hedera.mirror.api.proto.ConsensusTopicQuery.encode(\n {\n topicID: this._topicId?._toProtobuf() ?? null,\n consensusStartTime: this._startTime?._toProtobuf() ?? null,\n consensusEndTime: this._endTime?._toProtobuf() ?? null,\n limit: this._limit,\n },\n ).finish();\n }\n\n /**\n * Handles an incoming message from the topic subscription\n * @private\n * @param {Uint8Array} data - Raw message data\n * @param {Map<string, HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse[]>} list\n */\n _handleMessage(data, list) {\n const message =\n HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse.decode(\n data,\n );\n\n if (this._limit?.gt(0)) {\n this._limit = this._limit.sub(1);\n }\n\n this._startTime = Timestamp._fromProtobuf(\n /** @type {HieroProto.proto.ITimestamp} */ (\n message.consensusTimestamp\n ),\n ).plusNanos(1);\n\n if (\n message.chunkInfo == null ||\n (message.chunkInfo != null && message.chunkInfo.total === 1)\n ) {\n this._passTopicMessage(TopicMessage._ofSingle(message));\n } else {\n this._handleChunkedMessage(message, list);\n }\n }\n\n /**\n * Handles a chunked message from the topic subscription\n * @private\n * @param {HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse} message - The message response\n * @param {Map<string, HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse[]>} list\n */\n _handleChunkedMessage(message, list) {\n const chunkInfo =\n /** @type {HieroProto.proto.IConsensusMessageChunkInfo} */ (\n message.chunkInfo\n );\n const initialTransactionID =\n /** @type {HieroProto.proto.ITransactionID} */ (\n chunkInfo.initialTransactionID\n );\n const total = /** @type {number} */ (chunkInfo.total);\n const transactionId =\n TransactionId._fromProtobuf(initialTransactionID).toString();\n\n /** @type {HieroProto.com.hedera.mirror.api.proto.ConsensusTopicResponse[]} */\n let responses = [];\n\n const temp = list.get(transactionId);\n if (temp == null) {\n list.set(transactionId, responses);\n } else {\n responses = temp;\n }\n\n responses.push(message);\n\n if (responses.length === total) {\n const topicMessage = TopicMessage._ofMany(responses);\n list.delete(transactionId);\n this._passTopicMessage(topicMessage);\n }\n }\n\n /**\n * Handles errors from the topic subscription\n * @private\n * @param {MirrorError | Error} error - The error that occurred\n * @param {Client<Channel>} client - The client to use for retries\n * @returns {void}\n */\n _handleError(error, client) {\n const message = error instanceof Error ? error.message : error.details;\n\n if (this._handle?._unsubscribed) {\n return;\n }\n\n if (this.shouldRetry(error)) {\n this._scheduleRetry(client, message);\n } else {\n this._errorHandler(null, new Error(message));\n }\n }\n\n /**\n * Determines if a retry should be attempted\n * @private\n * @param {MirrorError | Error} error - The error to check\n * @returns {boolean} - Whether to retry\n */\n shouldRetry(error) {\n return this._attempt < this._maxAttempts && this._retryHandler(error);\n }\n\n /**\n * Schedules a retry of the server stream request\n * @private\n * @param {Client<Channel>} client - The client to use for the retry\n * @param {string} errorMessage - The error message for logging\n * @returns {void}\n */\n _scheduleRetry(client, errorMessage) {\n const delay = Math.min(250 * 2 ** this._attempt, this._maxBackoff);\n\n console.warn(\n `Error subscribing to topic ${\n this._topicId?.toString() ?? \"UNKNOWN\"\n } ` +\n `during attempt ${this._attempt}. Waiting ${delay} ms before next attempt: ${errorMessage}`,\n );\n\n this._attempt += 1;\n setTimeout(() => this._makeServerStreamRequest(client), delay);\n }\n}\n"],"names":["TopicMessageQuery","constructor","props","this","_topicId","topicId","setTopicId","_startTime","startTime","setStartTime","_endTime","endTime","setEndTime","_limit","limit","setLimit","_errorHandler","message","error","console","toString","errorHandler","_listener","_completionHandler","log","completionHandler","_maxAttempts","_maxBackoff","_retryHandler","Error","code","RST_STREAM","test","details","retryHandler","_attempt","_handle","setMaxBackoff","requireNotSubscribed","TopicId","fromString","clone","Timestamp","Date","fromDate","Long","fromValue","setErrorHandler","setCompletionHandler","setMaxAttempts","attempts","backoff","subscribe","client","listener","SubscriptionHandle","_makeServerStreamRequest","request","_buildConsensusRequest","list","Map","streamHandler","_mirrorNetwork","getNextMirrorNode","getChannel","makeServerStreamRequest","data","_handleMessage","_handleError","_setCall","_passTopicMessage","topicMessage","HieroProto","com","hedera","mirror","api","proto","ConsensusTopicQuery","encode","topicID","_toProtobuf","consensusStartTime","consensusEndTime","finish","ConsensusTopicResponse","decode","gt","sub","_fromProtobuf","plusNanos","chunkInfo","total","TopicMessage","_ofSingle","_handleChunkedMessage","initialTransactionID","transactionId","TransactionId","responses","temp","get","set","push","length","_ofMany","delete","_unsubscribed","shouldRetry","_scheduleRetry","errorMessage","delay","Math","min","warn","setTimeout"],"mappings":"0RA2Be,MAAMA,EAWjB,WAAAC,CAAYC,EAAQ,IAKhBC,KAAKC,SAAW,KACK,MAAjBF,EAAMG,SACNF,KAAKG,WAAWJ,EAAMG,SAO1BF,KAAKI,WAAa,KACK,MAAnBL,EAAMM,WACNL,KAAKM,aAAaP,EAAMM,WAO5BL,KAAKO,SAAW,KACK,MAAjBR,EAAMS,SACNR,KAAKS,WAAWV,EAAMS,SAO1BR,KAAKU,OAAS,KACK,MAAfX,EAAMY,OACNX,KAAKY,SAASb,EAAMY,OAQxBX,KAAKa,cAAgB,CAACC,EAASC,KAC3BC,QAAQD,MACJ,2CACqB,MAAjBf,KAAKC,SAAmBD,KAAKC,SAASgB,WAAa,OAKrC,MAAtBlB,EAAMmB,eACNlB,KAAKa,cAAgBd,EAAMmB,cAO/BlB,KAAKmB,UAAY,KAMjBnB,KAAKoB,mBAAqB,KACtBJ,QAAQK,IACJ,yBACqB,MAAjBrB,KAAKC,SAAmBD,KAAKC,SAASgB,WAAa,gBAKhC,MAA3BlB,EAAMuB,oBACNtB,KAAKoB,mBAAqBrB,EAAMuB,mBAQpCt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B,aAEtDR,QAAQ+F,KACJ,8BACI/G,KAAKC,UAAUgB,YAAc,4BAEXjB,KAAKgC,qBAAqB4E,6BAAiCD,KAGrF3G,KAAKgC,UAAY,EACjBgF,WAAW,IAAMhH,KAAKqD,yBAAyBH,GAAS0D,EAChE"}
@@ -16,15 +16,15 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
16
16
 
17
17
  /**
18
18
  * @namespace proto
19
- * @typedef {import("@hashgraph/proto").proto.IConsensusSubmitMessageTransactionBody} HieroProto.proto.IConsensusSubmitMessageTransactionBody
20
- * @typedef {import("@hashgraph/proto").proto.ITransaction} HieroProto.proto.ITransaction
21
- * @typedef {import("@hashgraph/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
22
- * @typedef {import("@hashgraph/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
23
- * @typedef {import("@hashgraph/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
24
- * @typedef {import("@hashgraph/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
25
- * @typedef {import("@hashgraph/proto").proto.IConsensusMessageChunkInfo} HieroProto.proto.IConsensusMessageChunkInfo
26
- * @typedef {import("@hashgraph/proto").proto.IFixedFee} HieroProto.proto.IFixedFee
27
- * @typedef {import("@hashgraph/proto").proto.ICustomFeeLimit} HieroProto.proto.ICustomFeeLimit
19
+ * @typedef {import("@hiero-ledger/proto").proto.IConsensusSubmitMessageTransactionBody} HieroProto.proto.IConsensusSubmitMessageTransactionBody
20
+ * @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
21
+ * @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
22
+ * @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
23
+ * @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
24
+ * @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
25
+ * @typedef {import("@hiero-ledger/proto").proto.IConsensusMessageChunkInfo} HieroProto.proto.IConsensusMessageChunkInfo
26
+ * @typedef {import("@hiero-ledger/proto").proto.IFixedFee} HieroProto.proto.IFixedFee
27
+ * @typedef {import("@hiero-ledger/proto").proto.ICustomFeeLimit} HieroProto.proto.ICustomFeeLimit
28
28
  */
29
29
 
30
30
  /**
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * @namespace proto
3
- * @typedef {import("@hashgraph/proto").proto.IConsensusSubmitMessageTransactionBody} HieroProto.proto.IConsensusSubmitMessageTransactionBody
4
- * @typedef {import("@hashgraph/proto").proto.ITransaction} HieroProto.proto.ITransaction
5
- * @typedef {import("@hashgraph/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
6
- * @typedef {import("@hashgraph/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
7
- * @typedef {import("@hashgraph/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
8
- * @typedef {import("@hashgraph/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
9
- * @typedef {import("@hashgraph/proto").proto.IConsensusMessageChunkInfo} HieroProto.proto.IConsensusMessageChunkInfo
10
- * @typedef {import("@hashgraph/proto").proto.IFixedFee} HieroProto.proto.IFixedFee
11
- * @typedef {import("@hashgraph/proto").proto.ICustomFeeLimit} HieroProto.proto.ICustomFeeLimit
3
+ * @typedef {import("@hiero-ledger/proto").proto.IConsensusSubmitMessageTransactionBody} HieroProto.proto.IConsensusSubmitMessageTransactionBody
4
+ * @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
5
+ * @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
6
+ * @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
7
+ * @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
8
+ * @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
9
+ * @typedef {import("@hiero-ledger/proto").proto.IConsensusMessageChunkInfo} HieroProto.proto.IConsensusMessageChunkInfo
10
+ * @typedef {import("@hiero-ledger/proto").proto.IFixedFee} HieroProto.proto.IFixedFee
11
+ * @typedef {import("@hiero-ledger/proto").proto.ICustomFeeLimit} HieroProto.proto.ICustomFeeLimit
12
12
  */
13
13
  /**
14
14
  * @typedef {import("../channel/Channel.js").default} Channel
@@ -179,15 +179,15 @@ export default class TopicMessageSubmitTransaction extends Transaction {
179
179
  }
180
180
  export namespace HieroProto {
181
181
  namespace proto {
182
- type IConsensusSubmitMessageTransactionBody = import("@hashgraph/proto").proto.IConsensusSubmitMessageTransactionBody;
183
- type ITransaction = import("@hashgraph/proto").proto.ITransaction;
184
- type ISignedTransaction = import("@hashgraph/proto").proto.ISignedTransaction;
185
- type TransactionBody = import("@hashgraph/proto").proto.TransactionBody;
186
- type ITransactionBody = import("@hashgraph/proto").proto.ITransactionBody;
187
- type ITransactionResponse = import("@hashgraph/proto").proto.ITransactionResponse;
188
- type IConsensusMessageChunkInfo = import("@hashgraph/proto").proto.IConsensusMessageChunkInfo;
189
- type IFixedFee = import("@hashgraph/proto").proto.IFixedFee;
190
- type ICustomFeeLimit = import("@hashgraph/proto").proto.ICustomFeeLimit;
182
+ type IConsensusSubmitMessageTransactionBody = import("@hiero-ledger/proto").proto.IConsensusSubmitMessageTransactionBody;
183
+ type ITransaction = import("@hiero-ledger/proto").proto.ITransaction;
184
+ type ISignedTransaction = import("@hiero-ledger/proto").proto.ISignedTransaction;
185
+ type TransactionBody = import("@hiero-ledger/proto").proto.TransactionBody;
186
+ type ITransactionBody = import("@hiero-ledger/proto").proto.ITransactionBody;
187
+ type ITransactionResponse = import("@hiero-ledger/proto").proto.ITransactionResponse;
188
+ type IConsensusMessageChunkInfo = import("@hiero-ledger/proto").proto.IConsensusMessageChunkInfo;
189
+ type IFixedFee = import("@hiero-ledger/proto").proto.IFixedFee;
190
+ type ICustomFeeLimit = import("@hiero-ledger/proto").proto.ICustomFeeLimit;
191
191
  }
192
192
  }
193
193
  export type Channel = import("../channel/Channel.js").default;
@@ -1 +1 @@
1
- {"version":3,"file":"TopicMessageSubmitTransaction.js","sources":["../../src/topic/TopicMessageSubmitTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Transaction, {\n TRANSACTION_REGISTRY,\n CHUNK_SIZE,\n} from \"../transaction/Transaction.js\";\nimport TopicId from \"./TopicId.js\";\nimport * as utf8 from \"../encoding/utf8.js\";\nimport TransactionId from \"../transaction/TransactionId.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport * as util from \"../util.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hashgraph/proto\").proto.IConsensusSubmitMessageTransactionBody} HieroProto.proto.IConsensusSubmitMessageTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hashgraph/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hashgraph/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hashgraph/proto\").proto.IConsensusMessageChunkInfo} HieroProto.proto.IConsensusMessageChunkInfo\n * @typedef {import(\"@hashgraph/proto\").proto.IFixedFee} HieroProto.proto.IFixedFee\n * @typedef {import(\"@hashgraph/proto\").proto.ICustomFeeLimit} HieroProto.proto.ICustomFeeLimit\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../token/CustomFixedFee.js\").default} CustomFixedFee\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n * @typedef {import(\"../transaction/TransactionResponse.js\").default} TransactionResponse\n * @typedef {import(\"../schedule/ScheduleCreateTransaction.js\").default} ScheduleCreateTransaction\n * @typedef {import(\"../transaction/CustomFeeLimit.js\").default} CustomFeeLimit\n */\n\n/**\n * <p>\n * Valid and authorized messages on valid topics will be ordered by the\n * consensus service, published in the block stream, and available to all\n * subscribers on this topic via the mirror nodes.<br/>\n * If this transaction succeeds the resulting TransactionReceipt SHALL\n * contain the latest topicSequenceNumber and topicRunningHash for the\n * topic.<br/>\n * If the topic has a `submitKey` then that key MUST sign this\n * transaction.<br/>\n */\nexport default class TopicMessageSubmitTransaction extends Transaction {\n /**\n * @param {object} props\n * @param {TopicId | string} [props.topicId]\n * @param {Uint8Array | string} [props.message]\n * @param {number} [props.maxChunks]\n * @param {number} [props.chunkSize]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TopicId}\n */\n this._topicId = null;\n\n if (props.topicId != null) {\n this.setTopicId(props.topicId);\n }\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._message = null;\n\n if (props.message != null) {\n this.setMessage(props.message);\n }\n\n /**\n * @private\n * @type {number}\n * The maximum number of chunks a topic message can be split into.\n * Default max chunk size: 20\n * This value can be overridden with `setMaxChunks`\n */\n this._maxChunks = 20;\n\n /**\n * @private\n * @type {number}\n * The size of each chunk for a given topic message in bytes.\n */\n this._chunkSize = CHUNK_SIZE;\n\n if (props.maxChunks != null) {\n this.setMaxChunks(props.maxChunks);\n }\n\n if (props.chunkSize != null) {\n this.setChunkSize(props.chunkSize);\n }\n\n /** @type {HieroProto.proto.IConsensusMessageChunkInfo | null} */\n this._chunkInfo = null;\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {TopicMessageSubmitTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const message =\n /** @type {HieroProto.proto.IConsensusSubmitMessageTransactionBody} */ (\n body.consensusSubmitMessage\n );\n\n return Transaction._fromProtobufTransactions(\n new TopicMessageSubmitTransaction({\n topicId:\n message.topicID != null\n ? TopicId._fromProtobuf(message.topicID)\n : undefined,\n message: message.message != null ? message.message : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?TopicId}\n */\n get topicId() {\n return this._topicId;\n }\n\n /**\n * @param {TopicId | string} topicId\n * @returns {this}\n */\n setTopicId(topicId) {\n this._requireNotFrozen();\n\n this._topicId =\n typeof topicId === \"string\"\n ? TopicId.fromString(topicId)\n : topicId.clone();\n\n return this;\n }\n\n /**\n * @deprecated - Use `getMessage()` instead\n * @returns {?Uint8Array}\n */\n get message() {\n return this._message;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n getMessage() {\n return this._message;\n }\n\n /**\n * @param {string | Uint8Array} message\n * @returns {this}\n */\n setMessage(message) {\n this._requireNotFrozen();\n message = util.requireStringOrUint8Array(message);\n this._message =\n message instanceof Uint8Array ? message : utf8.encode(message);\n return this;\n }\n\n /**\n * Gets the maximum custom fee that the user is willing to pay for the message.\n * @returns {CustomFeeLimit[]}\n */\n getCustomFeeLimits() {\n return this._customFeeLimits;\n }\n\n /**\n * Sets the maximum custom fee that the user is willing to pay for message submission.\n * @param {CustomFeeLimit[]} customFeeLimits\n * @returns {this}\n */\n setCustomFeeLimits(customFeeLimits) {\n this._requireNotFrozen();\n\n this._customFeeLimits = customFeeLimits;\n\n return this;\n }\n\n /**\n * Adds a maximum custom fee that the user is willing to pay for message submission.\n * @param {CustomFeeLimit} customFeeLimit\n * @returns {this}\n */\n addCustomFeeLimit(customFeeLimit) {\n this._requireNotFrozen();\n\n this._customFeeLimits.push(customFeeLimit);\n\n return this;\n }\n\n /**\n * @deprecated - Use `getMaxChunks()` instead\n * @returns {?number}\n */\n get maxChunks() {\n return this._maxChunks;\n }\n\n /**\n * @returns {?number}\n */\n getMaxChunks() {\n return this._maxChunks;\n }\n\n /**\n * @param {number} maxChunks\n * @returns {this}\n */\n setMaxChunks(maxChunks) {\n this._requireNotFrozen();\n this._maxChunks = maxChunks;\n return this;\n }\n\n /**\n * @deprecated - Use `getChunkSize()` instead\n * @returns {?number}\n */\n get chunkSize() {\n return this._chunkSize;\n }\n\n /**\n * @returns {?number}\n */\n getChunkSize() {\n return this._chunkSize;\n }\n\n /**\n * @param {number} chunkSize\n * @returns {this}\n */\n setChunkSize(chunkSize) {\n this._chunkSize = chunkSize;\n return this;\n }\n\n /**\n * @override\n * @returns {number}\n */\n getRequiredChunks() {\n if (this._message == null) {\n return 1;\n }\n\n const result = Math.ceil(this._message.length / this._chunkSize);\n return result;\n }\n\n /**\n * Freeze this transaction from further modification to prepare for\n * signing or serialization.\n *\n * Will use the `Client`, if available, to generate a default Transaction ID and select 1/3\n * nodes to prepare this transaction for.\n *\n * @param {?import(\"../client/Client.js\").default<Channel, *>} client\n * @returns {this}\n */\n freezeWith(client) {\n super.freezeWith(client);\n\n if (this._message == null) {\n return this;\n }\n\n const chunks = Math.floor(\n (this._message.length + (this._chunkSize - 1)) / this._chunkSize,\n );\n\n if (chunks > this._maxChunks) {\n throw new Error(\n `Message with size ${this._message.length} too long for ${this._maxChunks} chunks`,\n );\n }\n\n const initialTransactionId = this._getTransactionId()._toProtobuf();\n let nextTransactionId = this._getTransactionId();\n\n // Hack around the locked list. Should refactor a bit to remove such code\n this._transactionIds.locked = false;\n\n this._transactions.clear();\n this._transactionIds.clear();\n this._signedTransactions.clear();\n\n for (let chunk = 0; chunk < chunks; chunk++) {\n this._chunkInfo = {\n initialTransactionID: initialTransactionId,\n total: chunks,\n number: chunk + 1,\n };\n\n this._transactionIds.push(nextTransactionId);\n this._transactionIds.advance();\n\n for (const nodeAccountId of this._nodeAccountIds.list) {\n this._signedTransactions.push(\n this._makeSignedTransaction(nodeAccountId),\n );\n }\n\n nextTransactionId = new TransactionId(\n /** @type {AccountId} */ (nextTransactionId.accountId),\n new Timestamp(\n /** @type {Timestamp} */ (\n nextTransactionId.validStart\n ).seconds,\n /** @type {Timestamp} */ (\n nextTransactionId.validStart\n ).nanos.add(1),\n ),\n );\n }\n\n this._transactionIds.advance();\n this._chunkInfo = null;\n\n return this;\n }\n\n /**\n * @returns {ScheduleCreateTransaction}\n */\n schedule() {\n this._requireNotFrozen();\n\n if (this._message != null && this._message.length > this._chunkSize) {\n throw new Error(\n `cannot schedule \\`TopicMessageSubmitTransaction\\` with message over ${this._chunkSize} bytes`,\n );\n }\n\n return super.schedule();\n }\n\n /**\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @param {number=} requestTimeout\n * @returns {Promise<TransactionResponse>}\n */\n async execute(client, requestTimeout) {\n return (await this.executeAll(client, requestTimeout))[0];\n }\n\n /**\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @param {number=} requestTimeout\n * @returns {Promise<TransactionResponse[]>}\n */\n async executeAll(client, requestTimeout) {\n if (!super._isFrozen()) {\n this.freezeWith(client);\n }\n\n // on execute, sign each transaction with the operator, if present\n // and we are signing a transaction that used the default transaction ID\n\n const transactionId = this._getTransactionId();\n const operatorAccountId = client.operatorAccountId;\n\n if (\n operatorAccountId != null &&\n operatorAccountId.equals(\n /** @type {AccountId} */ (transactionId.accountId),\n )\n ) {\n await super.signWithOperator(client);\n }\n\n const responses = [];\n let remainingTimeout = requestTimeout;\n for (let i = 0; i < this._transactionIds.length; i++) {\n const startTimestamp = Date.now();\n responses.push(await super.execute(client, remainingTimeout));\n\n if (remainingTimeout != null) {\n remainingTimeout = Date.now() - startTimestamp;\n }\n }\n\n return responses;\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.consensus.submitMessage(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"consensusSubmitMessage\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IConsensusSubmitMessageTransactionBody}\n */\n _makeTransactionData() {\n if (this._chunkInfo != null && this._message != null) {\n const num = /** @type {number} */ (this._chunkInfo.number);\n const startIndex = (num - 1) * this._chunkSize;\n let endIndex = startIndex + this._chunkSize;\n\n if (endIndex > this._message.length) {\n endIndex = this._message.length;\n }\n\n return {\n topicID:\n this._topicId != null ? this._topicId._toProtobuf() : null,\n message: this._message.slice(startIndex, endIndex),\n chunkInfo: this._chunkInfo,\n };\n } else {\n return {\n topicID:\n this._topicId != null ? this._topicId._toProtobuf() : null,\n message: this._message,\n };\n }\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `TopicMessageSubmitTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"consensusSubmitMessage\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TopicMessageSubmitTransaction._fromProtobuf,\n);\n"],"names":["TopicMessageSubmitTransaction","Transaction","constructor","props","super","this","_topicId","topicId","setTopicId","_message","message","setMessage","_maxChunks","_chunkSize","CHUNK_SIZE","maxChunks","setMaxChunks","chunkSize","setChunkSize","_chunkInfo","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","_fromProtobufTransactions","topicID","TopicId","undefined","_requireNotFrozen","fromString","clone","getMessage","util.requireStringOrUint8Array","Uint8Array","utf8.encode","getCustomFeeLimits","_customFeeLimits","setCustomFeeLimits","customFeeLimits","addCustomFeeLimit","customFeeLimit","push","getMaxChunks","getChunkSize","getRequiredChunks","Math","ceil","length","freezeWith","client","chunks","floor","Error","initialTransactionId","_getTransactionId","_toProtobuf","nextTransactionId","_transactionIds","locked","_transactions","clear","_signedTransactions","chunk","initialTransactionID","total","number","advance","nodeAccountId","_nodeAccountIds","list","_makeSignedTransaction","TransactionId","Timestamp","seconds","nanos","add","schedule","execute","requestTimeout","executeAll","_isFrozen","transactionId","operatorAccountId","equals","signWithOperator","responses","remainingTimeout","i","startTimestamp","Date","now","_execute","channel","request","consensus","submitMessage","_getTransactionDataCase","_makeTransactionData","startIndex","endIndex","slice","chunkInfo","_getLogId","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"sSA6Ce,MAAMA,UAAsCC,EAQvD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,SAAW,KAEK,MAAjBH,EAAMI,SACNF,KAAKG,WAAWL,EAAMI,SAO1BF,KAAKI,SAAW,KAEK,MAAjBN,EAAMO,SACNL,KAAKM,WAAWR,EAAMO,SAU1BL,KAAKO,WAAa,GAOlBP,KAAKQ,WAAaC,EAEK,MAAnBX,EAAMY,WACNV,KAAKW,aAAab,EAAMY,WAGL,MAAnBZ,EAAMc,WACNZ,KAAKa,aAAaf,EAAMc,WAI5BZ,KAAKc,WAAa,IAC1B,CAWI,oBAAOC,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMf,EADOe,EAAO,GAIf,uBAEL,OAAOxB,EAAYyB,0BACf,IAAI1B,EAA8B,CAC9BO,QACuB,MAAnBG,EAAQiB,QACFC,EAAQR,cAAcV,EAAQiB,cAC9BE,EACVnB,QAA4B,MAAnBA,EAAQA,QAAkBA,EAAQA,aAAUmB,IAEzDR,EACAC,EACAC,EACAC,EACAC,EAEZ,CAKI,WAAIlB,GACA,OAAOF,KAAKC,QACpB,CAMI,UAAAE,CAAWD,GAQP,OAPAF,KAAKyB,oBAELzB,KAAKC,SACkB,iBAAZC,EACDqB,EAAQG,WAAWxB,GACnBA,EAAQyB,QAEX3B,IACf,CAMI,WAAIK,GACA,OAAOL,KAAKI,QACpB,CAKI,UAAAwB,GACI,OAAO5B,KAAKI,QACpB,CAMI,UAAAE,CAAWD,GAKP,OAJAL,KAAKyB,oBACLpB,EAAUwB,EAA+BxB,GACzCL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AG,GACI,MAAO,wBACf,CAOI,oBAAAC,GACI,GAAuB,MAAnB9F,KAAKc,YAAuC,MAAjBd,KAAKI,SAAkB,CAClD,MACM2F,GAD6B/F,KAAKc,WAAiB,OAC/B,GAAKd,KAAKQ,WACpC,IAAIwF,EAAWD,EAAa/F,KAAKQ,WAMjC,OAJIwF,EAAWhG,KAAKI,SAASwC,SACzBoD,EAAWhG,KAAKI,SAASwC,QAGtB,CACHtB,QACqB,MAAjBtB,KAAKC,SAAmBD,KAAKC,SAASmD,cAAgB,KAC1D/C,QAASL,KAAKI,SAAS6F,MAAMF,EAAYC,GACzCE,UAAWlG,KAAKc,WAEhC,CACY,MAAO,CACHQ,QACqB,MAAjBtB,KAAKC,SAAmBD,KAAKC,SAASmD,cAAgB,KAC1D/C,QAASL,KAAKI,SAG9B,CAKI,SAAA+F,GAII,MAAO,iCAFHnG,KAAKsD,gBAAgB8C,QACxB,WACiDC,YAC1D,EAGAC,EAAqBC,IACjB,yBAEA5G,EAA8BoB"}
1
+ {"version":3,"file":"TopicMessageSubmitTransaction.js","sources":["../../src/topic/TopicMessageSubmitTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Transaction, {\n TRANSACTION_REGISTRY,\n CHUNK_SIZE,\n} from \"../transaction/Transaction.js\";\nimport TopicId from \"./TopicId.js\";\nimport * as utf8 from \"../encoding/utf8.js\";\nimport TransactionId from \"../transaction/TransactionId.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport * as util from \"../util.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.IConsensusSubmitMessageTransactionBody} HieroProto.proto.IConsensusSubmitMessageTransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n * @typedef {import(\"@hiero-ledger/proto\").proto.IConsensusMessageChunkInfo} HieroProto.proto.IConsensusMessageChunkInfo\n * @typedef {import(\"@hiero-ledger/proto\").proto.IFixedFee} HieroProto.proto.IFixedFee\n * @typedef {import(\"@hiero-ledger/proto\").proto.ICustomFeeLimit} HieroProto.proto.ICustomFeeLimit\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../token/CustomFixedFee.js\").default} CustomFixedFee\n * @typedef {import(\"../account/AccountId.js\").default} AccountId\n * @typedef {import(\"../transaction/TransactionResponse.js\").default} TransactionResponse\n * @typedef {import(\"../schedule/ScheduleCreateTransaction.js\").default} ScheduleCreateTransaction\n * @typedef {import(\"../transaction/CustomFeeLimit.js\").default} CustomFeeLimit\n */\n\n/**\n * <p>\n * Valid and authorized messages on valid topics will be ordered by the\n * consensus service, published in the block stream, and available to all\n * subscribers on this topic via the mirror nodes.<br/>\n * If this transaction succeeds the resulting TransactionReceipt SHALL\n * contain the latest topicSequenceNumber and topicRunningHash for the\n * topic.<br/>\n * If the topic has a `submitKey` then that key MUST sign this\n * transaction.<br/>\n */\nexport default class TopicMessageSubmitTransaction extends Transaction {\n /**\n * @param {object} props\n * @param {TopicId | string} [props.topicId]\n * @param {Uint8Array | string} [props.message]\n * @param {number} [props.maxChunks]\n * @param {number} [props.chunkSize]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TopicId}\n */\n this._topicId = null;\n\n if (props.topicId != null) {\n this.setTopicId(props.topicId);\n }\n\n /**\n * @private\n * @type {?Uint8Array}\n */\n this._message = null;\n\n if (props.message != null) {\n this.setMessage(props.message);\n }\n\n /**\n * @private\n * @type {number}\n * The maximum number of chunks a topic message can be split into.\n * Default max chunk size: 20\n * This value can be overridden with `setMaxChunks`\n */\n this._maxChunks = 20;\n\n /**\n * @private\n * @type {number}\n * The size of each chunk for a given topic message in bytes.\n */\n this._chunkSize = CHUNK_SIZE;\n\n if (props.maxChunks != null) {\n this.setMaxChunks(props.maxChunks);\n }\n\n if (props.chunkSize != null) {\n this.setChunkSize(props.chunkSize);\n }\n\n /** @type {HieroProto.proto.IConsensusMessageChunkInfo | null} */\n this._chunkInfo = null;\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {TopicMessageSubmitTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const message =\n /** @type {HieroProto.proto.IConsensusSubmitMessageTransactionBody} */ (\n body.consensusSubmitMessage\n );\n\n return Transaction._fromProtobufTransactions(\n new TopicMessageSubmitTransaction({\n topicId:\n message.topicID != null\n ? TopicId._fromProtobuf(message.topicID)\n : undefined,\n message: message.message != null ? message.message : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?TopicId}\n */\n get topicId() {\n return this._topicId;\n }\n\n /**\n * @param {TopicId | string} topicId\n * @returns {this}\n */\n setTopicId(topicId) {\n this._requireNotFrozen();\n\n this._topicId =\n typeof topicId === \"string\"\n ? TopicId.fromString(topicId)\n : topicId.clone();\n\n return this;\n }\n\n /**\n * @deprecated - Use `getMessage()` instead\n * @returns {?Uint8Array}\n */\n get message() {\n return this._message;\n }\n\n /**\n * @returns {?Uint8Array}\n */\n getMessage() {\n return this._message;\n }\n\n /**\n * @param {string | Uint8Array} message\n * @returns {this}\n */\n setMessage(message) {\n this._requireNotFrozen();\n message = util.requireStringOrUint8Array(message);\n this._message =\n message instanceof Uint8Array ? message : utf8.encode(message);\n return this;\n }\n\n /**\n * Gets the maximum custom fee that the user is willing to pay for the message.\n * @returns {CustomFeeLimit[]}\n */\n getCustomFeeLimits() {\n return this._customFeeLimits;\n }\n\n /**\n * Sets the maximum custom fee that the user is willing to pay for message submission.\n * @param {CustomFeeLimit[]} customFeeLimits\n * @returns {this}\n */\n setCustomFeeLimits(customFeeLimits) {\n this._requireNotFrozen();\n\n this._customFeeLimits = customFeeLimits;\n\n return this;\n }\n\n /**\n * Adds a maximum custom fee that the user is willing to pay for message submission.\n * @param {CustomFeeLimit} customFeeLimit\n * @returns {this}\n */\n addCustomFeeLimit(customFeeLimit) {\n this._requireNotFrozen();\n\n this._customFeeLimits.push(customFeeLimit);\n\n return this;\n }\n\n /**\n * @deprecated - Use `getMaxChunks()` instead\n * @returns {?number}\n */\n get maxChunks() {\n return this._maxChunks;\n }\n\n /**\n * @returns {?number}\n */\n getMaxChunks() {\n return this._maxChunks;\n }\n\n /**\n * @param {number} maxChunks\n * @returns {this}\n */\n setMaxChunks(maxChunks) {\n this._requireNotFrozen();\n this._maxChunks = maxChunks;\n return this;\n }\n\n /**\n * @deprecated - Use `getChunkSize()` instead\n * @returns {?number}\n */\n get chunkSize() {\n return this._chunkSize;\n }\n\n /**\n * @returns {?number}\n */\n getChunkSize() {\n return this._chunkSize;\n }\n\n /**\n * @param {number} chunkSize\n * @returns {this}\n */\n setChunkSize(chunkSize) {\n this._chunkSize = chunkSize;\n return this;\n }\n\n /**\n * @override\n * @returns {number}\n */\n getRequiredChunks() {\n if (this._message == null) {\n return 1;\n }\n\n const result = Math.ceil(this._message.length / this._chunkSize);\n return result;\n }\n\n /**\n * Freeze this transaction from further modification to prepare for\n * signing or serialization.\n *\n * Will use the `Client`, if available, to generate a default Transaction ID and select 1/3\n * nodes to prepare this transaction for.\n *\n * @param {?import(\"../client/Client.js\").default<Channel, *>} client\n * @returns {this}\n */\n freezeWith(client) {\n super.freezeWith(client);\n\n if (this._message == null) {\n return this;\n }\n\n const chunks = Math.floor(\n (this._message.length + (this._chunkSize - 1)) / this._chunkSize,\n );\n\n if (chunks > this._maxChunks) {\n throw new Error(\n `Message with size ${this._message.length} too long for ${this._maxChunks} chunks`,\n );\n }\n\n const initialTransactionId = this._getTransactionId()._toProtobuf();\n let nextTransactionId = this._getTransactionId();\n\n // Hack around the locked list. Should refactor a bit to remove such code\n this._transactionIds.locked = false;\n\n this._transactions.clear();\n this._transactionIds.clear();\n this._signedTransactions.clear();\n\n for (let chunk = 0; chunk < chunks; chunk++) {\n this._chunkInfo = {\n initialTransactionID: initialTransactionId,\n total: chunks,\n number: chunk + 1,\n };\n\n this._transactionIds.push(nextTransactionId);\n this._transactionIds.advance();\n\n for (const nodeAccountId of this._nodeAccountIds.list) {\n this._signedTransactions.push(\n this._makeSignedTransaction(nodeAccountId),\n );\n }\n\n nextTransactionId = new TransactionId(\n /** @type {AccountId} */ (nextTransactionId.accountId),\n new Timestamp(\n /** @type {Timestamp} */ (\n nextTransactionId.validStart\n ).seconds,\n /** @type {Timestamp} */ (\n nextTransactionId.validStart\n ).nanos.add(1),\n ),\n );\n }\n\n this._transactionIds.advance();\n this._chunkInfo = null;\n\n return this;\n }\n\n /**\n * @returns {ScheduleCreateTransaction}\n */\n schedule() {\n this._requireNotFrozen();\n\n if (this._message != null && this._message.length > this._chunkSize) {\n throw new Error(\n `cannot schedule \\`TopicMessageSubmitTransaction\\` with message over ${this._chunkSize} bytes`,\n );\n }\n\n return super.schedule();\n }\n\n /**\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @param {number=} requestTimeout\n * @returns {Promise<TransactionResponse>}\n */\n async execute(client, requestTimeout) {\n return (await this.executeAll(client, requestTimeout))[0];\n }\n\n /**\n * @param {import(\"../client/Client.js\").default<Channel, *>} client\n * @param {number=} requestTimeout\n * @returns {Promise<TransactionResponse[]>}\n */\n async executeAll(client, requestTimeout) {\n if (!super._isFrozen()) {\n this.freezeWith(client);\n }\n\n // on execute, sign each transaction with the operator, if present\n // and we are signing a transaction that used the default transaction ID\n\n const transactionId = this._getTransactionId();\n const operatorAccountId = client.operatorAccountId;\n\n if (\n operatorAccountId != null &&\n operatorAccountId.equals(\n /** @type {AccountId} */ (transactionId.accountId),\n )\n ) {\n await super.signWithOperator(client);\n }\n\n const responses = [];\n let remainingTimeout = requestTimeout;\n for (let i = 0; i < this._transactionIds.length; i++) {\n const startTimestamp = Date.now();\n responses.push(await super.execute(client, remainingTimeout));\n\n if (remainingTimeout != null) {\n remainingTimeout = Date.now() - startTimestamp;\n }\n }\n\n return responses;\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.consensus.submitMessage(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"consensusSubmitMessage\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IConsensusSubmitMessageTransactionBody}\n */\n _makeTransactionData() {\n if (this._chunkInfo != null && this._message != null) {\n const num = /** @type {number} */ (this._chunkInfo.number);\n const startIndex = (num - 1) * this._chunkSize;\n let endIndex = startIndex + this._chunkSize;\n\n if (endIndex > this._message.length) {\n endIndex = this._message.length;\n }\n\n return {\n topicID:\n this._topicId != null ? this._topicId._toProtobuf() : null,\n message: this._message.slice(startIndex, endIndex),\n chunkInfo: this._chunkInfo,\n };\n } else {\n return {\n topicID:\n this._topicId != null ? this._topicId._toProtobuf() : null,\n message: this._message,\n };\n }\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `TopicMessageSubmitTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"consensusSubmitMessage\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TopicMessageSubmitTransaction._fromProtobuf,\n);\n"],"names":["TopicMessageSubmitTransaction","Transaction","constructor","props","super","this","_topicId","topicId","setTopicId","_message","message","setMessage","_maxChunks","_chunkSize","CHUNK_SIZE","maxChunks","setMaxChunks","chunkSize","setChunkSize","_chunkInfo","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","_fromProtobufTransactions","topicID","TopicId","undefined","_requireNotFrozen","fromString","clone","getMessage","util.requireStringOrUint8Array","Uint8Array","utf8.encode","getCustomFeeLimits","_customFeeLimits","setCustomFeeLimits","customFeeLimits","addCustomFeeLimit","customFeeLimit","push","getMaxChunks","getChunkSize","getRequiredChunks","Math","ceil","length","freezeWith","client","chunks","floor","Error","initialTransactionId","_getTransactionId","_toProtobuf","nextTransactionId","_transactionIds","locked","_transactions","clear","_signedTransactions","chunk","initialTransactionID","total","number","advance","nodeAccountId","_nodeAccountIds","list","_makeSignedTransaction","TransactionId","Timestamp","seconds","nanos","add","schedule","execute","requestTimeout","executeAll","_isFrozen","transactionId","operatorAccountId","equals","signWithOperator","responses","remainingTimeout","i","startTimestamp","Date","now","_execute","channel","request","consensus","submitMessage","_getTransactionDataCase","_makeTransactionData","startIndex","endIndex","slice","chunkInfo","_getLogId","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"sSA6Ce,MAAMA,UAAsCC,EAQvD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,SAAW,KAEK,MAAjBH,EAAMI,SACNF,KAAKG,WAAWL,EAAMI,SAO1BF,KAAKI,SAAW,KAEK,MAAjBN,EAAMO,SACNL,KAAKM,WAAWR,EAAMO,SAU1BL,KAAKO,WAAa,GAOlBP,KAAKQ,WAAaC,EAEK,MAAnBX,EAAMY,WACNV,KAAKW,aAAab,EAAMY,WAGL,MAAnBZ,EAAMc,WACNZ,KAAKa,aAAaf,EAAMc,WAI5BZ,KAAKc,WAAa,IAC1B,CAWI,oBAAOC,CACHC,EACAC,EACAC,EACAC,EACAC,GAEA,MACMf,EADOe,EAAO,GAIf,uBA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@namespace proto
20
- * @typedef {import("@hashgraph/proto").proto.IConsensusUpdateTopicTransactionBody} HieroProto.proto.IConsensusUpdateTopicTransactionBody
21
- * @typedef {import("@hashgraph/proto").proto.ITransaction} HieroProto.proto.ITransaction
22
- * @typedef {import("@hashgraph/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
23
- * @typedef {import("@hashgraph/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
24
- * @typedef {import("@hashgraph/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
25
- * @typedef {import("@hashgraph/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
20
+ * @typedef {import("@hiero-ledger/proto").proto.IConsensusUpdateTopicTransactionBody} HieroProto.proto.IConsensusUpdateTopicTransactionBody
21
+ * @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
22
+ * @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
23
+ * @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
24
+ * @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
25
+ * @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
26
26
  */
27
27
 
28
28
  /**
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * @namespace proto
3
- * @typedef {import("@hashgraph/proto").proto.IConsensusUpdateTopicTransactionBody} HieroProto.proto.IConsensusUpdateTopicTransactionBody
4
- * @typedef {import("@hashgraph/proto").proto.ITransaction} HieroProto.proto.ITransaction
5
- * @typedef {import("@hashgraph/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
6
- * @typedef {import("@hashgraph/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
7
- * @typedef {import("@hashgraph/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
8
- * @typedef {import("@hashgraph/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
3
+ * @typedef {import("@hiero-ledger/proto").proto.IConsensusUpdateTopicTransactionBody} HieroProto.proto.IConsensusUpdateTopicTransactionBody
4
+ * @typedef {import("@hiero-ledger/proto").proto.ITransaction} HieroProto.proto.ITransaction
5
+ * @typedef {import("@hiero-ledger/proto").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction
6
+ * @typedef {import("@hiero-ledger/proto").proto.TransactionBody} HieroProto.proto.TransactionBody
7
+ * @typedef {import("@hiero-ledger/proto").proto.ITransactionBody} HieroProto.proto.ITransactionBody
8
+ * @typedef {import("@hiero-ledger/proto").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse
9
9
  */
10
10
  /**
11
11
  * @typedef {import("../channel/Channel.js").default} Channel
@@ -264,12 +264,12 @@ export default class TopicUpdateTransaction extends Transaction {
264
264
  }
265
265
  export namespace HieroProto {
266
266
  namespace proto {
267
- type IConsensusUpdateTopicTransactionBody = import("@hashgraph/proto").proto.IConsensusUpdateTopicTransactionBody;
268
- type ITransaction = import("@hashgraph/proto").proto.ITransaction;
269
- type ISignedTransaction = import("@hashgraph/proto").proto.ISignedTransaction;
270
- type TransactionBody = import("@hashgraph/proto").proto.TransactionBody;
271
- type ITransactionBody = import("@hashgraph/proto").proto.ITransactionBody;
272
- type ITransactionResponse = import("@hashgraph/proto").proto.ITransactionResponse;
267
+ type IConsensusUpdateTopicTransactionBody = import("@hiero-ledger/proto").proto.IConsensusUpdateTopicTransactionBody;
268
+ type ITransaction = import("@hiero-ledger/proto").proto.ITransaction;
269
+ type ISignedTransaction = import("@hiero-ledger/proto").proto.ISignedTransaction;
270
+ type TransactionBody = import("@hiero-ledger/proto").proto.TransactionBody;
271
+ type ITransactionBody = import("@hiero-ledger/proto").proto.ITransactionBody;
272
+ type ITransactionResponse = import("@hiero-ledger/proto").proto.ITransactionResponse;
273
273
  }
274
274
  }
275
275
  export type Channel = import("../channel/Channel.js").default;
@@ -1 +1 @@
1
- {"version":3,"file":"TopicUpdateTransaction.js","sources":["../../src/topic/TopicUpdateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport TopicId from \"./TopicId.js\";\nimport Duration from \"../Duration.js\";\nimport Key from \"../Key.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport CustomFixedFee from \"../token/CustomFixedFee.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hashgraph/proto\").proto.IConsensusUpdateTopicTransactionBody} HieroProto.proto.IConsensusUpdateTopicTransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hashgraph/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hashgraph/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hashgraph/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n */\n\n/**\n * Update a topic.\n *\n * If there is no adminKey, the only authorized update (available to anyone) is to extend the expirationTime.\n * Otherwise transaction must be signed by the adminKey.\n *\n * If an adminKey is updated, the transaction must be signed by the pre-update adminKey and post-update adminKey.\n *\n * If a new autoRenewAccount is specified (not just being removed), that account must also sign the transaction.\n */\nexport default class TopicUpdateTransaction extends Transaction {\n /**\n * @param {object} props\n * @param {TopicId | string} [props.topicId]\n * @param {Key} [props.adminKey]\n * @param {Key} [props.submitKey]\n * @param {Key} [props.feeScheduleKey]\n * @param {Key[]} [props.feeExemptKeys]\n * @param {Duration | Long | number} [props.autoRenewPeriod]\n * @param {AccountId | string} [props.autoRenewAccountId]\n * @param {CustomFixedFee[]} [props.customFees]\n * @param {?string} [props.topicMemo]\n * @param {Timestamp | Date} [props.expirationTime]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TopicId}\n */\n this._topicId = null;\n\n if (props.topicId != null) {\n this.setTopicId(props.topicId);\n }\n\n /**\n * @private\n * @type {?string}\n */\n this._topicMemo = null;\n\n if (props.topicMemo != null) {\n this.setTopicMemo(props.topicMemo);\n }\n\n /**\n * @private\n * @type {?Key}\n */\n this._submitKey = null;\n\n if (props.submitKey != null) {\n this.setSubmitKey(props.submitKey);\n }\n\n /**\n * @private\n * @type {?Key}\n */\n this._adminKey = null;\n\n if (props.adminKey != null) {\n this.setAdminKey(props.adminKey);\n }\n /**\n * @private\n * @type {?Key}\n */\n this._feeScheduleKey = null;\n\n if (props.feeScheduleKey != null) {\n this.setFeeScheduleKey(props.feeScheduleKey);\n }\n\n /**\n * @private\n * @type {?Key[]}\n */\n this._feeExemptKeys = null;\n\n if (props.feeExemptKeys != null) {\n this.setFeeExemptKeys(props.feeExemptKeys);\n }\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._autoRenewAccountId = null;\n\n if (props.autoRenewAccountId != null) {\n this.setAutoRenewAccountId(props.autoRenewAccountId);\n }\n\n /**\n * @private\n * @type {?Duration}\n */\n this._autoRenewPeriod = null;\n\n if (props.autoRenewPeriod != null) {\n this.setAutoRenewPeriod(props.autoRenewPeriod);\n }\n\n /**\n * @private\n * @type {?CustomFixedFee[]}\n */\n this._customFees = null;\n\n if (props.customFees != null) {\n this.setCustomFees(props.customFees);\n }\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._expirationTime = null;\n\n if (props.expirationTime != null) {\n this.setExpirationTime(props.expirationTime);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {TopicUpdateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const update =\n /** @type {HieroProto.proto.IConsensusUpdateTopicTransactionBody} */ (\n body.consensusUpdateTopic\n );\n\n return Transaction._fromProtobufTransactions(\n new TopicUpdateTransaction({\n topicId:\n update.topicID != null\n ? TopicId._fromProtobuf(update.topicID)\n : undefined,\n adminKey:\n update.adminKey != null\n ? Key._fromProtobufKey(update.adminKey)\n : undefined,\n submitKey:\n update.submitKey != null\n ? Key._fromProtobufKey(update.submitKey)\n : undefined,\n feeScheduleKey:\n update.feeScheduleKey != null\n ? Key._fromProtobufKey(update.feeScheduleKey)\n : undefined,\n feeExemptKeys:\n update.feeExemptKeyList != null &&\n update.feeExemptKeyList.keys != null\n ? update?.feeExemptKeyList.keys.map((key) =>\n Key._fromProtobufKey(key),\n )\n : undefined,\n autoRenewAccountId:\n update.autoRenewAccount != null\n ? AccountId._fromProtobuf(update.autoRenewAccount)\n : undefined,\n autoRenewPeriod:\n update.autoRenewPeriod != null\n ? update.autoRenewPeriod.seconds != null\n ? update.autoRenewPeriod.seconds\n : undefined\n : undefined,\n customFees:\n update.customFees != null && update.customFees.fees != null\n ? update.customFees.fees.map((customFee) =>\n CustomFixedFee._fromProtobuf(customFee),\n )\n : undefined,\n topicMemo:\n update.memo != null\n ? Object.hasOwn(update.memo, \"value\")\n ? update.memo.value\n : undefined\n : undefined,\n expirationTime:\n update.expirationTime != null\n ? Timestamp._fromProtobuf(update.expirationTime)\n : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?Timestamp}\n */\n get expirationTime() {\n return this._expirationTime;\n }\n\n /**\n * @param {Timestamp | Date | null} expirationTime\n * @returns {TopicUpdateTransaction}\n */\n setExpirationTime(expirationTime) {\n this._requireNotFrozen();\n\n this._expirationTime =\n expirationTime instanceof Date\n ? Timestamp.fromDate(expirationTime)\n : expirationTime;\n\n return this;\n }\n\n /**\n * @returns {?TopicId}\n */\n get topicId() {\n return this._topicId;\n }\n\n /**\n * @param {TopicId | string} topicId\n * @returns {TopicUpdateTransaction}\n */\n setTopicId(topicId) {\n this._requireNotFrozen();\n this._topicId =\n typeof topicId === \"string\"\n ? TopicId.fromString(topicId)\n : topicId.clone();\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearTopicId() {\n this._requireNotFrozen();\n this._topicId = null;\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get topicMemo() {\n return this._topicMemo;\n }\n\n /**\n * @param {string} topicMemo\n * @returns {TopicUpdateTransaction}\n */\n setTopicMemo(topicMemo) {\n this._requireNotFrozen();\n this._topicMemo = topicMemo;\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearTopicMemo() {\n this._requireNotFrozen();\n this._topicMemo = null;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get adminKey() {\n return this._adminKey;\n }\n\n /**\n * @param {Key} adminKey\n * @returns {TopicUpdateTransaction}\n */\n setAdminKey(adminKey) {\n this._requireNotFrozen();\n this._adminKey = adminKey;\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearAdminKey() {\n this._requireNotFrozen();\n this._adminKey = null;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get submitKey() {\n return this._submitKey;\n }\n\n /**\n * @param {Key} submitKey\n * @returns {TopicUpdateTransaction}\n */\n setSubmitKey(submitKey) {\n this._requireNotFrozen();\n this._submitKey = submitKey;\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearSubmitKey() {\n this._requireNotFrozen();\n this._submitKey = null;\n\n return this;\n }\n\n /**\n * Returns the key which allows updates to the new topic’s fees.\n * @returns {?Key}\n */\n getFeeScheduleKey() {\n return this._feeScheduleKey;\n }\n\n /**\n * Sets the key which allows updates to the new topic’s fees.\n * @param {Key} feeScheduleKey\n * @returns {this}\n */\n setFeeScheduleKey(feeScheduleKey) {\n this._requireNotFrozen();\n this._feeScheduleKey = feeScheduleKey;\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearFeeScheduleKey() {\n this._requireNotFrozen();\n this._feeScheduleKey = null;\n\n return this;\n }\n\n /**\n * Returns the keys that will be exempt from paying fees.\n * @returns {?Key[]}\n */\n getFeeExemptKeys() {\n return this._feeExemptKeys;\n }\n\n /**\n * Sets the keys that will be exempt from paying fees.\n * @param {Key[]} feeExemptKeys\n * @returns {this}\n */\n setFeeExemptKeys(feeExemptKeys) {\n this._requireNotFrozen();\n this._feeExemptKeys = feeExemptKeys;\n\n return this;\n }\n\n /**\n * Adds a key that will be exempt from paying fees.\n * @param {Key} key\n * @returns {this}\n */\n addFeeExemptKey(key) {\n this._requireNotFrozen();\n if (this._feeExemptKeys == null) {\n this._feeExemptKeys = [];\n }\n\n this._feeExemptKeys.push(key);\n\n return this;\n }\n\n /**\n * Clears all keys that will be exempt from paying fees, effectively removing them from the network state.\n * @returns {this}\n */\n clearFeeExemptKeys() {\n this._requireNotFrozen();\n this._feeExemptKeys = [];\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get autoRenewAccountId() {\n return this._autoRenewAccountId;\n }\n\n /**\n * @param {AccountId | string} autoRenewAccountId\n * @returns {TopicUpdateTransaction}\n */\n setAutoRenewAccountId(autoRenewAccountId) {\n this._requireNotFrozen();\n this._autoRenewAccountId =\n autoRenewAccountId instanceof AccountId\n ? autoRenewAccountId\n : AccountId.fromString(autoRenewAccountId);\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearAutoRenewAccountId() {\n this._requireNotFrozen();\n this._autoRenewAccountId = null;\n\n return this;\n }\n\n /**\n * @returns {?Duration}\n */\n get autoRenewPeriod() {\n return this._autoRenewPeriod;\n }\n\n /**\n * Set the auto renew period for this account.\n *\n * @param {Duration | Long | number} autoRenewPeriod\n * @returns {TopicUpdateTransaction}\n */\n setAutoRenewPeriod(autoRenewPeriod) {\n this._requireNotFrozen();\n this._autoRenewPeriod =\n autoRenewPeriod instanceof Duration\n ? autoRenewPeriod\n : new Duration(autoRenewPeriod);\n\n return this;\n }\n\n /**\n * Returns the fixed fees to assess when a message is submitted to the new topic.\n * @returns {?CustomFixedFee[]}\n */\n getCustomFees() {\n return this._customFees;\n }\n\n /**\n * Sets the fixed fees to assess when a message is submitted to the new topic.\n *\n * @param {CustomFixedFee[]} customFees\n * @returns {this}\n */\n setCustomFees(customFees) {\n this._requireNotFrozen();\n this._customFees = customFees;\n\n return this;\n }\n\n /**\n * Adds fixed fee to assess when a message is submitted to the new topic.\n *\n * @param {CustomFixedFee} customFee\n * @returns {this}\n */\n addCustomFee(customFee) {\n this._requireNotFrozen();\n if (this._customFees == null) {\n this._customFees = [];\n }\n\n this._customFees.push(customFee);\n\n return this;\n }\n\n /**\n * Clears fixed fees, effectively removing them from the network state.\n *\n * @returns {this}\n */\n clearCustomFees() {\n this._requireNotFrozen();\n this._customFees = [];\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._topicId != null) {\n this._topicId.validateChecksum(client);\n }\n\n if (this._autoRenewAccountId != null) {\n this._autoRenewAccountId.validateChecksum(client);\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.consensus.updateTopic(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"consensusUpdateTopic\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IConsensusUpdateTopicTransactionBody}\n */\n _makeTransactionData() {\n return {\n topicID: this._topicId != null ? this._topicId._toProtobuf() : null,\n adminKey:\n this._adminKey != null ? this._adminKey._toProtobufKey() : null,\n submitKey:\n this._submitKey != null\n ? this._submitKey._toProtobufKey()\n : null,\n feeScheduleKey:\n this._feeScheduleKey != null\n ? this._feeScheduleKey._toProtobufKey()\n : null,\n feeExemptKeyList:\n this._feeExemptKeys != null\n ? {\n keys: this._feeExemptKeys.map((key) =>\n key._toProtobufKey(),\n ),\n }\n : null,\n memo:\n this._topicMemo != null\n ? {\n value: this._topicMemo,\n }\n : null,\n autoRenewAccount:\n this._autoRenewAccountId != null\n ? this._autoRenewAccountId._toProtobuf()\n : null,\n autoRenewPeriod:\n this._autoRenewPeriod != null\n ? this._autoRenewPeriod._toProtobuf()\n : null,\n customFees:\n this._customFees != null\n ? {\n fees: this._customFees.map((customFee) =>\n customFee._toTopicFeeProtobuf(),\n ),\n }\n : null,\n expirationTime:\n this._expirationTime != null\n ? this._expirationTime._toProtobuf()\n : null,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `TopicUpdateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"consensusUpdateTopic\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TopicUpdateTransaction._fromProtobuf,\n);\n"],"names":["TopicUpdateTransaction","Transaction","constructor","props","super","this","_topicId","topicId","setTopicId","_topicMemo","topicMemo","setTopicMemo","_submitKey","submitKey","setSubmitKey","_adminKey","adminKey","setAdminKey","_feeScheduleKey","feeScheduleKey","setFeeScheduleKey","_feeExemptKeys","feeExemptKeys","setFeeExemptKeys","_autoRenewAccountId","autoRenewAccountId","setAutoRenewAccountId","_autoRenewPeriod","autoRenewPeriod","setAutoRenewPeriod","_customFees","customFees","setCustomFees","_expirationTime","expirationTime","setExpirationTime","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","update","_fromProtobufTransactions","topicID","TopicId","undefined","Key","_fromProtobufKey","feeExemptKeyList","keys","map","key","autoRenewAccount","AccountId","seconds","fees","customFee","CustomFixedFee","memo","Object","hasOwn","value","Timestamp","_requireNotFrozen","Date","fromDate","fromString","clone","clearTopicId","clearTopicMemo","clearAdminKey","clearSubmitKey","getFeeScheduleKey","clearFeeScheduleKey","getFeeExemptKeys","addFeeExemptKey","push","clearFeeExemptKeys","clearAutoRenewAccountId","Duration","getCustomFees","addCustomFee","clearCustomFees","_validateChecksums","client","validateChecksum","_execute","channel","request","consensus","updateTopic","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_toProtobufKey","_toTopicFeeProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"2QAsCe,MAAMA,UAA+BC,EAchD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,SAAW,KAEK,MAAjBH,EAAMI,SACNF,KAAKG,WAAWL,EAAMI,SAO1BF,KAAKI,WAAa,KAEK,MAAnBN,EAAMO,WACNL,KAAKM,aAAaR,EAAMO,WAO5BL,KAAKO,WAAa,KAEK,MAAnBT,EAAMU,WACNR,KAAKS,aAAaX,EAAMU,WAO5BR,KAAKU,UAAY,KAEK,MAAlBZ,EAAMa,UACNX,KAAKY,YAAYd,EAAMa,UAM3BX,KAAKa,gBAAkB,KAEK,MAAxBf,EAAMgB,gBACNd,KAAKe,kBAAkBjB,EAAMgB,gBAOjCd,KAAKgB,eAAiB,KAEK,MAAvBlB,EAAMmB,eACNjB,KAAKkB,iBAAiBpB,EAAMmB,eAOhCjB,KAAKmB,oBAAsB,KAEK,MAA5BrB,EAAMsB,oBACNpB,KAAKqB,sBAAsBvB,EAAMsB,oBAOrCpB,KAAKsB,iBAAmB,KAEK,MAAzBxB,EAAMyB,iBACNvB,KAAKwB,mBAAmB1B,EAAMyB,iBAOlCvB,KAAKyB,YAAc,KAEK,MAApB3B,EAAM4B,YACN1B,KAAK2B,cAAc7B,EAAM4B,YAO7B1B,KAAK4B,gBAAkB,KAEK,MAAxB9B,EAAM+B,gBACN7B,KAAK8B,kBAAkBhC,EAAM+B,eAEzC,CAWI,oBAAO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R,KAAKO,WACCP,KAAKO,WAAWmF,iBAChB,KACV5E,eAC4B,MAAxBd,KAAKa,gBACCb,KAAKa,gBAAgB6E,iBACrB,KACV9C,iBAC2B,MAAvB5C,KAAKgB,eACC,CACI6B,KAAM7C,KAAKgB,eAAe8B,IAAKC,GAC3BA,EAAI2C,mBAGZ,KACVpC,KACuB,MAAnBtD,KAAKI,WACC,CACIqD,MAAOzD,KAAKI,YAEhB,KACV4C,iBACgC,MAA5BhD,KAAKmB,oBACCnB,KAAKmB,oBAAoBsE,cACzB,KACVlE,gBAC6B,MAAzBvB,KAAKsB,iBACCtB,KAAKsB,iBAAiBmE,cACtB,KACV/D,WACwB,MAApB1B,KAAKyB,YACC,CACI0B,KAAMnD,KAAKyB,YAAYqB,IAAKM,GACxBA,EAAUuC,wBAGlB,KACV9D,eAC4B,MAAxB7B,KAAK4B,gBACC5B,KAAK4B,gBAAgB6D,cACrB,KAEtB,CAKI,SAAAG,GAII,MAAO,0BAFH5F,KAAK6F,gBAAgBC,QACxB,WAC0CC,YACnD,EAGAC,EAAqBC,IACjB,uBAEAtG,EAAuBoC"}
1
+ {"version":3,"file":"TopicUpdateTransaction.js","sources":["../../src/topic/TopicUpdateTransaction.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport Transaction, {\n TRANSACTION_REGISTRY,\n} from \"../transaction/Transaction.js\";\nimport AccountId from \"../account/AccountId.js\";\nimport TopicId from \"./TopicId.js\";\nimport Duration from \"../Duration.js\";\nimport Key from \"../Key.js\";\nimport Timestamp from \"../Timestamp.js\";\nimport CustomFixedFee from \"../token/CustomFixedFee.js\";\n\n/**\n * @namespace proto\n * @typedef {import(\"@hiero-ledger/proto\").proto.IConsensusUpdateTopicTransactionBody} HieroProto.proto.IConsensusUpdateTopicTransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransaction} HieroProto.proto.ITransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.ISignedTransaction} HieroProto.proto.ISignedTransaction\n * @typedef {import(\"@hiero-ledger/proto\").proto.TransactionBody} HieroProto.proto.TransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionBody} HieroProto.proto.ITransactionBody\n * @typedef {import(\"@hiero-ledger/proto\").proto.ITransactionResponse} HieroProto.proto.ITransactionResponse\n */\n\n/**\n * @typedef {import(\"../channel/Channel.js\").default} Channel\n * @typedef {import(\"../client/Client.js\").default<*, *>} Client\n * @typedef {import(\"../transaction/TransactionId.js\").default} TransactionId\n */\n\n/**\n * Update a topic.\n *\n * If there is no adminKey, the only authorized update (available to anyone) is to extend the expirationTime.\n * Otherwise transaction must be signed by the adminKey.\n *\n * If an adminKey is updated, the transaction must be signed by the pre-update adminKey and post-update adminKey.\n *\n * If a new autoRenewAccount is specified (not just being removed), that account must also sign the transaction.\n */\nexport default class TopicUpdateTransaction extends Transaction {\n /**\n * @param {object} props\n * @param {TopicId | string} [props.topicId]\n * @param {Key} [props.adminKey]\n * @param {Key} [props.submitKey]\n * @param {Key} [props.feeScheduleKey]\n * @param {Key[]} [props.feeExemptKeys]\n * @param {Duration | Long | number} [props.autoRenewPeriod]\n * @param {AccountId | string} [props.autoRenewAccountId]\n * @param {CustomFixedFee[]} [props.customFees]\n * @param {?string} [props.topicMemo]\n * @param {Timestamp | Date} [props.expirationTime]\n */\n constructor(props = {}) {\n super();\n\n /**\n * @private\n * @type {?TopicId}\n */\n this._topicId = null;\n\n if (props.topicId != null) {\n this.setTopicId(props.topicId);\n }\n\n /**\n * @private\n * @type {?string}\n */\n this._topicMemo = null;\n\n if (props.topicMemo != null) {\n this.setTopicMemo(props.topicMemo);\n }\n\n /**\n * @private\n * @type {?Key}\n */\n this._submitKey = null;\n\n if (props.submitKey != null) {\n this.setSubmitKey(props.submitKey);\n }\n\n /**\n * @private\n * @type {?Key}\n */\n this._adminKey = null;\n\n if (props.adminKey != null) {\n this.setAdminKey(props.adminKey);\n }\n /**\n * @private\n * @type {?Key}\n */\n this._feeScheduleKey = null;\n\n if (props.feeScheduleKey != null) {\n this.setFeeScheduleKey(props.feeScheduleKey);\n }\n\n /**\n * @private\n * @type {?Key[]}\n */\n this._feeExemptKeys = null;\n\n if (props.feeExemptKeys != null) {\n this.setFeeExemptKeys(props.feeExemptKeys);\n }\n\n /**\n * @private\n * @type {?AccountId}\n */\n this._autoRenewAccountId = null;\n\n if (props.autoRenewAccountId != null) {\n this.setAutoRenewAccountId(props.autoRenewAccountId);\n }\n\n /**\n * @private\n * @type {?Duration}\n */\n this._autoRenewPeriod = null;\n\n if (props.autoRenewPeriod != null) {\n this.setAutoRenewPeriod(props.autoRenewPeriod);\n }\n\n /**\n * @private\n * @type {?CustomFixedFee[]}\n */\n this._customFees = null;\n\n if (props.customFees != null) {\n this.setCustomFees(props.customFees);\n }\n\n /**\n * @private\n * @type {?Timestamp}\n */\n this._expirationTime = null;\n\n if (props.expirationTime != null) {\n this.setExpirationTime(props.expirationTime);\n }\n }\n\n /**\n * @internal\n * @param {HieroProto.proto.ITransaction[]} transactions\n * @param {HieroProto.proto.ISignedTransaction[]} signedTransactions\n * @param {TransactionId[]} transactionIds\n * @param {AccountId[]} nodeIds\n * @param {HieroProto.proto.ITransactionBody[]} bodies\n * @returns {TopicUpdateTransaction}\n */\n static _fromProtobuf(\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n ) {\n const body = bodies[0];\n const update =\n /** @type {HieroProto.proto.IConsensusUpdateTopicTransactionBody} */ (\n body.consensusUpdateTopic\n );\n\n return Transaction._fromProtobufTransactions(\n new TopicUpdateTransaction({\n topicId:\n update.topicID != null\n ? TopicId._fromProtobuf(update.topicID)\n : undefined,\n adminKey:\n update.adminKey != null\n ? Key._fromProtobufKey(update.adminKey)\n : undefined,\n submitKey:\n update.submitKey != null\n ? Key._fromProtobufKey(update.submitKey)\n : undefined,\n feeScheduleKey:\n update.feeScheduleKey != null\n ? Key._fromProtobufKey(update.feeScheduleKey)\n : undefined,\n feeExemptKeys:\n update.feeExemptKeyList != null &&\n update.feeExemptKeyList.keys != null\n ? update?.feeExemptKeyList.keys.map((key) =>\n Key._fromProtobufKey(key),\n )\n : undefined,\n autoRenewAccountId:\n update.autoRenewAccount != null\n ? AccountId._fromProtobuf(update.autoRenewAccount)\n : undefined,\n autoRenewPeriod:\n update.autoRenewPeriod != null\n ? update.autoRenewPeriod.seconds != null\n ? update.autoRenewPeriod.seconds\n : undefined\n : undefined,\n customFees:\n update.customFees != null && update.customFees.fees != null\n ? update.customFees.fees.map((customFee) =>\n CustomFixedFee._fromProtobuf(customFee),\n )\n : undefined,\n topicMemo:\n update.memo != null\n ? Object.hasOwn(update.memo, \"value\")\n ? update.memo.value\n : undefined\n : undefined,\n expirationTime:\n update.expirationTime != null\n ? Timestamp._fromProtobuf(update.expirationTime)\n : undefined,\n }),\n transactions,\n signedTransactions,\n transactionIds,\n nodeIds,\n bodies,\n );\n }\n\n /**\n * @returns {?Timestamp}\n */\n get expirationTime() {\n return this._expirationTime;\n }\n\n /**\n * @param {Timestamp | Date | null} expirationTime\n * @returns {TopicUpdateTransaction}\n */\n setExpirationTime(expirationTime) {\n this._requireNotFrozen();\n\n this._expirationTime =\n expirationTime instanceof Date\n ? Timestamp.fromDate(expirationTime)\n : expirationTime;\n\n return this;\n }\n\n /**\n * @returns {?TopicId}\n */\n get topicId() {\n return this._topicId;\n }\n\n /**\n * @param {TopicId | string} topicId\n * @returns {TopicUpdateTransaction}\n */\n setTopicId(topicId) {\n this._requireNotFrozen();\n this._topicId =\n typeof topicId === \"string\"\n ? TopicId.fromString(topicId)\n : topicId.clone();\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearTopicId() {\n this._requireNotFrozen();\n this._topicId = null;\n\n return this;\n }\n\n /**\n * @returns {?string}\n */\n get topicMemo() {\n return this._topicMemo;\n }\n\n /**\n * @param {string} topicMemo\n * @returns {TopicUpdateTransaction}\n */\n setTopicMemo(topicMemo) {\n this._requireNotFrozen();\n this._topicMemo = topicMemo;\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearTopicMemo() {\n this._requireNotFrozen();\n this._topicMemo = null;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get adminKey() {\n return this._adminKey;\n }\n\n /**\n * @param {Key} adminKey\n * @returns {TopicUpdateTransaction}\n */\n setAdminKey(adminKey) {\n this._requireNotFrozen();\n this._adminKey = adminKey;\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearAdminKey() {\n this._requireNotFrozen();\n this._adminKey = null;\n\n return this;\n }\n\n /**\n * @returns {?Key}\n */\n get submitKey() {\n return this._submitKey;\n }\n\n /**\n * @param {Key} submitKey\n * @returns {TopicUpdateTransaction}\n */\n setSubmitKey(submitKey) {\n this._requireNotFrozen();\n this._submitKey = submitKey;\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearSubmitKey() {\n this._requireNotFrozen();\n this._submitKey = null;\n\n return this;\n }\n\n /**\n * Returns the key which allows updates to the new topic’s fees.\n * @returns {?Key}\n */\n getFeeScheduleKey() {\n return this._feeScheduleKey;\n }\n\n /**\n * Sets the key which allows updates to the new topic’s fees.\n * @param {Key} feeScheduleKey\n * @returns {this}\n */\n setFeeScheduleKey(feeScheduleKey) {\n this._requireNotFrozen();\n this._feeScheduleKey = feeScheduleKey;\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearFeeScheduleKey() {\n this._requireNotFrozen();\n this._feeScheduleKey = null;\n\n return this;\n }\n\n /**\n * Returns the keys that will be exempt from paying fees.\n * @returns {?Key[]}\n */\n getFeeExemptKeys() {\n return this._feeExemptKeys;\n }\n\n /**\n * Sets the keys that will be exempt from paying fees.\n * @param {Key[]} feeExemptKeys\n * @returns {this}\n */\n setFeeExemptKeys(feeExemptKeys) {\n this._requireNotFrozen();\n this._feeExemptKeys = feeExemptKeys;\n\n return this;\n }\n\n /**\n * Adds a key that will be exempt from paying fees.\n * @param {Key} key\n * @returns {this}\n */\n addFeeExemptKey(key) {\n this._requireNotFrozen();\n if (this._feeExemptKeys == null) {\n this._feeExemptKeys = [];\n }\n\n this._feeExemptKeys.push(key);\n\n return this;\n }\n\n /**\n * Clears all keys that will be exempt from paying fees, effectively removing them from the network state.\n * @returns {this}\n */\n clearFeeExemptKeys() {\n this._requireNotFrozen();\n this._feeExemptKeys = [];\n\n return this;\n }\n\n /**\n * @returns {?AccountId}\n */\n get autoRenewAccountId() {\n return this._autoRenewAccountId;\n }\n\n /**\n * @param {AccountId | string} autoRenewAccountId\n * @returns {TopicUpdateTransaction}\n */\n setAutoRenewAccountId(autoRenewAccountId) {\n this._requireNotFrozen();\n this._autoRenewAccountId =\n autoRenewAccountId instanceof AccountId\n ? autoRenewAccountId\n : AccountId.fromString(autoRenewAccountId);\n\n return this;\n }\n\n /**\n * @returns {TopicUpdateTransaction}\n */\n clearAutoRenewAccountId() {\n this._requireNotFrozen();\n this._autoRenewAccountId = null;\n\n return this;\n }\n\n /**\n * @returns {?Duration}\n */\n get autoRenewPeriod() {\n return this._autoRenewPeriod;\n }\n\n /**\n * Set the auto renew period for this account.\n *\n * @param {Duration | Long | number} autoRenewPeriod\n * @returns {TopicUpdateTransaction}\n */\n setAutoRenewPeriod(autoRenewPeriod) {\n this._requireNotFrozen();\n this._autoRenewPeriod =\n autoRenewPeriod instanceof Duration\n ? autoRenewPeriod\n : new Duration(autoRenewPeriod);\n\n return this;\n }\n\n /**\n * Returns the fixed fees to assess when a message is submitted to the new topic.\n * @returns {?CustomFixedFee[]}\n */\n getCustomFees() {\n return this._customFees;\n }\n\n /**\n * Sets the fixed fees to assess when a message is submitted to the new topic.\n *\n * @param {CustomFixedFee[]} customFees\n * @returns {this}\n */\n setCustomFees(customFees) {\n this._requireNotFrozen();\n this._customFees = customFees;\n\n return this;\n }\n\n /**\n * Adds fixed fee to assess when a message is submitted to the new topic.\n *\n * @param {CustomFixedFee} customFee\n * @returns {this}\n */\n addCustomFee(customFee) {\n this._requireNotFrozen();\n if (this._customFees == null) {\n this._customFees = [];\n }\n\n this._customFees.push(customFee);\n\n return this;\n }\n\n /**\n * Clears fixed fees, effectively removing them from the network state.\n *\n * @returns {this}\n */\n clearCustomFees() {\n this._requireNotFrozen();\n this._customFees = [];\n\n return this;\n }\n\n /**\n * @param {Client} client\n */\n _validateChecksums(client) {\n if (this._topicId != null) {\n this._topicId.validateChecksum(client);\n }\n\n if (this._autoRenewAccountId != null) {\n this._autoRenewAccountId.validateChecksum(client);\n }\n }\n\n /**\n * @override\n * @internal\n * @param {Channel} channel\n * @param {HieroProto.proto.ITransaction} request\n * @returns {Promise<HieroProto.proto.ITransactionResponse>}\n */\n _execute(channel, request) {\n return channel.consensus.updateTopic(request);\n }\n\n /**\n * @override\n * @protected\n * @returns {NonNullable<HieroProto.proto.TransactionBody[\"data\"]>}\n */\n _getTransactionDataCase() {\n return \"consensusUpdateTopic\";\n }\n\n /**\n * @override\n * @protected\n * @returns {HieroProto.proto.IConsensusUpdateTopicTransactionBody}\n */\n _makeTransactionData() {\n return {\n topicID: this._topicId != null ? this._topicId._toProtobuf() : null,\n adminKey:\n this._adminKey != null ? this._adminKey._toProtobufKey() : null,\n submitKey:\n this._submitKey != null\n ? this._submitKey._toProtobufKey()\n : null,\n feeScheduleKey:\n this._feeScheduleKey != null\n ? this._feeScheduleKey._toProtobufKey()\n : null,\n feeExemptKeyList:\n this._feeExemptKeys != null\n ? {\n keys: this._feeExemptKeys.map((key) =>\n key._toProtobufKey(),\n ),\n }\n : null,\n memo:\n this._topicMemo != null\n ? {\n value: this._topicMemo,\n }\n : null,\n autoRenewAccount:\n this._autoRenewAccountId != null\n ? this._autoRenewAccountId._toProtobuf()\n : null,\n autoRenewPeriod:\n this._autoRenewPeriod != null\n ? this._autoRenewPeriod._toProtobuf()\n : null,\n customFees:\n this._customFees != null\n ? {\n fees: this._customFees.map((customFee) =>\n customFee._toTopicFeeProtobuf(),\n ),\n }\n : null,\n expirationTime:\n this._expirationTime != null\n ? this._expirationTime._toProtobuf()\n : null,\n };\n }\n\n /**\n * @returns {string}\n */\n _getLogId() {\n const timestamp = /** @type {import(\"../Timestamp.js\").default} */ (\n this._transactionIds.current.validStart\n );\n return `TopicUpdateTransaction:${timestamp.toString()}`;\n }\n}\n\nTRANSACTION_REGISTRY.set(\n \"consensusUpdateTopic\",\n // eslint-disable-next-line @typescript-eslint/unbound-method\n TopicUpdateTransaction._fromProtobuf,\n);\n"],"names":["TopicUpdateTransaction","Transaction","constructor","props","super","this","_topicId","topicId","setTopicId","_topicMemo","topicMemo","setTopicMemo","_submitKey","submitKey","setSubmitKey","_adminKey","adminKey","setAdminKey","_feeScheduleKey","feeScheduleKey","setFeeScheduleKey","_feeExemptKeys","feeExemptKeys","setFeeExemptKeys","_autoRenewAccountId","autoRenewAccountId","setAutoRenewAccountId","_autoRenewPeriod","autoRenewPeriod","setAutoRenewPeriod","_customFees","customFees","setCustomFees","_expirationTime","expirationTime","setExpirationTime","_fromProtobuf","transactions","signedTransactions","transactionIds","nodeIds","bodies","update","_fromProtobufTransactions","topicID","TopicId","undefined","Key","_fromProtobufKey","feeExemptKeyList","keys","map","key","autoRenewAccount","AccountId","seconds","fees","customFee","CustomFixedFee","memo","Object","hasOwn","value","Timestamp","_requireNotFrozen","Date","fromDate","fromString","clone","clearTopicId","clearTopicMemo","clearAdminKey","clearSubmitKey","getFeeScheduleKey","clearFeeScheduleKey","getFeeExemptKeys","addFeeExemptKey","push","clearFeeExemptKeys","clearAutoRenewAccountId","Duration","getCustomFees","addCustomFee","clearCustomFees","_validateChecksums","client","validateChecksum","_execute","channel","request","consensus","updateTopic","_getTransactionDataCase","_makeTransactionData","_toProtobuf","_toProtobufKey","_toTopicFeeProtobuf","_getLogId","_transactionIds","current","toString","TRANSACTION_REGISTRY","set"],"mappings":"2QAsCe,MAAMA,UAA+BC,EAchD,WAAAC,CAAYC,EAAQ,IAChBC,QAMAC,KAAKC,SAAW,KAEK,MAAjBH,EAAMI,SACNF,KAAKG,WAAWL,EA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