@hiero-ledger/sdk 2.70.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1272) hide show
  1. package/LICENSE +190 -0
  2. package/README.md +167 -0
  3. package/dist/umd.js +98781 -0
  4. package/dist/umd.min.js +122 -0
  5. package/lib/BadEntityIdError.cjs +27 -0
  6. package/lib/BadEntityIdError.d.ts +15 -0
  7. package/lib/BadEntityIdError.js +2 -0
  8. package/lib/BadEntityIdError.js.map +1 -0
  9. package/lib/Cache.cjs +376 -0
  10. package/lib/Cache.d.ts +228 -0
  11. package/lib/Cache.js +2 -0
  12. package/lib/Cache.js.map +1 -0
  13. package/lib/Duration.cjs +53 -0
  14. package/lib/Duration.d.ts +37 -0
  15. package/lib/Duration.js +2 -0
  16. package/lib/Duration.js.map +1 -0
  17. package/lib/EntityIdHelper.cjs +547 -0
  18. package/lib/EntityIdHelper.d.ts +203 -0
  19. package/lib/EntityIdHelper.js +2 -0
  20. package/lib/EntityIdHelper.js.map +1 -0
  21. package/lib/EthereumFlow.cjs +207 -0
  22. package/lib/EthereumFlow.d.ts +134 -0
  23. package/lib/EthereumFlow.js +2 -0
  24. package/lib/EthereumFlow.js.map +1 -0
  25. package/lib/EthereumTransaction.cjs +260 -0
  26. package/lib/EthereumTransaction.d.ts +161 -0
  27. package/lib/EthereumTransaction.js +2 -0
  28. package/lib/EthereumTransaction.js.map +1 -0
  29. package/lib/EthereumTransactionData.cjs +66 -0
  30. package/lib/EthereumTransactionData.d.ts +33 -0
  31. package/lib/EthereumTransactionData.js +2 -0
  32. package/lib/EthereumTransactionData.js.map +1 -0
  33. package/lib/EthereumTransactionDataEip1559.cjs +134 -0
  34. package/lib/EthereumTransactionDataEip1559.d.ts +64 -0
  35. package/lib/EthereumTransactionDataEip1559.js +2 -0
  36. package/lib/EthereumTransactionDataEip1559.js.map +1 -0
  37. package/lib/EthereumTransactionDataEip2930.cjs +129 -0
  38. package/lib/EthereumTransactionDataEip2930.d.ts +60 -0
  39. package/lib/EthereumTransactionDataEip2930.js +2 -0
  40. package/lib/EthereumTransactionDataEip2930.js.map +1 -0
  41. package/lib/EthereumTransactionDataLegacy.cjs +112 -0
  42. package/lib/EthereumTransactionDataLegacy.d.ts +52 -0
  43. package/lib/EthereumTransactionDataLegacy.js +2 -0
  44. package/lib/EthereumTransactionDataLegacy.js.map +1 -0
  45. package/lib/EvmAddress.cjs +84 -0
  46. package/lib/EvmAddress.d.ts +47 -0
  47. package/lib/EvmAddress.js +2 -0
  48. package/lib/EvmAddress.js.map +1 -0
  49. package/lib/ExchangeRate.cjs +113 -0
  50. package/lib/ExchangeRate.d.ts +75 -0
  51. package/lib/ExchangeRate.js +2 -0
  52. package/lib/ExchangeRate.js.map +1 -0
  53. package/lib/ExchangeRates.cjs +75 -0
  54. package/lib/ExchangeRates.d.ts +39 -0
  55. package/lib/ExchangeRates.js +2 -0
  56. package/lib/ExchangeRates.js.map +1 -0
  57. package/lib/Executable.cjs +760 -0
  58. package/lib/Executable.d.ts +365 -0
  59. package/lib/Executable.js +2 -0
  60. package/lib/Executable.js.map +1 -0
  61. package/lib/FeeComponents.cjs +170 -0
  62. package/lib/FeeComponents.d.ts +66 -0
  63. package/lib/FeeComponents.js +2 -0
  64. package/lib/FeeComponents.js.map +1 -0
  65. package/lib/FeeData.cjs +111 -0
  66. package/lib/FeeData.d.ts +58 -0
  67. package/lib/FeeData.js +2 -0
  68. package/lib/FeeData.js.map +1 -0
  69. package/lib/FeeDataType.cjs +128 -0
  70. package/lib/FeeDataType.d.ts +44 -0
  71. package/lib/FeeDataType.js +2 -0
  72. package/lib/FeeDataType.js.map +1 -0
  73. package/lib/FeeSchedule.cjs +79 -0
  74. package/lib/FeeSchedule.d.ts +40 -0
  75. package/lib/FeeSchedule.js +2 -0
  76. package/lib/FeeSchedule.js.map +1 -0
  77. package/lib/FeeSchedules.cjs +79 -0
  78. package/lib/FeeSchedules.d.ts +40 -0
  79. package/lib/FeeSchedules.js +2 -0
  80. package/lib/FeeSchedules.js.map +1 -0
  81. package/lib/FreezeType.cjs +117 -0
  82. package/lib/FreezeType.d.ts +42 -0
  83. package/lib/FreezeType.js +2 -0
  84. package/lib/FreezeType.js.map +1 -0
  85. package/lib/Hbar.cjs +139 -0
  86. package/lib/Hbar.d.ts +62 -0
  87. package/lib/Hbar.js +2 -0
  88. package/lib/Hbar.js.map +1 -0
  89. package/lib/HbarUnit.cjs +77 -0
  90. package/lib/HbarUnit.d.ts +46 -0
  91. package/lib/HbarUnit.js +2 -0
  92. package/lib/HbarUnit.js.map +1 -0
  93. package/lib/Key.cjs +62 -0
  94. package/lib/Key.d.ts +23 -0
  95. package/lib/Key.js +2 -0
  96. package/lib/Key.js.map +1 -0
  97. package/lib/KeyList.cjs +181 -0
  98. package/lib/KeyList.d.ts +87 -0
  99. package/lib/KeyList.js +2 -0
  100. package/lib/KeyList.js.map +1 -0
  101. package/lib/LedgerId.cjs +137 -0
  102. package/lib/LedgerId.d.ts +64 -0
  103. package/lib/LedgerId.js +2 -0
  104. package/lib/LedgerId.js.map +1 -0
  105. package/lib/LocalProvider.cjs +159 -0
  106. package/lib/LocalProvider.d.ts +120 -0
  107. package/lib/LocalProvider.js +2 -0
  108. package/lib/LocalProvider.js.map +1 -0
  109. package/lib/ManagedNode.cjs +245 -0
  110. package/lib/ManagedNode.d.ts +127 -0
  111. package/lib/ManagedNode.js +2 -0
  112. package/lib/ManagedNode.js.map +1 -0
  113. package/lib/ManagedNodeAddress.cjs +104 -0
  114. package/lib/ManagedNodeAddress.d.ts +51 -0
  115. package/lib/ManagedNodeAddress.js +2 -0
  116. package/lib/ManagedNodeAddress.js.map +1 -0
  117. package/lib/MaxAttemptsOrTimeoutError.cjs +48 -0
  118. package/lib/MaxAttemptsOrTimeoutError.d.ts +26 -0
  119. package/lib/MaxAttemptsOrTimeoutError.js +2 -0
  120. package/lib/MaxAttemptsOrTimeoutError.js.map +1 -0
  121. package/lib/MaxQueryPaymentExceeded.cjs +34 -0
  122. package/lib/MaxQueryPaymentExceeded.d.ts +21 -0
  123. package/lib/MaxQueryPaymentExceeded.js +2 -0
  124. package/lib/MaxQueryPaymentExceeded.js.map +1 -0
  125. package/lib/MirrorNode.cjs +48 -0
  126. package/lib/MirrorNode.d.ts +39 -0
  127. package/lib/MirrorNode.js +2 -0
  128. package/lib/MirrorNode.js.map +1 -0
  129. package/lib/Mnemonic.cjs +232 -0
  130. package/lib/Mnemonic.d.ts +145 -0
  131. package/lib/Mnemonic.js +2 -0
  132. package/lib/Mnemonic.js.map +1 -0
  133. package/lib/Node.cjs +114 -0
  134. package/lib/Node.d.ts +72 -0
  135. package/lib/Node.js +2 -0
  136. package/lib/Node.js.map +1 -0
  137. package/lib/ObjectMap.cjs +137 -0
  138. package/lib/ObjectMap.d.ts +88 -0
  139. package/lib/ObjectMap.js +2 -0
  140. package/lib/ObjectMap.js.map +1 -0
  141. package/lib/PrecheckStatusError.cjs +77 -0
  142. package/lib/PrecheckStatusError.d.ts +68 -0
  143. package/lib/PrecheckStatusError.js +2 -0
  144. package/lib/PrecheckStatusError.js.map +1 -0
  145. package/lib/PrivateKey.cjs +529 -0
  146. package/lib/PrivateKey.d.ts +312 -0
  147. package/lib/PrivateKey.js +2 -0
  148. package/lib/PrivateKey.js.map +1 -0
  149. package/lib/PrngTransaction.cjs +136 -0
  150. package/lib/PrngTransaction.d.ts +74 -0
  151. package/lib/PrngTransaction.js +2 -0
  152. package/lib/PrngTransaction.js.map +1 -0
  153. package/lib/Provider.cjs +41 -0
  154. package/lib/Provider.d.ts +32 -0
  155. package/lib/Provider.js +2 -0
  156. package/lib/Provider.js.map +1 -0
  157. package/lib/PublicKey.cjs +285 -0
  158. package/lib/PublicKey.d.ts +142 -0
  159. package/lib/PublicKey.js +2 -0
  160. package/lib/PublicKey.js.map +1 -0
  161. package/lib/ReceiptStatusError.cjs +45 -0
  162. package/lib/ReceiptStatusError.d.ts +38 -0
  163. package/lib/ReceiptStatusError.js +2 -0
  164. package/lib/ReceiptStatusError.js.map +1 -0
  165. package/lib/RecordStatusError.cjs +34 -0
  166. package/lib/RecordStatusError.d.ts +27 -0
  167. package/lib/RecordStatusError.js +2 -0
  168. package/lib/RecordStatusError.js.map +1 -0
  169. package/lib/RequestType.cjs +922 -0
  170. package/lib/RequestType.d.ts +131 -0
  171. package/lib/RequestType.js +2 -0
  172. package/lib/RequestType.js.map +1 -0
  173. package/lib/Signer.cjs +47 -0
  174. package/lib/Signer.d.ts +38 -0
  175. package/lib/Signer.js +2 -0
  176. package/lib/Signer.js.map +1 -0
  177. package/lib/SignerSignature.cjs +34 -0
  178. package/lib/SignerSignature.d.ts +29 -0
  179. package/lib/SignerSignature.js +2 -0
  180. package/lib/SignerSignature.js.map +1 -0
  181. package/lib/StakingInfo.cjs +160 -0
  182. package/lib/StakingInfo.d.ts +109 -0
  183. package/lib/StakingInfo.js +2 -0
  184. package/lib/StakingInfo.js.map +1 -0
  185. package/lib/Status.cjs +3353 -0
  186. package/lib/Status.d.ts +395 -0
  187. package/lib/Status.js +2 -0
  188. package/lib/Status.js.map +1 -0
  189. package/lib/StatusError.cjs +66 -0
  190. package/lib/StatusError.d.ts +41 -0
  191. package/lib/StatusError.js +2 -0
  192. package/lib/StatusError.js.map +1 -0
  193. package/lib/Timestamp.cjs +144 -0
  194. package/lib/Timestamp.d.ts +69 -0
  195. package/lib/Timestamp.js +2 -0
  196. package/lib/Timestamp.js.map +1 -0
  197. package/lib/TransactionFeeSchedule.cjs +85 -0
  198. package/lib/TransactionFeeSchedule.d.ts +39 -0
  199. package/lib/TransactionFeeSchedule.js +2 -0
  200. package/lib/TransactionFeeSchedule.js.map +1 -0
  201. package/lib/Transfer.cjs +104 -0
  202. package/lib/Transfer.d.ts +77 -0
  203. package/lib/Transfer.js +2 -0
  204. package/lib/Transfer.js.map +1 -0
  205. package/lib/Wallet.cjs +253 -0
  206. package/lib/Wallet.d.ts +147 -0
  207. package/lib/Wallet.js +2 -0
  208. package/lib/Wallet.js.map +1 -0
  209. package/lib/account/AccountAllowanceAdjustTransaction.cjs +366 -0
  210. package/lib/account/AccountAllowanceAdjustTransaction.d.ts +208 -0
  211. package/lib/account/AccountAllowanceAdjustTransaction.js +2 -0
  212. package/lib/account/AccountAllowanceAdjustTransaction.js.map +1 -0
  213. package/lib/account/AccountAllowanceApproveTransaction.cjs +353 -0
  214. package/lib/account/AccountAllowanceApproveTransaction.d.ts +194 -0
  215. package/lib/account/AccountAllowanceApproveTransaction.js +2 -0
  216. package/lib/account/AccountAllowanceApproveTransaction.js.map +1 -0
  217. package/lib/account/AccountAllowanceDeleteTransaction.cjs +166 -0
  218. package/lib/account/AccountAllowanceDeleteTransaction.d.ts +90 -0
  219. package/lib/account/AccountAllowanceDeleteTransaction.js +2 -0
  220. package/lib/account/AccountAllowanceDeleteTransaction.js.map +1 -0
  221. package/lib/account/AccountBalance.cjs +145 -0
  222. package/lib/account/AccountBalance.d.ts +72 -0
  223. package/lib/account/AccountBalance.js +2 -0
  224. package/lib/account/AccountBalance.js.map +1 -0
  225. package/lib/account/AccountBalanceQuery.cjs +210 -0
  226. package/lib/account/AccountBalanceQuery.d.ts +92 -0
  227. package/lib/account/AccountBalanceQuery.js +2 -0
  228. package/lib/account/AccountBalanceQuery.js.map +1 -0
  229. package/lib/account/AccountCreateTransaction.cjs +566 -0
  230. package/lib/account/AccountCreateTransaction.d.ts +309 -0
  231. package/lib/account/AccountCreateTransaction.js +2 -0
  232. package/lib/account/AccountCreateTransaction.js.map +1 -0
  233. package/lib/account/AccountDeleteTransaction.cjs +181 -0
  234. package/lib/account/AccountDeleteTransaction.d.ts +97 -0
  235. package/lib/account/AccountDeleteTransaction.js +2 -0
  236. package/lib/account/AccountDeleteTransaction.js.map +1 -0
  237. package/lib/account/AccountId.cjs +400 -0
  238. package/lib/account/AccountId.d.ts +149 -0
  239. package/lib/account/AccountId.js +2 -0
  240. package/lib/account/AccountId.js.map +1 -0
  241. package/lib/account/AccountInfo.cjs +356 -0
  242. package/lib/account/AccountInfo.d.ts +234 -0
  243. package/lib/account/AccountInfo.js +2 -0
  244. package/lib/account/AccountInfo.js.map +1 -0
  245. package/lib/account/AccountInfoFlow.cjs +88 -0
  246. package/lib/account/AccountInfoFlow.d.ts +53 -0
  247. package/lib/account/AccountInfoFlow.js +2 -0
  248. package/lib/account/AccountInfoFlow.js.map +1 -0
  249. package/lib/account/AccountInfoQuery.cjs +170 -0
  250. package/lib/account/AccountInfoQuery.d.ts +67 -0
  251. package/lib/account/AccountInfoQuery.js +2 -0
  252. package/lib/account/AccountInfoQuery.js.map +1 -0
  253. package/lib/account/AccountRecordsQuery.cjs +163 -0
  254. package/lib/account/AccountRecordsQuery.d.ts +67 -0
  255. package/lib/account/AccountRecordsQuery.js +2 -0
  256. package/lib/account/AccountRecordsQuery.js.map +1 -0
  257. package/lib/account/AccountUpdateTransaction.cjs +503 -0
  258. package/lib/account/AccountUpdateTransaction.d.ts +271 -0
  259. package/lib/account/AccountUpdateTransaction.js +2 -0
  260. package/lib/account/AccountUpdateTransaction.js.map +1 -0
  261. package/lib/account/HbarAllowance.cjs +126 -0
  262. package/lib/account/HbarAllowance.d.ts +85 -0
  263. package/lib/account/HbarAllowance.js +2 -0
  264. package/lib/account/HbarAllowance.js.map +1 -0
  265. package/lib/account/HbarTransferMap.cjs +45 -0
  266. package/lib/account/HbarTransferMap.d.ts +31 -0
  267. package/lib/account/HbarTransferMap.js +2 -0
  268. package/lib/account/HbarTransferMap.js.map +1 -0
  269. package/lib/account/LiveHash.cjs +76 -0
  270. package/lib/account/LiveHash.d.ts +49 -0
  271. package/lib/account/LiveHash.js +2 -0
  272. package/lib/account/LiveHash.js.map +1 -0
  273. package/lib/account/LiveHashAddTransaction.cjs +238 -0
  274. package/lib/account/LiveHashAddTransaction.d.ts +125 -0
  275. package/lib/account/LiveHashAddTransaction.js +2 -0
  276. package/lib/account/LiveHashAddTransaction.js.map +1 -0
  277. package/lib/account/LiveHashDeleteTransaction.cjs +170 -0
  278. package/lib/account/LiveHashDeleteTransaction.d.ts +88 -0
  279. package/lib/account/LiveHashDeleteTransaction.js +2 -0
  280. package/lib/account/LiveHashDeleteTransaction.js.map +1 -0
  281. package/lib/account/LiveHashQuery.cjs +188 -0
  282. package/lib/account/LiveHashQuery.d.ts +91 -0
  283. package/lib/account/LiveHashQuery.js +2 -0
  284. package/lib/account/LiveHashQuery.js.map +1 -0
  285. package/lib/account/NullableTokenDecimalMap.cjs +26 -0
  286. package/lib/account/NullableTokenDecimalMap.d.ts +19 -0
  287. package/lib/account/NullableTokenDecimalMap.js +2 -0
  288. package/lib/account/NullableTokenDecimalMap.js.map +1 -0
  289. package/lib/account/ProxyStaker.cjs +73 -0
  290. package/lib/account/ProxyStaker.d.ts +53 -0
  291. package/lib/account/ProxyStaker.js +2 -0
  292. package/lib/account/ProxyStaker.js.map +1 -0
  293. package/lib/account/TokenAllowance.cjs +130 -0
  294. package/lib/account/TokenAllowance.d.ts +93 -0
  295. package/lib/account/TokenAllowance.js +2 -0
  296. package/lib/account/TokenAllowance.js.map +1 -0
  297. package/lib/account/TokenBalanceMap.cjs +30 -0
  298. package/lib/account/TokenBalanceMap.d.ts +23 -0
  299. package/lib/account/TokenBalanceMap.js +2 -0
  300. package/lib/account/TokenBalanceMap.js.map +1 -0
  301. package/lib/account/TokenDecimalMap.cjs +26 -0
  302. package/lib/account/TokenDecimalMap.d.ts +19 -0
  303. package/lib/account/TokenDecimalMap.js +2 -0
  304. package/lib/account/TokenDecimalMap.js.map +1 -0
  305. package/lib/account/TokenNftAllowance.cjs +168 -0
  306. package/lib/account/TokenNftAllowance.d.ts +110 -0
  307. package/lib/account/TokenNftAllowance.js +2 -0
  308. package/lib/account/TokenNftAllowance.js.map +1 -0
  309. package/lib/account/TokenNftTransferMap.cjs +116 -0
  310. package/lib/account/TokenNftTransferMap.d.ts +55 -0
  311. package/lib/account/TokenNftTransferMap.js +2 -0
  312. package/lib/account/TokenNftTransferMap.js.map +1 -0
  313. package/lib/account/TokenRelationship.cjs +113 -0
  314. package/lib/account/TokenRelationship.d.ts +87 -0
  315. package/lib/account/TokenRelationship.js +2 -0
  316. package/lib/account/TokenRelationship.js.map +1 -0
  317. package/lib/account/TokenRelationshipMap.cjs +57 -0
  318. package/lib/account/TokenRelationshipMap.d.ts +33 -0
  319. package/lib/account/TokenRelationshipMap.js +2 -0
  320. package/lib/account/TokenRelationshipMap.js.map +1 -0
  321. package/lib/account/TokenTransferAccountMap.cjs +28 -0
  322. package/lib/account/TokenTransferAccountMap.d.ts +8 -0
  323. package/lib/account/TokenTransferAccountMap.js +2 -0
  324. package/lib/account/TokenTransferAccountMap.js.map +1 -0
  325. package/lib/account/TokenTransferMap.cjs +86 -0
  326. package/lib/account/TokenTransferMap.d.ts +41 -0
  327. package/lib/account/TokenTransferMap.js +2 -0
  328. package/lib/account/TokenTransferMap.js.map +1 -0
  329. package/lib/account/TransferTransaction.cjs +303 -0
  330. package/lib/account/TransferTransaction.d.ts +173 -0
  331. package/lib/account/TransferTransaction.js +2 -0
  332. package/lib/account/TransferTransaction.js.map +1 -0
  333. package/lib/address_book/AddressBooks.cjs +17 -0
  334. package/lib/address_book/AddressBooks.d.ts +4 -0
  335. package/lib/address_book/AddressBooks.js +2 -0
  336. package/lib/address_book/AddressBooks.js.map +1 -0
  337. package/lib/address_book/Endpoint.cjs +140 -0
  338. package/lib/address_book/Endpoint.d.ts +79 -0
  339. package/lib/address_book/Endpoint.js +2 -0
  340. package/lib/address_book/Endpoint.js.map +1 -0
  341. package/lib/address_book/IPv4Address.cjs +116 -0
  342. package/lib/address_book/IPv4Address.d.ts +59 -0
  343. package/lib/address_book/IPv4Address.js +2 -0
  344. package/lib/address_book/IPv4Address.js.map +1 -0
  345. package/lib/address_book/IPv4AddressPart.cjs +76 -0
  346. package/lib/address_book/IPv4AddressPart.d.ts +41 -0
  347. package/lib/address_book/IPv4AddressPart.js +2 -0
  348. package/lib/address_book/IPv4AddressPart.js.map +1 -0
  349. package/lib/address_book/NodeAddress.cjs +287 -0
  350. package/lib/address_book/NodeAddress.d.ts +170 -0
  351. package/lib/address_book/NodeAddress.js +2 -0
  352. package/lib/address_book/NodeAddress.js.map +1 -0
  353. package/lib/address_book/NodeAddressBook.cjs +108 -0
  354. package/lib/address_book/NodeAddressBook.d.ts +66 -0
  355. package/lib/address_book/NodeAddressBook.js +2 -0
  356. package/lib/address_book/NodeAddressBook.js.map +1 -0
  357. package/lib/array.cjs +51 -0
  358. package/lib/array.d.ts +14 -0
  359. package/lib/array.js +2 -0
  360. package/lib/array.js.map +1 -0
  361. package/lib/base32.cjs +38 -0
  362. package/lib/base32.d.ts +18 -0
  363. package/lib/base32.js +2 -0
  364. package/lib/base32.js.map +1 -0
  365. package/lib/browser.cjs +36 -0
  366. package/lib/browser.d.ts +3 -0
  367. package/lib/browser.js +2 -0
  368. package/lib/browser.js.map +1 -0
  369. package/lib/channel/Channel.cjs +293 -0
  370. package/lib/channel/Channel.d.ts +121 -0
  371. package/lib/channel/Channel.js +2 -0
  372. package/lib/channel/Channel.js.map +1 -0
  373. package/lib/channel/MirrorChannel.cjs +55 -0
  374. package/lib/channel/MirrorChannel.d.ts +32 -0
  375. package/lib/channel/MirrorChannel.js +2 -0
  376. package/lib/channel/MirrorChannel.js.map +1 -0
  377. package/lib/channel/NativeChannel.cjs +97 -0
  378. package/lib/channel/NativeChannel.d.ts +12 -0
  379. package/lib/channel/NativeChannel.js +2 -0
  380. package/lib/channel/NativeChannel.js.map +1 -0
  381. package/lib/channel/NodeChannel.cjs +173 -0
  382. package/lib/channel/NodeChannel.d.ts +41 -0
  383. package/lib/channel/NodeChannel.js +2 -0
  384. package/lib/channel/NodeChannel.js.map +1 -0
  385. package/lib/channel/NodeMirrorChannel.cjs +78 -0
  386. package/lib/channel/NodeMirrorChannel.d.ts +22 -0
  387. package/lib/channel/NodeMirrorChannel.js +2 -0
  388. package/lib/channel/NodeMirrorChannel.js.map +1 -0
  389. package/lib/channel/WebChannel.cjs +90 -0
  390. package/lib/channel/WebChannel.d.ts +12 -0
  391. package/lib/channel/WebChannel.js +2 -0
  392. package/lib/channel/WebChannel.js.map +1 -0
  393. package/lib/client/Client.cjs +818 -0
  394. package/lib/client/Client.d.ts +487 -0
  395. package/lib/client/Client.js +2 -0
  396. package/lib/client/Client.js.map +1 -0
  397. package/lib/client/ManagedNetwork.cjs +427 -0
  398. package/lib/client/ManagedNetwork.d.ts +175 -0
  399. package/lib/client/ManagedNetwork.js +2 -0
  400. package/lib/client/ManagedNetwork.js.map +1 -0
  401. package/lib/client/MirrorNetwork.cjs +89 -0
  402. package/lib/client/MirrorNetwork.d.ts +27 -0
  403. package/lib/client/MirrorNetwork.js +2 -0
  404. package/lib/client/MirrorNetwork.js.map +1 -0
  405. package/lib/client/NativeClient.cjs +210 -0
  406. package/lib/client/NativeClient.d.ts +72 -0
  407. package/lib/client/NativeClient.js +2 -0
  408. package/lib/client/NativeClient.js.map +1 -0
  409. package/lib/client/Network.cjs +257 -0
  410. package/lib/client/Network.d.ts +90 -0
  411. package/lib/client/Network.js +2 -0
  412. package/lib/client/Network.js.map +1 -0
  413. package/lib/client/NodeClient.cjs +316 -0
  414. package/lib/client/NodeClient.d.ts +129 -0
  415. package/lib/client/NodeClient.js +2 -0
  416. package/lib/client/NodeClient.js.map +1 -0
  417. package/lib/client/WebClient.cjs +280 -0
  418. package/lib/client/WebClient.d.ts +90 -0
  419. package/lib/client/WebClient.js +2 -0
  420. package/lib/client/WebClient.js.map +1 -0
  421. package/lib/client/addressbooks/mainnet.cjs +7 -0
  422. package/lib/client/addressbooks/mainnet.d.ts +1 -0
  423. package/lib/client/addressbooks/mainnet.js +2 -0
  424. package/lib/client/addressbooks/mainnet.js.map +1 -0
  425. package/lib/client/addressbooks/previewnet.cjs +7 -0
  426. package/lib/client/addressbooks/previewnet.d.ts +1 -0
  427. package/lib/client/addressbooks/previewnet.js +2 -0
  428. package/lib/client/addressbooks/previewnet.js.map +1 -0
  429. package/lib/client/addressbooks/testnet.cjs +7 -0
  430. package/lib/client/addressbooks/testnet.d.ts +1 -0
  431. package/lib/client/addressbooks/testnet.js +2 -0
  432. package/lib/client/addressbooks/testnet.js.map +1 -0
  433. package/lib/constants/ClientConstants.cjs +201 -0
  434. package/lib/constants/ClientConstants.d.ts +74 -0
  435. package/lib/constants/ClientConstants.js +2 -0
  436. package/lib/constants/ClientConstants.js.map +1 -0
  437. package/lib/contract/ContractByteCodeQuery.cjs +158 -0
  438. package/lib/contract/ContractByteCodeQuery.d.ts +76 -0
  439. package/lib/contract/ContractByteCodeQuery.js +2 -0
  440. package/lib/contract/ContractByteCodeQuery.js.map +1 -0
  441. package/lib/contract/ContractCallQuery.cjs +338 -0
  442. package/lib/contract/ContractCallQuery.d.ts +141 -0
  443. package/lib/contract/ContractCallQuery.js +2 -0
  444. package/lib/contract/ContractCallQuery.js.map +1 -0
  445. package/lib/contract/ContractCreateFlow.cjs +452 -0
  446. package/lib/contract/ContractCreateFlow.d.ts +243 -0
  447. package/lib/contract/ContractCreateFlow.js +2 -0
  448. package/lib/contract/ContractCreateFlow.js.map +1 -0
  449. package/lib/contract/ContractCreateTransaction.cjs +556 -0
  450. package/lib/contract/ContractCreateTransaction.d.ts +315 -0
  451. package/lib/contract/ContractCreateTransaction.js +2 -0
  452. package/lib/contract/ContractCreateTransaction.js.map +1 -0
  453. package/lib/contract/ContractDeleteTransaction.cjs +235 -0
  454. package/lib/contract/ContractDeleteTransaction.d.ts +135 -0
  455. package/lib/contract/ContractDeleteTransaction.js +2 -0
  456. package/lib/contract/ContractDeleteTransaction.js.map +1 -0
  457. package/lib/contract/ContractExecuteTransaction.cjs +269 -0
  458. package/lib/contract/ContractExecuteTransaction.d.ts +164 -0
  459. package/lib/contract/ContractExecuteTransaction.js +2 -0
  460. package/lib/contract/ContractExecuteTransaction.js.map +1 -0
  461. package/lib/contract/ContractFunctionParameters.cjs +1703 -0
  462. package/lib/contract/ContractFunctionParameters.d.ts +725 -0
  463. package/lib/contract/ContractFunctionParameters.js +2 -0
  464. package/lib/contract/ContractFunctionParameters.js.map +1 -0
  465. package/lib/contract/ContractFunctionResult.cjs +846 -0
  466. package/lib/contract/ContractFunctionResult.d.ts +510 -0
  467. package/lib/contract/ContractFunctionResult.js +2 -0
  468. package/lib/contract/ContractFunctionResult.js.map +1 -0
  469. package/lib/contract/ContractFunctionSelector.cjs +1775 -0
  470. package/lib/contract/ContractFunctionSelector.d.ts +688 -0
  471. package/lib/contract/ContractFunctionSelector.js +2 -0
  472. package/lib/contract/ContractFunctionSelector.js.map +1 -0
  473. package/lib/contract/ContractId.cjs +267 -0
  474. package/lib/contract/ContractId.d.ts +123 -0
  475. package/lib/contract/ContractId.js +2 -0
  476. package/lib/contract/ContractId.js.map +1 -0
  477. package/lib/contract/ContractInfo.cjs +227 -0
  478. package/lib/contract/ContractInfo.d.ts +151 -0
  479. package/lib/contract/ContractInfo.js +2 -0
  480. package/lib/contract/ContractInfo.js.map +1 -0
  481. package/lib/contract/ContractInfoQuery.cjs +172 -0
  482. package/lib/contract/ContractInfoQuery.d.ts +70 -0
  483. package/lib/contract/ContractInfoQuery.js +2 -0
  484. package/lib/contract/ContractInfoQuery.js.map +1 -0
  485. package/lib/contract/ContractLogInfo.cjs +87 -0
  486. package/lib/contract/ContractLogInfo.d.ts +66 -0
  487. package/lib/contract/ContractLogInfo.js +2 -0
  488. package/lib/contract/ContractLogInfo.js.map +1 -0
  489. package/lib/contract/ContractNonceInfo.cjs +129 -0
  490. package/lib/contract/ContractNonceInfo.d.ts +90 -0
  491. package/lib/contract/ContractNonceInfo.js +2 -0
  492. package/lib/contract/ContractNonceInfo.js.map +1 -0
  493. package/lib/contract/ContractStateChange.cjs +75 -0
  494. package/lib/contract/ContractStateChange.d.ts +37 -0
  495. package/lib/contract/ContractUpdateTransaction.cjs +525 -0
  496. package/lib/contract/ContractUpdateTransaction.d.ts +280 -0
  497. package/lib/contract/ContractUpdateTransaction.js +2 -0
  498. package/lib/contract/ContractUpdateTransaction.js.map +1 -0
  499. package/lib/contract/DelegateContractId.cjs +100 -0
  500. package/lib/contract/DelegateContractId.d.ts +24 -0
  501. package/lib/contract/DelegateContractId.js +2 -0
  502. package/lib/contract/DelegateContractId.js.map +1 -0
  503. package/lib/contract/StorageChange.cjs +73 -0
  504. package/lib/contract/StorageChange.d.ts +37 -0
  505. package/lib/cryptography/keccak.cjs +335 -0
  506. package/lib/cryptography/keccak.d.ts +14 -0
  507. package/lib/cryptography/keccak.js +2 -0
  508. package/lib/cryptography/keccak.js.map +1 -0
  509. package/lib/cryptography/sha384.browser.cjs +19 -0
  510. package/lib/cryptography/sha384.browser.d.ts +5 -0
  511. package/lib/cryptography/sha384.browser.js +2 -0
  512. package/lib/cryptography/sha384.browser.js.map +1 -0
  513. package/lib/cryptography/sha384.cjs +27 -0
  514. package/lib/cryptography/sha384.d.ts +10 -0
  515. package/lib/cryptography/sha384.js +2 -0
  516. package/lib/cryptography/sha384.js.map +1 -0
  517. package/lib/cryptography/sha384.native.cjs +21 -0
  518. package/lib/cryptography/sha384.native.d.ts +5 -0
  519. package/lib/encoding/base64.native.cjs +25 -0
  520. package/lib/encoding/base64.native.d.ts +10 -0
  521. package/lib/encoding/base64.native.js +2 -0
  522. package/lib/encoding/base64.native.js.map +1 -0
  523. package/lib/encoding/hex.browser.cjs +95 -0
  524. package/lib/encoding/hex.browser.d.ts +26 -0
  525. package/lib/encoding/hex.browser.js +2 -0
  526. package/lib/encoding/hex.browser.js.map +1 -0
  527. package/lib/encoding/hex.cjs +82 -0
  528. package/lib/encoding/hex.d.ts +26 -0
  529. package/lib/encoding/hex.js +2 -0
  530. package/lib/encoding/hex.js.map +1 -0
  531. package/lib/encoding/hex.native.cjs +127 -0
  532. package/lib/encoding/hex.native.d.ts +36 -0
  533. package/lib/encoding/utf8.browser.cjs +26 -0
  534. package/lib/encoding/utf8.browser.d.ts +10 -0
  535. package/lib/encoding/utf8.browser.js +2 -0
  536. package/lib/encoding/utf8.browser.js.map +1 -0
  537. package/lib/encoding/utf8.cjs +24 -0
  538. package/lib/encoding/utf8.d.ts +10 -0
  539. package/lib/encoding/utf8.js +2 -0
  540. package/lib/encoding/utf8.js.map +1 -0
  541. package/lib/encoding/utf8.native.cjs +29 -0
  542. package/lib/encoding/utf8.native.d.ts +10 -0
  543. package/lib/exports.cjs +1264 -0
  544. package/lib/exports.d.ts +200 -0
  545. package/lib/exports.js +2 -0
  546. package/lib/exports.js.map +1 -0
  547. package/lib/file/FileAppendTransaction.cjs +482 -0
  548. package/lib/file/FileAppendTransaction.d.ts +196 -0
  549. package/lib/file/FileAppendTransaction.js +2 -0
  550. package/lib/file/FileAppendTransaction.js.map +1 -0
  551. package/lib/file/FileContentsQuery.cjs +159 -0
  552. package/lib/file/FileContentsQuery.d.ts +77 -0
  553. package/lib/file/FileContentsQuery.js +2 -0
  554. package/lib/file/FileContentsQuery.js.map +1 -0
  555. package/lib/file/FileCreateTransaction.cjs +259 -0
  556. package/lib/file/FileCreateTransaction.d.ts +153 -0
  557. package/lib/file/FileCreateTransaction.js +2 -0
  558. package/lib/file/FileCreateTransaction.js.map +1 -0
  559. package/lib/file/FileDeleteTransaction.cjs +149 -0
  560. package/lib/file/FileDeleteTransaction.d.ts +84 -0
  561. package/lib/file/FileDeleteTransaction.js +2 -0
  562. package/lib/file/FileDeleteTransaction.js.map +1 -0
  563. package/lib/file/FileId.cjs +240 -0
  564. package/lib/file/FileId.d.ts +126 -0
  565. package/lib/file/FileId.js +2 -0
  566. package/lib/file/FileId.js.map +1 -0
  567. package/lib/file/FileInfo.cjs +128 -0
  568. package/lib/file/FileInfo.d.ts +76 -0
  569. package/lib/file/FileInfo.js +2 -0
  570. package/lib/file/FileInfo.js.map +1 -0
  571. package/lib/file/FileInfoQuery.cjs +171 -0
  572. package/lib/file/FileInfoQuery.d.ts +68 -0
  573. package/lib/file/FileInfoQuery.js +2 -0
  574. package/lib/file/FileInfoQuery.js.map +1 -0
  575. package/lib/file/FileUpdateTransaction.cjs +319 -0
  576. package/lib/file/FileUpdateTransaction.d.ts +188 -0
  577. package/lib/file/FileUpdateTransaction.js +2 -0
  578. package/lib/file/FileUpdateTransaction.js.map +1 -0
  579. package/lib/grpc/GrpcServiceError.cjs +65 -0
  580. package/lib/grpc/GrpcServiceError.d.ts +32 -0
  581. package/lib/grpc/GrpcServiceError.js +2 -0
  582. package/lib/grpc/GrpcServiceError.js.map +1 -0
  583. package/lib/grpc/GrpcStatus.cjs +145 -0
  584. package/lib/grpc/GrpcStatus.d.ts +46 -0
  585. package/lib/grpc/GrpcStatus.js +2 -0
  586. package/lib/grpc/GrpcStatus.js.map +1 -0
  587. package/lib/http/HttpError.cjs +32 -0
  588. package/lib/http/HttpError.d.ts +14 -0
  589. package/lib/http/HttpError.js +2 -0
  590. package/lib/http/HttpError.js.map +1 -0
  591. package/lib/http/HttpStatus.cjs +44 -0
  592. package/lib/http/HttpStatus.d.ts +24 -0
  593. package/lib/http/HttpStatus.js +2 -0
  594. package/lib/http/HttpStatus.js.map +1 -0
  595. package/lib/index.cjs +44 -0
  596. package/lib/index.d.ts +4 -0
  597. package/lib/index.js +2 -0
  598. package/lib/index.js.map +1 -0
  599. package/lib/logger/LogLevel.cjs +77 -0
  600. package/lib/logger/LogLevel.d.ts +29 -0
  601. package/lib/logger/LogLevel.js +2 -0
  602. package/lib/logger/LogLevel.js.map +1 -0
  603. package/lib/logger/Logger.cjs +221 -0
  604. package/lib/logger/Logger.d.ts +132 -0
  605. package/lib/logger/Logger.js +2 -0
  606. package/lib/logger/Logger.js.map +1 -0
  607. package/lib/long.cjs +26 -0
  608. package/lib/long.d.ts +16 -0
  609. package/lib/long.js +2 -0
  610. package/lib/long.js.map +1 -0
  611. package/lib/native.cjs +36 -0
  612. package/lib/native.d.ts +3 -0
  613. package/lib/native.js +2 -0
  614. package/lib/native.js.map +1 -0
  615. package/lib/network/AddressBookQuery.cjs +218 -0
  616. package/lib/network/AddressBookQuery.d.ts +104 -0
  617. package/lib/network/AddressBookQuery.js +2 -0
  618. package/lib/network/AddressBookQuery.js.map +1 -0
  619. package/lib/network/AddressBookQueryWeb.cjs +326 -0
  620. package/lib/network/AddressBookQueryWeb.d.ts +165 -0
  621. package/lib/network/AddressBookQueryWeb.js +2 -0
  622. package/lib/network/AddressBookQueryWeb.js.map +1 -0
  623. package/lib/network/NetworkVersionInfo.cjs +81 -0
  624. package/lib/network/NetworkVersionInfo.d.ts +46 -0
  625. package/lib/network/NetworkVersionInfo.js +2 -0
  626. package/lib/network/NetworkVersionInfo.js.map +1 -0
  627. package/lib/network/NetworkVersionInfoQuery.cjs +112 -0
  628. package/lib/network/NetworkVersionInfoQuery.d.ts +50 -0
  629. package/lib/network/NetworkVersionInfoQuery.js +2 -0
  630. package/lib/network/NetworkVersionInfoQuery.js.map +1 -0
  631. package/lib/network/SemanticVersion.cjs +78 -0
  632. package/lib/network/SemanticVersion.d.ts +45 -0
  633. package/lib/network/SemanticVersion.js +2 -0
  634. package/lib/network/SemanticVersion.js.map +1 -0
  635. package/lib/node/NodeCreateTransaction.cjs +413 -0
  636. package/lib/node/NodeCreateTransaction.d.ts +239 -0
  637. package/lib/node/NodeCreateTransaction.js +2 -0
  638. package/lib/node/NodeCreateTransaction.js.map +1 -0
  639. package/lib/node/NodeDeleteTransaction.cjs +143 -0
  640. package/lib/node/NodeDeleteTransaction.d.ts +80 -0
  641. package/lib/node/NodeDeleteTransaction.js +2 -0
  642. package/lib/node/NodeDeleteTransaction.js.map +1 -0
  643. package/lib/node/NodeUpdateTransaction.cjs +481 -0
  644. package/lib/node/NodeUpdateTransaction.d.ts +274 -0
  645. package/lib/node/NodeUpdateTransaction.js +2 -0
  646. package/lib/node/NodeUpdateTransaction.js.map +1 -0
  647. package/lib/node/ServiceEndpoint.cjs +140 -0
  648. package/lib/node/ServiceEndpoint.d.ts +91 -0
  649. package/lib/node/ServiceEndpoint.js +2 -0
  650. package/lib/node/ServiceEndpoint.js.map +1 -0
  651. package/lib/query/CostQuery.cjs +171 -0
  652. package/lib/query/CostQuery.d.ts +43 -0
  653. package/lib/query/CostQuery.js +2 -0
  654. package/lib/query/CostQuery.js.map +1 -0
  655. package/lib/query/MirrorNodeContractCallQuery.cjs +53 -0
  656. package/lib/query/MirrorNodeContractCallQuery.d.ts +21 -0
  657. package/lib/query/MirrorNodeContractCallQuery.js +2 -0
  658. package/lib/query/MirrorNodeContractCallQuery.js.map +1 -0
  659. package/lib/query/MirrorNodeContractEstimateQuery.cjs +53 -0
  660. package/lib/query/MirrorNodeContractEstimateQuery.d.ts +21 -0
  661. package/lib/query/MirrorNodeContractEstimateQuery.js +2 -0
  662. package/lib/query/MirrorNodeContractEstimateQuery.js.map +1 -0
  663. package/lib/query/MirrorNodeContractQuery.cjs +260 -0
  664. package/lib/query/MirrorNodeContractQuery.d.ts +158 -0
  665. package/lib/query/MirrorNodeContractQuery.js +2 -0
  666. package/lib/query/MirrorNodeContractQuery.js.map +1 -0
  667. package/lib/query/Query.cjs +450 -0
  668. package/lib/query/Query.d.ts +173 -0
  669. package/lib/query/Query.js +2 -0
  670. package/lib/query/Query.js.map +1 -0
  671. package/lib/query/QueryBase.cjs +114 -0
  672. package/lib/query/QueryBase.d.ts +43 -0
  673. package/lib/query/QueryBase.js +2 -0
  674. package/lib/query/QueryBase.js.map +1 -0
  675. package/lib/schedule/ScheduleCreateTransaction.cjs +308 -0
  676. package/lib/schedule/ScheduleCreateTransaction.d.ts +153 -0
  677. package/lib/schedule/ScheduleCreateTransaction.js +2 -0
  678. package/lib/schedule/ScheduleCreateTransaction.js.map +1 -0
  679. package/lib/schedule/ScheduleDeleteTransaction.cjs +146 -0
  680. package/lib/schedule/ScheduleDeleteTransaction.d.ts +81 -0
  681. package/lib/schedule/ScheduleDeleteTransaction.js +2 -0
  682. package/lib/schedule/ScheduleDeleteTransaction.js.map +1 -0
  683. package/lib/schedule/ScheduleId.cjs +164 -0
  684. package/lib/schedule/ScheduleId.d.ts +96 -0
  685. package/lib/schedule/ScheduleId.js +2 -0
  686. package/lib/schedule/ScheduleId.js.map +1 -0
  687. package/lib/schedule/ScheduleInfo.cjs +176 -0
  688. package/lib/schedule/ScheduleInfo.d.ts +93 -0
  689. package/lib/schedule/ScheduleInfo.js +2 -0
  690. package/lib/schedule/ScheduleInfo.js.map +1 -0
  691. package/lib/schedule/ScheduleInfoQuery.cjs +170 -0
  692. package/lib/schedule/ScheduleInfoQuery.d.ts +66 -0
  693. package/lib/schedule/ScheduleInfoQuery.js +2 -0
  694. package/lib/schedule/ScheduleInfoQuery.js.map +1 -0
  695. package/lib/schedule/ScheduleSignTransaction.cjs +164 -0
  696. package/lib/schedule/ScheduleSignTransaction.d.ts +110 -0
  697. package/lib/schedule/ScheduleSignTransaction.js +2 -0
  698. package/lib/schedule/ScheduleSignTransaction.js.map +1 -0
  699. package/lib/system/FreezeTransaction.cjs +348 -0
  700. package/lib/system/FreezeTransaction.d.ts +188 -0
  701. package/lib/system/FreezeTransaction.js +2 -0
  702. package/lib/system/FreezeTransaction.js.map +1 -0
  703. package/lib/system/SystemDeleteTransaction.cjs +200 -0
  704. package/lib/system/SystemDeleteTransaction.d.ts +110 -0
  705. package/lib/system/SystemDeleteTransaction.js +2 -0
  706. package/lib/system/SystemDeleteTransaction.js.map +1 -0
  707. package/lib/system/SystemUndeleteTransaction.cjs +172 -0
  708. package/lib/system/SystemUndeleteTransaction.d.ts +97 -0
  709. package/lib/system/SystemUndeleteTransaction.js +2 -0
  710. package/lib/system/SystemUndeleteTransaction.js.map +1 -0
  711. package/lib/token/AbstractTokenTransferTransaction.cjs +406 -0
  712. package/lib/token/AbstractTokenTransferTransaction.d.ts +138 -0
  713. package/lib/token/AbstractTokenTransferTransaction.js +2 -0
  714. package/lib/token/AbstractTokenTransferTransaction.js.map +1 -0
  715. package/lib/token/AirdropPendingTransaction.cjs +65 -0
  716. package/lib/token/AirdropPendingTransaction.d.ts +35 -0
  717. package/lib/token/AirdropPendingTransaction.js +2 -0
  718. package/lib/token/AirdropPendingTransaction.js.map +1 -0
  719. package/lib/token/AssessedCustomFee.cjs +177 -0
  720. package/lib/token/AssessedCustomFee.d.ts +113 -0
  721. package/lib/token/AssessedCustomFee.js +2 -0
  722. package/lib/token/AssessedCustomFee.js.map +1 -0
  723. package/lib/token/CustomFee.cjs +88 -0
  724. package/lib/token/CustomFee.d.ts +57 -0
  725. package/lib/token/CustomFee.js +2 -0
  726. package/lib/token/CustomFee.js.map +1 -0
  727. package/lib/token/CustomFixedFee.cjs +155 -0
  728. package/lib/token/CustomFixedFee.d.ts +85 -0
  729. package/lib/token/CustomFixedFee.js +2 -0
  730. package/lib/token/CustomFixedFee.js.map +1 -0
  731. package/lib/token/CustomFractionalFee.cjs +200 -0
  732. package/lib/token/CustomFractionalFee.d.ts +103 -0
  733. package/lib/token/CustomFractionalFee.js +2 -0
  734. package/lib/token/CustomFractionalFee.js.map +1 -0
  735. package/lib/token/CustomRoyaltyFee.cjs +150 -0
  736. package/lib/token/CustomRoyaltyFee.d.ts +75 -0
  737. package/lib/token/CustomRoyaltyFee.js +2 -0
  738. package/lib/token/CustomRoyaltyFee.js.map +1 -0
  739. package/lib/token/FeeAssessmentMethod.cjs +58 -0
  740. package/lib/token/FeeAssessmentMethod.d.ts +29 -0
  741. package/lib/token/FeeAssessmentMethod.js +2 -0
  742. package/lib/token/FeeAssessmentMethod.js.map +1 -0
  743. package/lib/token/NftId.cjs +89 -0
  744. package/lib/token/NftId.d.ts +46 -0
  745. package/lib/token/NftId.js +2 -0
  746. package/lib/token/NftId.js.map +1 -0
  747. package/lib/token/PendingAirdropId.cjs +152 -0
  748. package/lib/token/PendingAirdropId.d.ts +81 -0
  749. package/lib/token/PendingAirdropId.js +2 -0
  750. package/lib/token/PendingAirdropId.js.map +1 -0
  751. package/lib/token/PendingAirdropRecord.cjs +55 -0
  752. package/lib/token/PendingAirdropRecord.d.ts +29 -0
  753. package/lib/token/PendingAirdropRecord.js +2 -0
  754. package/lib/token/PendingAirdropRecord.js.map +1 -0
  755. package/lib/token/TokenAirdropTransaction.cjs +179 -0
  756. package/lib/token/TokenAirdropTransaction.d.ts +119 -0
  757. package/lib/token/TokenAirdropTransaction.js +2 -0
  758. package/lib/token/TokenAirdropTransaction.js.map +1 -0
  759. package/lib/token/TokenAssociateTransaction.cjs +176 -0
  760. package/lib/token/TokenAssociateTransaction.d.ts +90 -0
  761. package/lib/token/TokenAssociateTransaction.js +2 -0
  762. package/lib/token/TokenAssociateTransaction.js.map +1 -0
  763. package/lib/token/TokenAssociation.cjs +117 -0
  764. package/lib/token/TokenAssociation.d.ts +76 -0
  765. package/lib/token/TokenAssociation.js +2 -0
  766. package/lib/token/TokenAssociation.js.map +1 -0
  767. package/lib/token/TokenBurnTransaction.cjs +199 -0
  768. package/lib/token/TokenBurnTransaction.d.ts +108 -0
  769. package/lib/token/TokenBurnTransaction.js +2 -0
  770. package/lib/token/TokenBurnTransaction.js.map +1 -0
  771. package/lib/token/TokenCancelAirdropTransaction.cjs +109 -0
  772. package/lib/token/TokenCancelAirdropTransaction.d.ts +50 -0
  773. package/lib/token/TokenCancelAirdropTransaction.js +2 -0
  774. package/lib/token/TokenCancelAirdropTransaction.js.map +1 -0
  775. package/lib/token/TokenClaimAirdropTransaction.cjs +109 -0
  776. package/lib/token/TokenClaimAirdropTransaction.d.ts +50 -0
  777. package/lib/token/TokenClaimAirdropTransaction.js +2 -0
  778. package/lib/token/TokenClaimAirdropTransaction.js.map +1 -0
  779. package/lib/token/TokenCreateTransaction.cjs +817 -0
  780. package/lib/token/TokenCreateTransaction.d.ts +446 -0
  781. package/lib/token/TokenCreateTransaction.js +2 -0
  782. package/lib/token/TokenCreateTransaction.js.map +1 -0
  783. package/lib/token/TokenDeleteTransaction.cjs +140 -0
  784. package/lib/token/TokenDeleteTransaction.d.ts +75 -0
  785. package/lib/token/TokenDeleteTransaction.js +2 -0
  786. package/lib/token/TokenDeleteTransaction.js.map +1 -0
  787. package/lib/token/TokenDissociateTransaction.cjs +176 -0
  788. package/lib/token/TokenDissociateTransaction.d.ts +90 -0
  789. package/lib/token/TokenDissociateTransaction.js +2 -0
  790. package/lib/token/TokenDissociateTransaction.js.map +1 -0
  791. package/lib/token/TokenFeeScheduleUpdateTransaction.cjs +172 -0
  792. package/lib/token/TokenFeeScheduleUpdateTransaction.d.ts +93 -0
  793. package/lib/token/TokenFeeScheduleUpdateTransaction.js +2 -0
  794. package/lib/token/TokenFeeScheduleUpdateTransaction.js.map +1 -0
  795. package/lib/token/TokenFreezeTransaction.cjs +172 -0
  796. package/lib/token/TokenFreezeTransaction.d.ts +90 -0
  797. package/lib/token/TokenFreezeTransaction.js +2 -0
  798. package/lib/token/TokenFreezeTransaction.js.map +1 -0
  799. package/lib/token/TokenGrantKycTransaction.cjs +172 -0
  800. package/lib/token/TokenGrantKycTransaction.d.ts +90 -0
  801. package/lib/token/TokenGrantKycTransaction.js +2 -0
  802. package/lib/token/TokenGrantKycTransaction.js.map +1 -0
  803. package/lib/token/TokenId.cjs +185 -0
  804. package/lib/token/TokenId.d.ts +103 -0
  805. package/lib/token/TokenId.js +2 -0
  806. package/lib/token/TokenId.js.map +1 -0
  807. package/lib/token/TokenInfo.cjs +349 -0
  808. package/lib/token/TokenInfo.d.ts +224 -0
  809. package/lib/token/TokenInfo.js +2 -0
  810. package/lib/token/TokenInfo.js.map +1 -0
  811. package/lib/token/TokenInfoQuery.cjs +170 -0
  812. package/lib/token/TokenInfoQuery.d.ts +67 -0
  813. package/lib/token/TokenInfoQuery.js +2 -0
  814. package/lib/token/TokenInfoQuery.js.map +1 -0
  815. package/lib/token/TokenKeyValidation.cjs +73 -0
  816. package/lib/token/TokenKeyValidation.d.ts +39 -0
  817. package/lib/token/TokenKeyValidation.js +2 -0
  818. package/lib/token/TokenKeyValidation.js.map +1 -0
  819. package/lib/token/TokenMintTransaction.cjs +219 -0
  820. package/lib/token/TokenMintTransaction.d.ts +113 -0
  821. package/lib/token/TokenMintTransaction.js +2 -0
  822. package/lib/token/TokenMintTransaction.js.map +1 -0
  823. package/lib/token/TokenNftInfo.cjs +127 -0
  824. package/lib/token/TokenNftInfo.d.ts +96 -0
  825. package/lib/token/TokenNftInfo.js +2 -0
  826. package/lib/token/TokenNftInfo.js.map +1 -0
  827. package/lib/token/TokenNftInfoQuery.cjs +312 -0
  828. package/lib/token/TokenNftInfoQuery.d.ts +149 -0
  829. package/lib/token/TokenNftInfoQuery.js +2 -0
  830. package/lib/token/TokenNftInfoQuery.js.map +1 -0
  831. package/lib/token/TokenNftTransfer.cjs +95 -0
  832. package/lib/token/TokenNftTransfer.d.ts +70 -0
  833. package/lib/token/TokenNftTransfer.js +2 -0
  834. package/lib/token/TokenNftTransfer.js.map +1 -0
  835. package/lib/token/TokenNftsUpdateTransaction.cjs +185 -0
  836. package/lib/token/TokenNftsUpdateTransaction.d.ts +97 -0
  837. package/lib/token/TokenPauseTransaction.cjs +140 -0
  838. package/lib/token/TokenPauseTransaction.d.ts +75 -0
  839. package/lib/token/TokenPauseTransaction.js +2 -0
  840. package/lib/token/TokenPauseTransaction.js.map +1 -0
  841. package/lib/token/TokenReference.cjs +41 -0
  842. package/lib/token/TokenReference.d.ts +29 -0
  843. package/lib/token/TokenReference.js +2 -0
  844. package/lib/token/TokenReference.js.map +1 -0
  845. package/lib/token/TokenRejectFlow.cjs +248 -0
  846. package/lib/token/TokenRejectFlow.d.ts +141 -0
  847. package/lib/token/TokenRejectFlow.js +2 -0
  848. package/lib/token/TokenRejectFlow.js.map +1 -0
  849. package/lib/token/TokenRejectTransaction.cjs +240 -0
  850. package/lib/token/TokenRejectTransaction.d.ts +120 -0
  851. package/lib/token/TokenRejectTransaction.js +2 -0
  852. package/lib/token/TokenRejectTransaction.js.map +1 -0
  853. package/lib/token/TokenRevokeKycTransaction.cjs +172 -0
  854. package/lib/token/TokenRevokeKycTransaction.d.ts +90 -0
  855. package/lib/token/TokenRevokeKycTransaction.js +2 -0
  856. package/lib/token/TokenRevokeKycTransaction.js.map +1 -0
  857. package/lib/token/TokenSupplyType.cjs +77 -0
  858. package/lib/token/TokenSupplyType.d.ts +38 -0
  859. package/lib/token/TokenSupplyType.js +2 -0
  860. package/lib/token/TokenSupplyType.js.map +1 -0
  861. package/lib/token/TokenTransfer.cjs +122 -0
  862. package/lib/token/TokenTransfer.d.ts +92 -0
  863. package/lib/token/TokenTransfer.js +2 -0
  864. package/lib/token/TokenTransfer.js.map +1 -0
  865. package/lib/token/TokenType.cjs +77 -0
  866. package/lib/token/TokenType.d.ts +38 -0
  867. package/lib/token/TokenType.js +2 -0
  868. package/lib/token/TokenType.js.map +1 -0
  869. package/lib/token/TokenUnfreezeTransaction.cjs +172 -0
  870. package/lib/token/TokenUnfreezeTransaction.d.ts +90 -0
  871. package/lib/token/TokenUnfreezeTransaction.js +2 -0
  872. package/lib/token/TokenUnfreezeTransaction.js.map +1 -0
  873. package/lib/token/TokenUnpauseTransaction.cjs +140 -0
  874. package/lib/token/TokenUnpauseTransaction.d.ts +75 -0
  875. package/lib/token/TokenUnpauseTransaction.js +2 -0
  876. package/lib/token/TokenUnpauseTransaction.js.map +1 -0
  877. package/lib/token/TokenUpdateNftsTransaction.cjs +189 -0
  878. package/lib/token/TokenUpdateNftsTransaction.d.ts +103 -0
  879. package/lib/token/TokenUpdateNftsTransaction.js +2 -0
  880. package/lib/token/TokenUpdateNftsTransaction.js.map +1 -0
  881. package/lib/token/TokenUpdateTransaction.cjs +672 -0
  882. package/lib/token/TokenUpdateTransaction.d.ts +366 -0
  883. package/lib/token/TokenUpdateTransaction.js +2 -0
  884. package/lib/token/TokenUpdateTransaction.js.map +1 -0
  885. package/lib/token/TokenWipeTransaction.cjs +231 -0
  886. package/lib/token/TokenWipeTransaction.d.ts +123 -0
  887. package/lib/token/TokenWipeTransaction.js +2 -0
  888. package/lib/token/TokenWipeTransaction.js.map +1 -0
  889. package/lib/topic/SubscriptionHandle.cjs +40 -0
  890. package/lib/topic/SubscriptionHandle.d.ts +22 -0
  891. package/lib/topic/SubscriptionHandle.js +2 -0
  892. package/lib/topic/SubscriptionHandle.js.map +1 -0
  893. package/lib/topic/TopicCreateTransaction.cjs +473 -0
  894. package/lib/topic/TopicCreateTransaction.d.ts +250 -0
  895. package/lib/topic/TopicCreateTransaction.js +2 -0
  896. package/lib/topic/TopicCreateTransaction.js.map +1 -0
  897. package/lib/topic/TopicDeleteTransaction.cjs +146 -0
  898. package/lib/topic/TopicDeleteTransaction.d.ts +80 -0
  899. package/lib/topic/TopicDeleteTransaction.js +2 -0
  900. package/lib/topic/TopicDeleteTransaction.js.map +1 -0
  901. package/lib/topic/TopicId.cjs +185 -0
  902. package/lib/topic/TopicId.d.ts +102 -0
  903. package/lib/topic/TopicId.js +2 -0
  904. package/lib/topic/TopicId.js.map +1 -0
  905. package/lib/topic/TopicInfo.cjs +187 -0
  906. package/lib/topic/TopicInfo.d.ts +119 -0
  907. package/lib/topic/TopicInfo.js +2 -0
  908. package/lib/topic/TopicInfo.js.map +1 -0
  909. package/lib/topic/TopicInfoQuery.cjs +174 -0
  910. package/lib/topic/TopicInfoQuery.d.ts +81 -0
  911. package/lib/topic/TopicInfoQuery.js +2 -0
  912. package/lib/topic/TopicInfoQuery.js.map +1 -0
  913. package/lib/topic/TopicMessage.cjs +116 -0
  914. package/lib/topic/TopicMessage.d.ts +65 -0
  915. package/lib/topic/TopicMessage.js +2 -0
  916. package/lib/topic/TopicMessage.js.map +1 -0
  917. package/lib/topic/TopicMessageChunk.cjs +71 -0
  918. package/lib/topic/TopicMessageChunk.d.ts +56 -0
  919. package/lib/topic/TopicMessageChunk.js +2 -0
  920. package/lib/topic/TopicMessageChunk.js.map +1 -0
  921. package/lib/topic/TopicMessageQuery.cjs +450 -0
  922. package/lib/topic/TopicMessageQuery.d.ts +220 -0
  923. package/lib/topic/TopicMessageQuery.js +2 -0
  924. package/lib/topic/TopicMessageQuery.js.map +1 -0
  925. package/lib/topic/TopicMessageSubmitTransaction.cjs +412 -0
  926. package/lib/topic/TopicMessageSubmitTransaction.d.ts +201 -0
  927. package/lib/topic/TopicMessageSubmitTransaction.js +2 -0
  928. package/lib/topic/TopicMessageSubmitTransaction.js.map +1 -0
  929. package/lib/topic/TopicUpdateTransaction.cjs +532 -0
  930. package/lib/topic/TopicUpdateTransaction.d.ts +284 -0
  931. package/lib/topic/TopicUpdateTransaction.js +2 -0
  932. package/lib/topic/TopicUpdateTransaction.js.map +1 -0
  933. package/lib/transaction/BatchTransaction.cjs +262 -0
  934. package/lib/transaction/BatchTransaction.d.ts +134 -0
  935. package/lib/transaction/BatchTransaction.js +2 -0
  936. package/lib/transaction/BatchTransaction.js.map +1 -0
  937. package/lib/transaction/CustomFeeLimit.cjs +116 -0
  938. package/lib/transaction/CustomFeeLimit.d.ts +64 -0
  939. package/lib/transaction/CustomFeeLimit.js +2 -0
  940. package/lib/transaction/CustomFeeLimit.js.map +1 -0
  941. package/lib/transaction/List.cjs +177 -0
  942. package/lib/transaction/List.d.ts +100 -0
  943. package/lib/transaction/List.js +2 -0
  944. package/lib/transaction/List.js.map +1 -0
  945. package/lib/transaction/NodeAccountIdSignatureMap.cjs +62 -0
  946. package/lib/transaction/NodeAccountIdSignatureMap.d.ts +23 -0
  947. package/lib/transaction/NodeAccountIdSignatureMap.js +2 -0
  948. package/lib/transaction/NodeAccountIdSignatureMap.js.map +1 -0
  949. package/lib/transaction/NodeAccountIdSignatureMapLegacy.cjs +39 -0
  950. package/lib/transaction/NodeAccountIdSignatureMapLegacy.d.ts +14 -0
  951. package/lib/transaction/NodeAccountIdSignatureMapLegacy.js +2 -0
  952. package/lib/transaction/NodeAccountIdSignatureMapLegacy.js.map +1 -0
  953. package/lib/transaction/SignableNodeTransactionBodyBytes.cjs +47 -0
  954. package/lib/transaction/SignableNodeTransactionBodyBytes.d.ts +38 -0
  955. package/lib/transaction/SignableNodeTransactionBodyBytes.js +2 -0
  956. package/lib/transaction/SignableNodeTransactionBodyBytes.js.map +1 -0
  957. package/lib/transaction/SignatureMap.cjs +95 -0
  958. package/lib/transaction/SignatureMap.d.ts +42 -0
  959. package/lib/transaction/SignatureMap.js +2 -0
  960. package/lib/transaction/SignatureMap.js.map +1 -0
  961. package/lib/transaction/SignatureMapLegacy.cjs +37 -0
  962. package/lib/transaction/SignatureMapLegacy.d.ts +15 -0
  963. package/lib/transaction/SignatureMapLegacy.js +2 -0
  964. package/lib/transaction/SignatureMapLegacy.js.map +1 -0
  965. package/lib/transaction/SignaturePairMap.cjs +50 -0
  966. package/lib/transaction/SignaturePairMap.d.ts +21 -0
  967. package/lib/transaction/SignaturePairMap.js +2 -0
  968. package/lib/transaction/SignaturePairMap.js.map +1 -0
  969. package/lib/transaction/TokenTransfer.cjs +2 -0
  970. package/lib/transaction/TokenTransfer.d.ts +0 -0
  971. package/lib/transaction/Transaction.cjs +1959 -0
  972. package/lib/transaction/Transaction.d.ts +698 -0
  973. package/lib/transaction/Transaction.js +2 -0
  974. package/lib/transaction/Transaction.js.map +1 -0
  975. package/lib/transaction/TransactionHashMap.cjs +44 -0
  976. package/lib/transaction/TransactionHashMap.d.ts +22 -0
  977. package/lib/transaction/TransactionHashMap.js +2 -0
  978. package/lib/transaction/TransactionHashMap.js.map +1 -0
  979. package/lib/transaction/TransactionId.cjs +224 -0
  980. package/lib/transaction/TransactionId.d.ts +122 -0
  981. package/lib/transaction/TransactionId.js +2 -0
  982. package/lib/transaction/TransactionId.js.map +1 -0
  983. package/lib/transaction/TransactionReceipt.cjs +303 -0
  984. package/lib/transaction/TransactionReceipt.d.ts +202 -0
  985. package/lib/transaction/TransactionReceipt.js +2 -0
  986. package/lib/transaction/TransactionReceipt.js.map +1 -0
  987. package/lib/transaction/TransactionReceiptQuery.cjs +347 -0
  988. package/lib/transaction/TransactionReceiptQuery.d.ts +96 -0
  989. package/lib/transaction/TransactionReceiptQuery.js +2 -0
  990. package/lib/transaction/TransactionReceiptQuery.js.map +1 -0
  991. package/lib/transaction/TransactionRecord.cjs +470 -0
  992. package/lib/transaction/TransactionRecord.d.ts +317 -0
  993. package/lib/transaction/TransactionRecord.js +2 -0
  994. package/lib/transaction/TransactionRecord.js.map +1 -0
  995. package/lib/transaction/TransactionRecordQuery.cjs +366 -0
  996. package/lib/transaction/TransactionRecordQuery.d.ts +99 -0
  997. package/lib/transaction/TransactionRecordQuery.js +2 -0
  998. package/lib/transaction/TransactionRecordQuery.js.map +1 -0
  999. package/lib/transaction/TransactionResponse.cjs +242 -0
  1000. package/lib/transaction/TransactionResponse.d.ts +119 -0
  1001. package/lib/transaction/TransactionResponse.js +2 -0
  1002. package/lib/transaction/TransactionResponse.js.map +1 -0
  1003. package/lib/util/ASN1-Decoder.cjs +276 -0
  1004. package/lib/util/ASN1-Decoder.d.ts +104 -0
  1005. package/lib/util/ASN1-Decoder.js +2 -0
  1006. package/lib/util/ASN1-Decoder.js.map +1 -0
  1007. package/lib/util.cjs +464 -0
  1008. package/lib/util.d.ts +210 -0
  1009. package/lib/util.js +2 -0
  1010. package/lib/util.js.map +1 -0
  1011. package/lib/version.cjs +8 -0
  1012. package/lib/version.d.ts +2 -0
  1013. package/lib/version.js +2 -0
  1014. package/lib/version.js.map +1 -0
  1015. package/package.json +139 -0
  1016. package/src/BadEntityIdError.js +24 -0
  1017. package/src/Cache.js +418 -0
  1018. package/src/Duration.js +48 -0
  1019. package/src/EntityIdHelper.js +620 -0
  1020. package/src/EthereumFlow.js +244 -0
  1021. package/src/EthereumTransaction.js +298 -0
  1022. package/src/EthereumTransactionData.js +60 -0
  1023. package/src/EthereumTransactionDataEip1559.js +146 -0
  1024. package/src/EthereumTransactionDataEip2930.js +140 -0
  1025. package/src/EthereumTransactionDataLegacy.js +121 -0
  1026. package/src/EvmAddress.js +78 -0
  1027. package/src/ExchangeRate.js +117 -0
  1028. package/src/ExchangeRates.js +71 -0
  1029. package/src/Executable.js +884 -0
  1030. package/src/FeeComponents.js +199 -0
  1031. package/src/FeeData.js +127 -0
  1032. package/src/FeeDataType.js +125 -0
  1033. package/src/FeeSchedule.js +88 -0
  1034. package/src/FeeSchedules.js +82 -0
  1035. package/src/FreezeType.js +113 -0
  1036. package/src/Hbar.js +147 -0
  1037. package/src/HbarUnit.js +90 -0
  1038. package/src/Key.js +60 -0
  1039. package/src/KeyList.js +179 -0
  1040. package/src/LedgerId.js +134 -0
  1041. package/src/LocalProvider.js +165 -0
  1042. package/src/ManagedNode.js +269 -0
  1043. package/src/ManagedNodeAddress.js +101 -0
  1044. package/src/MaxAttemptsOrTimeoutError.js +42 -0
  1045. package/src/MaxQueryPaymentExceeded.js +28 -0
  1046. package/src/MirrorNode.js +41 -0
  1047. package/src/Mnemonic.js +250 -0
  1048. package/src/Node.js +106 -0
  1049. package/src/ObjectMap.js +137 -0
  1050. package/src/PrecheckStatusError.js +73 -0
  1051. package/src/PrivateKey.js +547 -0
  1052. package/src/PrngTransaction.js +152 -0
  1053. package/src/Provider.js +40 -0
  1054. package/src/PublicKey.js +294 -0
  1055. package/src/ReceiptStatusError.js +41 -0
  1056. package/src/RecordStatusError.js +30 -0
  1057. package/src/RequestType.js +920 -0
  1058. package/src/Signer.js +46 -0
  1059. package/src/SignerSignature.js +27 -0
  1060. package/src/StakingInfo.js +187 -0
  1061. package/src/Status.js +3353 -0
  1062. package/src/StatusError.js +64 -0
  1063. package/src/Timestamp.js +160 -0
  1064. package/src/TransactionFeeSchedule.js +100 -0
  1065. package/src/Transfer.js +113 -0
  1066. package/src/Wallet.js +300 -0
  1067. package/src/account/AccountAllowanceAdjustTransaction.js +540 -0
  1068. package/src/account/AccountAllowanceApproveTransaction.js +569 -0
  1069. package/src/account/AccountAllowanceDeleteTransaction.js +199 -0
  1070. package/src/account/AccountBalance.js +160 -0
  1071. package/src/account/AccountBalanceQuery.js +238 -0
  1072. package/src/account/AccountCreateTransaction.js +674 -0
  1073. package/src/account/AccountDeleteTransaction.js +221 -0
  1074. package/src/account/AccountId.js +486 -0
  1075. package/src/account/AccountInfo.js +433 -0
  1076. package/src/account/AccountInfoFlow.js +106 -0
  1077. package/src/account/AccountInfoQuery.js +187 -0
  1078. package/src/account/AccountRecordsQuery.js +186 -0
  1079. package/src/account/AccountUpdateTransaction.js +634 -0
  1080. package/src/account/HbarAllowance.js +147 -0
  1081. package/src/account/HbarTransferMap.js +48 -0
  1082. package/src/account/LiveHash.js +79 -0
  1083. package/src/account/LiveHashAddTransaction.js +289 -0
  1084. package/src/account/LiveHashDeleteTransaction.js +196 -0
  1085. package/src/account/LiveHashQuery.js +209 -0
  1086. package/src/account/NullableTokenDecimalMap.js +19 -0
  1087. package/src/account/ProxyStaker.js +74 -0
  1088. package/src/account/TokenAllowance.js +152 -0
  1089. package/src/account/TokenBalanceMap.js +23 -0
  1090. package/src/account/TokenDecimalMap.js +19 -0
  1091. package/src/account/TokenNftAllowance.js +217 -0
  1092. package/src/account/TokenNftTransferMap.js +134 -0
  1093. package/src/account/TokenRelationship.js +125 -0
  1094. package/src/account/TokenRelationshipMap.js +59 -0
  1095. package/src/account/TokenTransferAccountMap.js +24 -0
  1096. package/src/account/TokenTransferMap.js +99 -0
  1097. package/src/account/TransferTransaction.js +372 -0
  1098. package/src/address_book/AddressBooks.js +27 -0
  1099. package/src/address_book/Endpoint.js +141 -0
  1100. package/src/address_book/IPv4Address.js +125 -0
  1101. package/src/address_book/IPv4AddressPart.js +71 -0
  1102. package/src/address_book/NodeAddress.js +319 -0
  1103. package/src/address_book/NodeAddressBook.js +114 -0
  1104. package/src/array.js +60 -0
  1105. package/src/base32.js +29 -0
  1106. package/src/browser.js +10 -0
  1107. package/src/channel/Channel.js +340 -0
  1108. package/src/channel/MirrorChannel.js +49 -0
  1109. package/src/channel/NativeChannel.js +120 -0
  1110. package/src/channel/NodeChannel.js +196 -0
  1111. package/src/channel/NodeMirrorChannel.js +91 -0
  1112. package/src/channel/WebChannel.js +100 -0
  1113. package/src/client/Client.js +871 -0
  1114. package/src/client/ManagedNetwork.js +473 -0
  1115. package/src/client/MirrorNetwork.js +87 -0
  1116. package/src/client/NativeClient.js +218 -0
  1117. package/src/client/Network.js +304 -0
  1118. package/src/client/NodeClient.js +321 -0
  1119. package/src/client/WebClient.js +302 -0
  1120. package/src/client/addressbooks/mainnet.js +2 -0
  1121. package/src/client/addressbooks/previewnet.js +2 -0
  1122. package/src/client/addressbooks/testnet.js +2 -0
  1123. package/src/constants/ClientConstants.js +204 -0
  1124. package/src/contract/ContractByteCodeQuery.js +178 -0
  1125. package/src/contract/ContractCallQuery.js +382 -0
  1126. package/src/contract/ContractCreateFlow.js +551 -0
  1127. package/src/contract/ContractCreateTransaction.js +677 -0
  1128. package/src/contract/ContractDeleteTransaction.js +291 -0
  1129. package/src/contract/ContractExecuteTransaction.js +313 -0
  1130. package/src/contract/ContractFunctionParameters.js +1759 -0
  1131. package/src/contract/ContractFunctionResult.js +1060 -0
  1132. package/src/contract/ContractFunctionSelector.js +1360 -0
  1133. package/src/contract/ContractId.js +316 -0
  1134. package/src/contract/ContractInfo.js +264 -0
  1135. package/src/contract/ContractInfoQuery.js +190 -0
  1136. package/src/contract/ContractLogInfo.js +83 -0
  1137. package/src/contract/ContractNonceInfo.js +129 -0
  1138. package/src/contract/ContractStateChange.js +77 -0
  1139. package/src/contract/ContractUpdateTransaction.js +665 -0
  1140. package/src/contract/DelegateContractId.js +94 -0
  1141. package/src/contract/StorageChange.js +71 -0
  1142. package/src/cryptography/keccak.js +419 -0
  1143. package/src/cryptography/sha384.browser.js +13 -0
  1144. package/src/cryptography/sha384.js +20 -0
  1145. package/src/cryptography/sha384.native.js +19 -0
  1146. package/src/encoding/base64.native.js +19 -0
  1147. package/src/encoding/hex.browser.js +95 -0
  1148. package/src/encoding/hex.js +76 -0
  1149. package/src/encoding/hex.native.js +386 -0
  1150. package/src/encoding/utf8.browser.js +19 -0
  1151. package/src/encoding/utf8.js +17 -0
  1152. package/src/encoding/utf8.native.js +20 -0
  1153. package/src/exports.js +213 -0
  1154. package/src/file/FileAppendTransaction.js +586 -0
  1155. package/src/file/FileContentsQuery.js +174 -0
  1156. package/src/file/FileCreateTransaction.js +301 -0
  1157. package/src/file/FileDeleteTransaction.js +167 -0
  1158. package/src/file/FileId.js +247 -0
  1159. package/src/file/FileInfo.js +136 -0
  1160. package/src/file/FileInfoQuery.js +186 -0
  1161. package/src/file/FileUpdateTransaction.js +375 -0
  1162. package/src/grpc/GrpcServiceError.js +64 -0
  1163. package/src/grpc/GrpcStatus.js +142 -0
  1164. package/src/http/HttpError.js +26 -0
  1165. package/src/http/HttpStatus.js +38 -0
  1166. package/src/index.js +11 -0
  1167. package/src/logger/LogLevel.js +72 -0
  1168. package/src/logger/Logger.js +225 -0
  1169. package/src/long.js +20 -0
  1170. package/src/native.js +10 -0
  1171. package/src/network/AddressBookQuery.js +272 -0
  1172. package/src/network/AddressBookQueryWeb.js +388 -0
  1173. package/src/network/NetworkVersionInfo.js +81 -0
  1174. package/src/network/NetworkVersionInfoQuery.js +117 -0
  1175. package/src/network/SemanticVersion.js +74 -0
  1176. package/src/node/NodeCreateTransaction.js +513 -0
  1177. package/src/node/NodeDeleteTransaction.js +161 -0
  1178. package/src/node/NodeUpdateTransaction.js +592 -0
  1179. package/src/node/ServiceEndpoint.js +145 -0
  1180. package/src/query/CostQuery.js +187 -0
  1181. package/src/query/MirrorNodeContractCallQuery.js +49 -0
  1182. package/src/query/MirrorNodeContractEstimateQuery.js +48 -0
  1183. package/src/query/MirrorNodeContractQuery.js +266 -0
  1184. package/src/query/Query.js +527 -0
  1185. package/src/query/QueryBase.js +116 -0
  1186. package/src/schedule/ScheduleCreateTransaction.js +371 -0
  1187. package/src/schedule/ScheduleDeleteTransaction.js +174 -0
  1188. package/src/schedule/ScheduleId.js +173 -0
  1189. package/src/schedule/ScheduleInfo.js +243 -0
  1190. package/src/schedule/ScheduleInfoQuery.js +189 -0
  1191. package/src/schedule/ScheduleSignTransaction.js +189 -0
  1192. package/src/system/FreezeTransaction.js +390 -0
  1193. package/src/system/SystemDeleteTransaction.js +239 -0
  1194. package/src/system/SystemUndeleteTransaction.js +207 -0
  1195. package/src/token/AbstractTokenTransferTransaction.js +589 -0
  1196. package/src/token/AirdropPendingTransaction.js +58 -0
  1197. package/src/token/AssessedCustomFee.js +198 -0
  1198. package/src/token/CustomFee.js +87 -0
  1199. package/src/token/CustomFixedFee.js +178 -0
  1200. package/src/token/CustomFractionalFee.js +226 -0
  1201. package/src/token/CustomRoyaltyFee.js +173 -0
  1202. package/src/token/FeeAssessmentMethod.js +53 -0
  1203. package/src/token/NftId.js +95 -0
  1204. package/src/token/PendingAirdropId.js +157 -0
  1205. package/src/token/PendingAirdropRecord.js +50 -0
  1206. package/src/token/TokenAirdropTransaction.js +220 -0
  1207. package/src/token/TokenAssociateTransaction.js +214 -0
  1208. package/src/token/TokenAssociation.js +127 -0
  1209. package/src/token/TokenBurnTransaction.js +229 -0
  1210. package/src/token/TokenCancelAirdropTransaction.js +120 -0
  1211. package/src/token/TokenClaimAirdropTransaction.js +121 -0
  1212. package/src/token/TokenCreateTransaction.js +978 -0
  1213. package/src/token/TokenDeleteTransaction.js +161 -0
  1214. package/src/token/TokenDissociateTransaction.js +214 -0
  1215. package/src/token/TokenFeeScheduleUpdateTransaction.js +198 -0
  1216. package/src/token/TokenFreezeTransaction.js +203 -0
  1217. package/src/token/TokenGrantKycTransaction.js +203 -0
  1218. package/src/token/TokenId.js +203 -0
  1219. package/src/token/TokenInfo.js +454 -0
  1220. package/src/token/TokenInfoQuery.js +185 -0
  1221. package/src/token/TokenKeyValidation.js +70 -0
  1222. package/src/token/TokenMintTransaction.js +258 -0
  1223. package/src/token/TokenNftInfo.js +135 -0
  1224. package/src/token/TokenNftInfoQuery.js +369 -0
  1225. package/src/token/TokenNftTransfer.js +115 -0
  1226. package/src/token/TokenNftsUpdateTransaction.js +220 -0
  1227. package/src/token/TokenPauseTransaction.js +161 -0
  1228. package/src/token/TokenReference.js +40 -0
  1229. package/src/token/TokenRejectFlow.js +261 -0
  1230. package/src/token/TokenRejectTransaction.js +262 -0
  1231. package/src/token/TokenRevokeKycTransaction.js +203 -0
  1232. package/src/token/TokenSupplyType.js +74 -0
  1233. package/src/token/TokenTransfer.js +142 -0
  1234. package/src/token/TokenType.js +74 -0
  1235. package/src/token/TokenUnfreezeTransaction.js +203 -0
  1236. package/src/token/TokenUnpauseTransaction.js +161 -0
  1237. package/src/token/TokenUpdateNftsTransaction.js +225 -0
  1238. package/src/token/TokenUpdateTransaction.js +827 -0
  1239. package/src/token/TokenWipeTransaction.js +271 -0
  1240. package/src/topic/SubscriptionHandle.js +34 -0
  1241. package/src/topic/TopicCreateTransaction.js +557 -0
  1242. package/src/topic/TopicDeleteTransaction.js +167 -0
  1243. package/src/topic/TopicId.js +204 -0
  1244. package/src/topic/TopicInfo.js +254 -0
  1245. package/src/topic/TopicInfoQuery.js +190 -0
  1246. package/src/topic/TopicMessage.js +170 -0
  1247. package/src/topic/TopicMessageChunk.js +76 -0
  1248. package/src/topic/TopicMessageQuery.js +523 -0
  1249. package/src/topic/TopicMessageSubmitTransaction.js +488 -0
  1250. package/src/topic/TopicUpdateTransaction.js +659 -0
  1251. package/src/transaction/BatchTransaction.js +293 -0
  1252. package/src/transaction/CustomFeeLimit.js +121 -0
  1253. package/src/transaction/List.js +175 -0
  1254. package/src/transaction/NodeAccountIdSignatureMap.js +62 -0
  1255. package/src/transaction/NodeAccountIdSignatureMapLegacy.js +41 -0
  1256. package/src/transaction/SignableNodeTransactionBodyBytes.js +40 -0
  1257. package/src/transaction/SignatureMap.js +104 -0
  1258. package/src/transaction/SignatureMapLegacy.js +37 -0
  1259. package/src/transaction/SignaturePairMap.js +53 -0
  1260. package/src/transaction/TokenTransfer.js +1 -0
  1261. package/src/transaction/Transaction.js +2295 -0
  1262. package/src/transaction/TransactionHashMap.js +41 -0
  1263. package/src/transaction/TransactionId.js +262 -0
  1264. package/src/transaction/TransactionReceipt.js +414 -0
  1265. package/src/transaction/TransactionReceiptQuery.js +418 -0
  1266. package/src/transaction/TransactionRecord.js +638 -0
  1267. package/src/transaction/TransactionRecordQuery.js +440 -0
  1268. package/src/transaction/TransactionResponse.js +283 -0
  1269. package/src/types.d.ts +5 -0
  1270. package/src/util/ASN1-Decoder.js +256 -0
  1271. package/src/util.js +479 -0
  1272. package/src/version.js +3 -0
@@ -0,0 +1,365 @@
1
+ export type ExecutionState = string;
2
+ export namespace ExecutionState {
3
+ let Finished: string;
4
+ let Retry: string;
5
+ let Error: string;
6
+ }
7
+ export const RST_STREAM: RegExp;
8
+ export const DEFAULT_MAX_ATTEMPTS: 10;
9
+ /**
10
+ * @abstract
11
+ * @internal
12
+ * @template RequestT
13
+ * @template ResponseT
14
+ * @template OutputT
15
+ */
16
+ export default class Executable<RequestT, ResponseT, OutputT> {
17
+ /**
18
+ * The number of times we can retry the grpc call
19
+ *
20
+ * @internal
21
+ * @type {number}
22
+ */
23
+ _maxAttempts: number;
24
+ /**
25
+ * List of node account IDs for each transaction that has been
26
+ * built.
27
+ *
28
+ * @internal
29
+ * @type {List<AccountId>}
30
+ */
31
+ _nodeAccountIds: List<AccountId>;
32
+ /**
33
+ * List of the transaction node account IDs to check if
34
+ * the node account ID of the request is in the list
35
+ *
36
+ * @protected
37
+ * @type {Array<string>}
38
+ */
39
+ protected transactionNodeIds: Array<string>;
40
+ /**
41
+ * @internal
42
+ */
43
+ _signOnDemand: boolean;
44
+ /**
45
+ * This is the request's min backoff
46
+ *
47
+ * @internal
48
+ * @type {number | null}
49
+ */
50
+ _minBackoff: number | null;
51
+ /**
52
+ * This is the request's max backoff
53
+ *
54
+ * @internal
55
+ * @type {number}
56
+ */
57
+ _maxBackoff: number;
58
+ /**
59
+ * The operator that was used to execute this request.
60
+ * The reason we save the operator in the request is because of the signing on
61
+ * demand feature. This feature requires us to sign new request on each attempt
62
+ * meaning if a client with an operator was used we'd need to sign with the operator
63
+ * on each attempt.
64
+ *
65
+ * @internal
66
+ * @type {ClientOperator | null}
67
+ */
68
+ _operator: ClientOperator | null;
69
+ /**
70
+ * The complete timeout for running the `execute()` method
71
+ *
72
+ * @internal
73
+ * @type {number | null}
74
+ */
75
+ _requestTimeout: number | null;
76
+ /**
77
+ * The grpc request timeout aka deadline.
78
+ *
79
+ * The reason we have this is because there were times that consensus nodes held the grpc
80
+ * connection, but didn't return anything; not error nor regular response. This resulted
81
+ * in some weird behavior in the SDKs. To fix this we've added a grpc deadline to prevent
82
+ * nodes from stalling the executing of a request.
83
+ *
84
+ * @internal
85
+ * @type {number | null}
86
+ */
87
+ _grpcDeadline: number | null;
88
+ /**
89
+ * Logger
90
+ *
91
+ * @protected
92
+ * @type {Logger | null}
93
+ */
94
+ protected _logger: Logger | null;
95
+ /**
96
+ * Get the list of node account IDs on the request. If no nodes are set, then null is returned.
97
+ * The reasoning for this is simply "legacy behavior".
98
+ *
99
+ * @returns {?AccountId[]}
100
+ */
101
+ get nodeAccountIds(): AccountId[] | null;
102
+ /**
103
+ * Set the node account IDs on the request
104
+ *
105
+ * @param {AccountId[]} nodeIds
106
+ * @returns {this}
107
+ */
108
+ setNodeAccountIds(nodeIds: AccountId[]): this;
109
+ /**
110
+ * @deprecated
111
+ * @returns {number}
112
+ */
113
+ get maxRetries(): number;
114
+ /**
115
+ * @param {number} maxRetries
116
+ * @returns {this}
117
+ */
118
+ setMaxRetries(maxRetries: number): this;
119
+ /**
120
+ * Get the max attempts on the request
121
+ *
122
+ * @returns {number}
123
+ */
124
+ get maxAttempts(): number;
125
+ /**
126
+ * Set the max attempts on the request
127
+ *
128
+ * @param {number} maxAttempts
129
+ * @returns {this}
130
+ */
131
+ setMaxAttempts(maxAttempts: number): this;
132
+ /**
133
+ * Get the grpc deadline
134
+ *
135
+ * @returns {?number}
136
+ */
137
+ get grpcDeadline(): number | null;
138
+ /**
139
+ * Set the grpc deadline
140
+ *
141
+ * @param {number} grpcDeadline
142
+ * @returns {this}
143
+ */
144
+ setGrpcDeadline(grpcDeadline: number): this;
145
+ /**
146
+ * Set the min backoff for the request
147
+ *
148
+ * @param {number} minBackoff
149
+ * @returns {this}
150
+ */
151
+ setMinBackoff(minBackoff: number): this;
152
+ /**
153
+ * Get the min backoff
154
+ *
155
+ * @returns {number | null}
156
+ */
157
+ get minBackoff(): number | null;
158
+ /**
159
+ * Set the max backoff for the request
160
+ *
161
+ * @param {?number} maxBackoff
162
+ * @returns {this}
163
+ */
164
+ setMaxBackoff(maxBackoff: number | null): this;
165
+ /**
166
+ * Get the max backoff
167
+ *
168
+ * @returns {number}
169
+ */
170
+ get maxBackoff(): number;
171
+ /**
172
+ * This method is responsible for doing any work before the executing process begins.
173
+ * For paid queries this will result in executing a cost query, for transactions this
174
+ * will make sure we save the operator and sign any requests that need to be signed
175
+ * in case signing on demand is disabled.
176
+ *
177
+ * @abstract
178
+ * @protected
179
+ * @param {import("./client/Client.js").default<Channel, *>} client
180
+ * @returns {Promise<void>}
181
+ */
182
+ protected _beforeExecute(client: import("./client/Client.js").default<Channel, any>): Promise<void>;
183
+ /**
184
+ * Create a protobuf request which will be passed into the `_execute()` method
185
+ *
186
+ * @abstract
187
+ * @protected
188
+ * @returns {Promise<RequestT>}
189
+ */
190
+ protected _makeRequestAsync(): Promise<RequestT>;
191
+ /**
192
+ * This name is a bit wrong now, but the purpose of this method is to map the
193
+ * request and response into an error. This method will only be called when
194
+ * `_shouldRetry` returned `ExecutionState.Error`
195
+ *
196
+ * @abstract
197
+ * @internal
198
+ * @param {RequestT} request
199
+ * @param {ResponseT} response
200
+ * @param {AccountId} nodeId
201
+ * @returns {Error}
202
+ */
203
+ _mapStatusError(request: RequestT, response: ResponseT, nodeId: AccountId): Error;
204
+ /**
205
+ * Map the request, response, and the node account ID used for this attempt into a response.
206
+ * This method will only be called when `_shouldRetry` returned `ExecutionState.Finished`
207
+ *
208
+ * @abstract
209
+ * @protected
210
+ * @param {ResponseT} response
211
+ * @param {AccountId} nodeAccountId
212
+ * @param {RequestT} request
213
+ * @returns {Promise<OutputT>}
214
+ */
215
+ protected _mapResponse(response: ResponseT, nodeAccountId: AccountId, request: RequestT): Promise<OutputT>;
216
+ /**
217
+ * Perform a single grpc call with the given request. Each request has it's own
218
+ * required service so we just pass in channel, and it'$ the request's responsiblity
219
+ * to use the right service and call the right grpc method.
220
+ *
221
+ * @abstract
222
+ * @internal
223
+ * @param {Channel} channel
224
+ * @param {RequestT} request
225
+ * @returns {Promise<ResponseT>}
226
+ */
227
+ _execute(channel: Channel, request: RequestT): Promise<ResponseT>;
228
+ /**
229
+ * Return the current transaction ID for the request. All requests which are
230
+ * use the same transaction ID for each node, but the catch is that `Transaction`
231
+ * implicitly supports chunked transactions. Meaning there could be multiple
232
+ * transaction IDs stored in the request, and a different transaction ID will be used
233
+ * on subsequent calls to `execute()`
234
+ *
235
+ * FIXME: This method can most likely be removed, although some further inspection
236
+ * is required.
237
+ *
238
+ * @abstract
239
+ * @protected
240
+ * @returns {TransactionId}
241
+ */
242
+ protected _getTransactionId(): TransactionId;
243
+ /**
244
+ * Return the log ID for this particular request
245
+ *
246
+ * Log IDs are simply a string constructed to make it easy to track each request's
247
+ * execution even when mulitple requests are executing in parallel. Typically, this
248
+ * method returns the format of `[<request type>.<timestamp of the transaction ID>]`
249
+ *
250
+ * Maybe we should deduplicate this using ${this.consturtor.name}
251
+ *
252
+ * @abstract
253
+ * @internal
254
+ * @returns {string}
255
+ */
256
+ _getLogId(): string;
257
+ /**
258
+ * Serialize the request into bytes
259
+ *
260
+ * @abstract
261
+ * @param {RequestT} request
262
+ * @returns {Uint8Array}
263
+ */
264
+ _requestToBytes(request: RequestT): Uint8Array;
265
+ /**
266
+ * Serialize the response into bytes
267
+ *
268
+ * @abstract
269
+ * @param {ResponseT} response
270
+ * @returns {Uint8Array}
271
+ */
272
+ _responseToBytes(response: ResponseT): Uint8Array;
273
+ /**
274
+ * Determine if we should continue the execution process, error, or finish.
275
+ *
276
+ * FIXME: This method should really be called something else. Initially it returned
277
+ * a boolean so `shouldRetry` made sense, but now it returns an enum, so the name
278
+ * no longer makes sense.
279
+ *
280
+ * @abstract
281
+ * @protected
282
+ * @param {RequestT} request
283
+ * @param {ResponseT} response
284
+ * @returns {[Status, ExecutionState]}
285
+ */
286
+ protected _shouldRetry(request: RequestT, response: ResponseT): [Status, ExecutionState];
287
+ /**
288
+ * Determine if we should error based on the gRPC status
289
+ *
290
+ * Unlike `shouldRetry` this method does in fact still return a boolean
291
+ *
292
+ * @protected
293
+ * @param {Error} error
294
+ * @returns {boolean}
295
+ */
296
+ protected _shouldRetryExceptionally(error: Error): boolean;
297
+ /**
298
+ * A helper method for setting the operator on the request
299
+ *
300
+ * @internal
301
+ * @param {AccountId} accountId
302
+ * @param {PublicKey} publicKey
303
+ * @param {(message: Uint8Array) => Promise<Uint8Array>} transactionSigner
304
+ * @returns {this}
305
+ */
306
+ _setOperatorWith(accountId: AccountId, publicKey: PublicKey, transactionSigner: (message: Uint8Array) => Promise<Uint8Array>): this;
307
+ /**
308
+ * Execute this request using the signer
309
+ *
310
+ * This method is part of the signature providers feature
311
+ * https://hips.hedera.com/hip/hip-338
312
+ *
313
+ * @param {Signer} signer
314
+ * @returns {Promise<OutputT>}
315
+ */
316
+ executeWithSigner(signer: Signer): Promise<OutputT>;
317
+ /**
318
+ * @returns {boolean}
319
+ * @abstract
320
+ * @protected
321
+ */
322
+ protected isBatchedAndNotBatchTransaction(): boolean;
323
+ /**
324
+ * Execute the request using a client and an optional request timeout
325
+ *
326
+ * @template {Channel} ChannelT
327
+ * @template {MirrorChannel} MirrorChannelT
328
+ * @param {import("./client/Client.js").default<ChannelT, MirrorChannelT>} client
329
+ * @param {number=} requestTimeout
330
+ * @returns {Promise<OutputT>}
331
+ */
332
+ execute<ChannelT extends Channel, MirrorChannelT extends MirrorChannel>(client: import("./client/Client.js").default<ChannelT, MirrorChannelT>, requestTimeout?: number | undefined): Promise<OutputT>;
333
+ /**
334
+ * The current purpose of this method is to easily support signature providers since
335
+ * signature providers need to serialize _any_ request into bytes. `Query` and `Transaction`
336
+ * already implement `toBytes()` so it only made sense to make it available here too.
337
+ *
338
+ * @abstract
339
+ * @returns {Uint8Array}
340
+ */
341
+ toBytes(): Uint8Array;
342
+ /**
343
+ * Set logger
344
+ *
345
+ * @param {Logger} logger
346
+ * @returns {this}
347
+ */
348
+ setLogger(logger: Logger): this;
349
+ /**
350
+ * Get logger if set
351
+ *
352
+ * @returns {?Logger}
353
+ */
354
+ get logger(): Logger | null;
355
+ }
356
+ export type AccountId = import("./account/AccountId.js").default;
357
+ export type Channel = import("./channel/Channel.js").default;
358
+ export type MirrorChannel = import("./channel/MirrorChannel.js").default;
359
+ export type TransactionId = import("./transaction/TransactionId.js").default;
360
+ export type ClientOperator = import("./client/Client.js").ClientOperator;
361
+ export type Signer = import("./Signer.js").Signer;
362
+ export type PublicKey = import("./PublicKey.js").default;
363
+ export type Logger = import("./logger/Logger.js").default;
364
+ import List from "./transaction/List.js";
365
+ import Status from "./Status.js";
@@ -0,0 +1,2 @@
1
+ import t from"./grpc/GrpcServiceError.js";import e from"./grpc/GrpcStatus.js";import o from"./transaction/List.js";import{encode as n}from"./encoding/hex.js";import r from"./http/HttpError.js";import s from"./Status.js";import i from"./MaxAttemptsOrTimeoutError.js";const c={Finished:"Finished",Retry:"Retry",Error:"Error"},a=/\brst[^0-9a-zA-Z]stream\b/i,h=10;class u{constructor(){this._maxAttempts=10,this._nodeAccountIds=new o,this.transactionNodeIds=[],this._signOnDemand=!1,this._minBackoff=null,this._maxBackoff=8e3,this._operator=null,this._requestTimeout=null,this._grpcDeadline=null,this._logger=null}get nodeAccountIds(){return this._nodeAccountIds.isEmpty?null:(this._nodeAccountIds.setLocked(),this._nodeAccountIds.list)}setNodeAccountIds(t){return this._nodeAccountIds.setList(t).setLocked(),this}get maxRetries(){return console.warn("Deprecated: use maxAttempts instead"),this.maxAttempts}setMaxRetries(t){return console.warn("Deprecated: use setMaxAttempts() instead"),this.setMaxAttempts(t)}get maxAttempts(){return this._maxAttempts}setMaxAttempts(t){return this._maxAttempts=t,this}get grpcDeadline(){return this._grpcDeadline}setGrpcDeadline(t){return this._grpcDeadline=t,this}setMinBackoff(t){if(null==t)throw new Error("minBackoff cannot be null.");if(null!=this._maxBackoff&&t>this._maxBackoff)throw new Error("minBackoff cannot be larger than maxBackoff.");return this._minBackoff=t,this}get minBackoff(){return this._minBackoff}setMaxBackoff(t){if(null==t)throw new Error("maxBackoff cannot be null.");if(null!=this._minBackoff&&t<this._minBackoff)throw new Error("maxBackoff cannot be smaller than minBackoff.");return this._maxBackoff=t,this}get maxBackoff(){return this._maxBackoff}_beforeExecute(t){throw new Error("not implemented")}_makeRequestAsync(){throw new Error("not implemented")}_mapStatusError(t,e,o){throw new Error("not implemented")}_mapResponse(t,e,o){throw new Error("not implemented")}_execute(t,e){throw new Error("not implemented")}_getTransactionId(){throw new Error("not implemented")}_getLogId(){throw new Error("not implemented")}_requestToBytes(t){throw new Error("not implemented")}_responseToBytes(t){throw new Error("not implemented")}_shouldRetry(t,e){throw new Error("not implemented")}_shouldRetryExceptionally(o){return!(o instanceof t)||(o.status._code===e.Timeout._code||o.status._code===e.Unavailable._code||o.status._code===e.ResourceExhausted._code||o.status._code===e.GrpcWeb._code||o.status._code===e.Internal._code&&a.test(o.message))}_setOperatorWith(t,e,o){return this._operator={transactionSigner:o,accountId:t,publicKey:e},this}async executeWithSigner(t){return t.call(this)}isBatchedAndNotBatchTransaction(){return!1}async execute(e,o){const a=null!=e.network["127.0.0.1:50211"];if(this.isBatchedAndNotBatchTransaction())throw new Error("Cannot execute batchified transaction outside of BatchTransaction");this._logger=null==this._logger?null!=e._logger?e._logger:null:this._logger,null==this._requestTimeout&&(this._requestTimeout=null!=o?o:e.requestTimeout),await this._beforeExecute(e),null==this._maxBackoff&&(this._maxBackoff=e.maxBackoff),null==this._minBackoff&&(this._minBackoff=e.minBackoff);const h=Date.now();let u=null;const m=a?1e3:e._maxAttempts??this._maxAttempts;if(this.transactionNodeIds.length){const t=this._nodeAccountIds.list.map((t=>t.toString()));if(!this.transactionNodeIds.some((e=>t.includes(e)))){const e=t.length>2?`${t.slice(0,2).join(", ")} ...`:t.join(", "),o=1===t.length;throw new Error(`Attempting to execute a transaction against node${o?"":"s"} ${e}, which ${o?"is":"are"} not included in the Client's node list. Please review your Client configuration.`)}}for(let o=1;o<=m;o+=1){if(null!=this._requestTimeout&&h+this._requestTimeout<=Date.now())throw new i("timeout exceeded",this._nodeAccountIds.isEmpty?"No node account ID set":this._nodeAccountIds.current.toString());let g,_;if(this._nodeAccountIds.isEmpty?(_=e._network.getNode(),g=_.accountId,this._nodeAccountIds.setList([g])):(g=this._nodeAccountIds.current,_=e._network.getNode(g)),null==_)throw new Error(`NodeAccountId not recognized: ${g.toString()}`);if(this.transactionNodeIds.length){if(!this.transactionNodeIds.includes(g.toString())){console.error(`Attempting to execute a transaction against node ${g.toString()}, which is not included in the Client's node list. Please review your Client configuration.`),this._nodeAccountIds.advance();continue}}const f=this._getLogId();this._logger&&this._logger.debug(`[${f}] Node AccountID: ${_.accountId.toString()}, IP: ${_.address.toString()}`);const p=_.getChannel(),w=await this._makeRequestAsync();let x;if(!_.isHealthy()){const t=this._nodeAccountIds.index===this._nodeAccountIds.list.length-1;if(d(w)||a){await l(a,o,this._minBackoff,this._maxBackoff);continue}if(t||this._nodeAccountIds.length<=1)throw new Error(`Network connectivity issue: All nodes are unhealthy. Original node list: ${this._nodeAccountIds.list.join(", ")}`);this._logger&&this._logger.debug(`[${f}] Node is not healthy, trying the next node.`),this._nodeAccountIds.advance();continue}this._nodeAccountIds.advance();try{const t=[];null!=this._grpcDeadline&&t.push(new Promise(((t,e)=>setTimeout((()=>e(new Error("grpc deadline exceeded"))),this._grpcDeadline)))),this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${n(this._requestToBytes(w))}`),t.push(this._execute(p,w)),x=await Promise.race(t)}catch(n){const s=t._fromResponse(n);if(u=s,this._logger&&this._logger.debug(`[${f}] received error ${JSON.stringify(s)}`),(s instanceof t||s instanceof r)&&this._shouldRetryExceptionally(s)&&o<=m){this._logger&&this._logger.debug(`[${this._getLogId()}] node with accountId: ${_.accountId.toString()} and proxy IP: ${_.address.toString()} is unhealthy`),e._network.increaseBackoff(_);continue}throw n}this._logger&&this._logger.trace(`[${this._getLogId()}] sending protobuf ${n(this._responseToBytes(x))}`),e._network.decreaseBackoff(_);const[k,A]=this._shouldRetry(w,x);switch(k.toString()!==s.Ok.toString()&&k.toString()!==s.Success.toString()&&(u=k),A){case c.Retry:await l(a,o,this._minBackoff,this._maxBackoff);continue;case c.Finished:return this._mapResponse(x,g,w);case c.Error:throw this._mapStatusError(w,x,g);default:throw new Error("(BUG) non-exhaustive switch statement for `ExecutionState`")}}throw new i(`max attempts of ${m.toString()} was reached for request with last error being: ${null!=u?u.toString():""}`,this._nodeAccountIds.current.toString())}toBytes(){throw new Error("not implemented")}setLogger(t){return this._logger=t,this}get logger(){return this._logger}}function d(t){return"object"==typeof t&&null!==t&&("transactionGetReceipt"in t||"transactionGetRecord"in t)}function l(t,e,o,n){if(t)return new Promise((t=>setTimeout(t,o)));const r=Math.min(Math.floor(o*Math.pow(2,e)),n);return new Promise((t=>setTimeout(t,r)))}export{h as DEFAULT_MAX_ATTEMPTS,c as ExecutionState,a as RST_STREAM,u as default};
2
+ //# sourceMappingURL=Executable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Executable.js","sources":["../src/Executable.js"],"sourcesContent":["// SPDX-License-Identifier: Apache-2.0\n\nimport GrpcServiceError from \"./grpc/GrpcServiceError.js\";\nimport GrpcStatus from \"./grpc/GrpcStatus.js\";\nimport List from \"./transaction/List.js\";\nimport * as hex from \"./encoding/hex.js\";\nimport HttpError from \"./http/HttpError.js\";\nimport Status from \"./Status.js\";\nimport MaxAttemptsOrTimeoutError from \"./MaxAttemptsOrTimeoutError.js\";\n\n/**\n * @typedef {import(\"./account/AccountId.js\").default} AccountId\n * @typedef {import(\"./channel/Channel.js\").default} Channel\n * @typedef {import(\"./channel/MirrorChannel.js\").default} MirrorChannel\n * @typedef {import(\"./transaction/TransactionId.js\").default} TransactionId\n * @typedef {import(\"./client/Client.js\").ClientOperator} ClientOperator\n * @typedef {import(\"./Signer.js\").Signer} Signer\n * @typedef {import(\"./PublicKey.js\").default} PublicKey\n * @typedef {import(\"./logger/Logger.js\").default} Logger\n */\n\n/**\n * @enum {string}\n */\nexport const ExecutionState = {\n Finished: \"Finished\",\n Retry: \"Retry\",\n Error: \"Error\",\n};\n\nexport const RST_STREAM = /\\brst[^0-9a-zA-Z]stream\\b/i;\nexport const DEFAULT_MAX_ATTEMPTS = 10;\n\n/**\n * @abstract\n * @internal\n * @template RequestT\n * @template ResponseT\n * @template OutputT\n */\nexport default class Executable {\n constructor() {\n /**\n * The number of times we can retry the grpc call\n *\n * @internal\n * @type {number}\n */\n this._maxAttempts = DEFAULT_MAX_ATTEMPTS;\n\n /**\n * List of node account IDs for each transaction that has been\n * built.\n *\n * @internal\n * @type {List<AccountId>}\n */\n this._nodeAccountIds = new List();\n\n /**\n * List of the transaction node account IDs to check if\n * the node account ID of the request is in the list\n *\n * @protected\n * @type {Array<string>}\n */\n this.transactionNodeIds = [];\n\n /**\n * @internal\n */\n this._signOnDemand = false;\n\n /**\n * This is the request's min backoff\n *\n * @internal\n * @type {number | null}\n */\n this._minBackoff = null;\n\n /**\n * This is the request's max backoff\n *\n * @internal\n * @type {number}\n */\n this._maxBackoff = 8000;\n\n /**\n * The operator that was used to execute this request.\n * The reason we save the operator in the request is because of the signing on\n * demand feature. This feature requires us to sign new request on each attempt\n * meaning if a client with an operator was used we'd need to sign with the operator\n * on each attempt.\n *\n * @internal\n * @type {ClientOperator | null}\n */\n this._operator = null;\n\n /**\n * The complete timeout for running the `execute()` method\n *\n * @internal\n * @type {number | null}\n */\n this._requestTimeout = null;\n\n /**\n * The grpc request timeout aka deadline.\n *\n * The reason we have this is because there were times that consensus nodes held the grpc\n * connection, but didn't return anything; not error nor regular response. This resulted\n * in some weird behavior in the SDKs. To fix this we've added a grpc deadline to prevent\n * nodes from stalling the executing of a request.\n *\n * @internal\n * @type {number | null}\n */\n this._grpcDeadline = null;\n\n /**\n * Logger\n *\n * @protected\n * @type {Logger | null}\n */\n this._logger = null;\n }\n\n /**\n * Get the list of node account IDs on the request. If no nodes are set, then null is returned.\n * The reasoning for this is simply \"legacy behavior\".\n *\n * @returns {?AccountId[]}\n */\n get nodeAccountIds() {\n if (this._nodeAccountIds.isEmpty) {\n return null;\n } else {\n this._nodeAccountIds.setLocked();\n return this._nodeAccountIds.list;\n }\n }\n\n /**\n * Set the node account IDs on the request\n *\n * @param {AccountId[]} nodeIds\n * @returns {this}\n */\n setNodeAccountIds(nodeIds) {\n // Set the node account IDs, and lock the list. This will require `execute`\n // to use these nodes instead of random nodes from the network.\n this._nodeAccountIds.setList(nodeIds).setLocked();\n return this;\n }\n\n /**\n * @deprecated\n * @returns {number}\n */\n get maxRetries() {\n console.warn(\"Deprecated: use maxAttempts instead\");\n return this.maxAttempts;\n }\n\n /**\n * @param {number} maxRetries\n * @returns {this}\n */\n setMaxRetries(maxRetries) {\n console.warn(\"Deprecated: use setMaxAttempts() instead\");\n return this.setMaxAttempts(maxRetries);\n }\n\n /**\n * Get the max attempts on the request\n *\n * @returns {number}\n */\n get maxAttempts() {\n return this._maxAttempts;\n }\n\n /**\n * Set the max attempts on the request\n *\n * @param {number} maxAttempts\n * @returns {this}\n */\n setMaxAttempts(maxAttempts) {\n this._maxAttempts = maxAttempts;\n\n return this;\n }\n\n /**\n * Get the grpc deadline\n *\n * @returns {?number}\n */\n get grpcDeadline() {\n return this._grpcDeadline;\n }\n\n /**\n * Set the grpc deadline\n *\n * @param {number} grpcDeadline\n * @returns {this}\n */\n setGrpcDeadline(grpcDeadline) {\n this._grpcDeadline = grpcDeadline;\n\n return this;\n }\n\n /**\n * Set the min backoff for the request\n *\n * @param {number} minBackoff\n * @returns {this}\n */\n setMinBackoff(minBackoff) {\n // Honestly we shouldn't be checking for null since that should be TypeScript's job.\n // Also verify that min backoff is not greater than max backoff.\n if (minBackoff == null) {\n throw new Error(\"minBackoff cannot be null.\");\n } else if (this._maxBackoff != null && minBackoff > this._maxBackoff) {\n throw new Error(\"minBackoff cannot be larger than maxBackoff.\");\n }\n this._minBackoff = minBackoff;\n return this;\n }\n\n /**\n * Get the min backoff\n *\n * @returns {number | null}\n */\n get minBackoff() {\n return this._minBackoff;\n }\n\n /**\n * Set the max backoff for the request\n *\n * @param {?number} maxBackoff\n * @returns {this}\n */\n setMaxBackoff(maxBackoff) {\n // Honestly we shouldn't be checking for null since that should be TypeScript's job.\n // Also verify that max backoff is not less than min backoff.\n if (maxBackoff == null) {\n throw new Error(\"maxBackoff cannot be null.\");\n } else if (this._minBackoff != null && maxBackoff < this._minBackoff) {\n throw new Error(\"maxBackoff cannot be smaller than minBackoff.\");\n }\n this._maxBackoff = maxBackoff;\n return this;\n }\n\n /**\n * Get the max backoff\n *\n * @returns {number}\n */\n get maxBackoff() {\n return this._maxBackoff;\n }\n\n /**\n * This method is responsible for doing any work before the executing process begins.\n * For paid queries this will result in executing a cost query, for transactions this\n * will make sure we save the operator and sign any requests that need to be signed\n * in case signing on demand is disabled.\n *\n * @abstract\n * @protected\n * @param {import(\"./client/Client.js\").default<Channel, *>} client\n * @returns {Promise<void>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _beforeExecute(client) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Create a protobuf request which will be passed into the `_execute()` method\n *\n * @abstract\n * @protected\n * @returns {Promise<RequestT>}\n */\n _makeRequestAsync() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * This name is a bit wrong now, but the purpose of this method is to map the\n * request and response into an error. This method will only be called when\n * `_shouldRetry` returned `ExecutionState.Error`\n *\n * @abstract\n * @internal\n * @param {RequestT} request\n * @param {ResponseT} response\n * @param {AccountId} nodeId\n * @returns {Error}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _mapStatusError(request, response, nodeId) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Map the request, response, and the node account ID used for this attempt into a response.\n * This method will only be called when `_shouldRetry` returned `ExecutionState.Finished`\n *\n * @abstract\n * @protected\n * @param {ResponseT} response\n * @param {AccountId} nodeAccountId\n * @param {RequestT} request\n * @returns {Promise<OutputT>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _mapResponse(response, nodeAccountId, request) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Perform a single grpc call with the given request. Each request has it's own\n * required service so we just pass in channel, and it'$ the request's responsiblity\n * to use the right service and call the right grpc method.\n *\n * @abstract\n * @internal\n * @param {Channel} channel\n * @param {RequestT} request\n * @returns {Promise<ResponseT>}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _execute(channel, request) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Return the current transaction ID for the request. All requests which are\n * use the same transaction ID for each node, but the catch is that `Transaction`\n * implicitly supports chunked transactions. Meaning there could be multiple\n * transaction IDs stored in the request, and a different transaction ID will be used\n * on subsequent calls to `execute()`\n *\n * FIXME: This method can most likely be removed, although some further inspection\n * is required.\n *\n * @abstract\n * @protected\n * @returns {TransactionId}\n */\n _getTransactionId() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Return the log ID for this particular request\n *\n * Log IDs are simply a string constructed to make it easy to track each request's\n * execution even when mulitple requests are executing in parallel. Typically, this\n * method returns the format of `[<request type>.<timestamp of the transaction ID>]`\n *\n * Maybe we should deduplicate this using ${this.consturtor.name}\n *\n * @abstract\n * @internal\n * @returns {string}\n */\n _getLogId() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Serialize the request into bytes\n *\n * @abstract\n * @param {RequestT} request\n * @returns {Uint8Array}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _requestToBytes(request) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Serialize the response into bytes\n *\n * @abstract\n * @param {ResponseT} response\n * @returns {Uint8Array}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _responseToBytes(response) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Determine if we should continue the execution process, error, or finish.\n *\n * FIXME: This method should really be called something else. Initially it returned\n * a boolean so `shouldRetry` made sense, but now it returns an enum, so the name\n * no longer makes sense.\n *\n * @abstract\n * @protected\n * @param {RequestT} request\n * @param {ResponseT} response\n * @returns {[Status, ExecutionState]}\n */\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n _shouldRetry(request, response) {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Determine if we should error based on the gRPC status\n *\n * Unlike `shouldRetry` this method does in fact still return a boolean\n *\n * @protected\n * @param {Error} error\n * @returns {boolean}\n */\n _shouldRetryExceptionally(error) {\n if (error instanceof GrpcServiceError) {\n return (\n error.status._code === GrpcStatus.Timeout._code ||\n error.status._code === GrpcStatus.Unavailable._code ||\n error.status._code === GrpcStatus.ResourceExhausted._code ||\n error.status._code === GrpcStatus.GrpcWeb._code ||\n (error.status._code === GrpcStatus.Internal._code &&\n RST_STREAM.test(error.message))\n );\n } else {\n // if we get to the 'else' statement, the 'error' is instanceof 'HttpError'\n // and in this case, we have to retry always\n return true;\n }\n }\n\n /**\n * A helper method for setting the operator on the request\n *\n * @internal\n * @param {AccountId} accountId\n * @param {PublicKey} publicKey\n * @param {(message: Uint8Array) => Promise<Uint8Array>} transactionSigner\n * @returns {this}\n */\n _setOperatorWith(accountId, publicKey, transactionSigner) {\n this._operator = {\n transactionSigner,\n accountId,\n publicKey,\n };\n return this;\n }\n\n /**\n * Execute this request using the signer\n *\n * This method is part of the signature providers feature\n * https://hips.hedera.com/hip/hip-338\n *\n * @param {Signer} signer\n * @returns {Promise<OutputT>}\n */\n async executeWithSigner(signer) {\n return signer.call(this);\n }\n\n /**\n * @returns {boolean}\n * @abstract\n * @protected\n */\n isBatchedAndNotBatchTransaction() {\n return false;\n }\n\n /**\n * Execute the request using a client and an optional request timeout\n *\n * @template {Channel} ChannelT\n * @template {MirrorChannel} MirrorChannelT\n * @param {import(\"./client/Client.js\").default<ChannelT, MirrorChannelT>} client\n * @param {number=} requestTimeout\n * @returns {Promise<OutputT>}\n */\n async execute(client, requestTimeout) {\n // we check if its local node then backoff mechanism should be disabled\n // and we increase the retry attempts\n const isLocalNode = client.network[\"127.0.0.1:50211\"] != null;\n\n if (this.isBatchedAndNotBatchTransaction()) {\n throw new Error(\n \"Cannot execute batchified transaction outside of BatchTransaction\",\n );\n }\n\n // If the logger on the request is not set, use the logger in client\n // (if set, otherwise do not use logger)\n this._logger =\n this._logger == null\n ? client._logger != null\n ? client._logger\n : null\n : this._logger;\n\n // If the request timeout is set on the request we'll prioritize that instead\n // of the parameter provided, and if the parameter isn't provided we'll\n // use the default request timeout on client\n if (this._requestTimeout == null) {\n this._requestTimeout =\n requestTimeout != null ? requestTimeout : client.requestTimeout;\n }\n\n // Some request need to perform additional requests before the executing\n // such as paid queries need to fetch the cost of the query before\n // finally executing the actual query.\n await this._beforeExecute(client);\n\n // If the max backoff on the request is not set, use the default value in client\n if (this._maxBackoff == null) {\n this._maxBackoff = client.maxBackoff;\n }\n\n // If the min backoff on the request is not set, use the default value in client\n if (this._minBackoff == null) {\n this._minBackoff = client.minBackoff;\n }\n\n // Save the start time to be used later with request timeout\n const startTime = Date.now();\n\n // Saves each error we get so when we err due to max attempts exceeded we'll have\n // the last error that was returned by the consensus node\n let persistentError = null;\n\n // If the max attempts on the request is not set, use the default value in client\n // If the default value in client is not set, use a default of 10.\n //\n // FIXME: current implementation is wrong, update to follow comment above.\n // ... existing code ...\n const LOCAL_NODE_ATTEMPTS = 1000;\n const maxAttempts = isLocalNode\n ? LOCAL_NODE_ATTEMPTS\n : (client._maxAttempts ?? this._maxAttempts);\n\n // Checks if has a valid nodes to which the TX can be sent\n if (this.transactionNodeIds.length) {\n const nodeAccountIds = this._nodeAccountIds.list.map((nodeId) =>\n nodeId.toString(),\n );\n\n const hasValidNodes = this.transactionNodeIds.some((nodeId) =>\n nodeAccountIds.includes(nodeId),\n );\n\n if (!hasValidNodes) {\n const displayNodeAccountIds =\n nodeAccountIds.length > 2\n ? `${nodeAccountIds.slice(0, 2).join(\", \")} ...`\n : nodeAccountIds.join(\", \");\n const isSingleNode = nodeAccountIds.length === 1;\n\n throw new Error(\n `Attempting to execute a transaction against node${isSingleNode ? \"\" : \"s\"} ${displayNodeAccountIds}, ` +\n `which ${isSingleNode ? \"is\" : \"are\"} not included in the Client's node list. Please review your Client configuration.`,\n );\n }\n }\n\n // The retry loop\n for (let attempt = 1; attempt <= maxAttempts; attempt += 1) {\n // Determine if we've exceeded request timeout\n if (\n this._requestTimeout != null &&\n startTime + this._requestTimeout <= Date.now()\n ) {\n throw new MaxAttemptsOrTimeoutError(\n `timeout exceeded`,\n this._nodeAccountIds.isEmpty\n ? \"No node account ID set\"\n : this._nodeAccountIds.current.toString(),\n );\n }\n\n let nodeAccountId;\n let node;\n\n if (this._nodeAccountIds.isEmpty) {\n node = client._network.getNode();\n nodeAccountId = node.accountId;\n this._nodeAccountIds.setList([nodeAccountId]);\n } else {\n nodeAccountId = this._nodeAccountIds.current;\n node = client._network.getNode(nodeAccountId);\n }\n\n if (node == null) {\n throw new Error(\n `NodeAccountId not recognized: ${nodeAccountId.toString()}`,\n );\n }\n\n if (this.transactionNodeIds.length) {\n const isNodeAccountIdValid = this.transactionNodeIds.includes(\n nodeAccountId.toString(),\n );\n\n if (!isNodeAccountIdValid) {\n console.error(\n `Attempting to execute a transaction against node ${nodeAccountId.toString()}, which is not included in the Client's node list. Please review your Client configuration.`,\n );\n\n this._nodeAccountIds.advance();\n continue;\n }\n }\n\n // Get the log ID for the request.\n const logId = this._getLogId();\n if (this._logger) {\n this._logger.debug(\n `[${logId}] Node AccountID: ${node.accountId.toString()}, IP: ${node.address.toString()}`,\n );\n }\n\n const channel = node.getChannel();\n const request = await this._makeRequestAsync();\n\n let response;\n\n if (!node.isHealthy()) {\n const isLastNode =\n this._nodeAccountIds.index ===\n this._nodeAccountIds.list.length - 1;\n\n // Check if the request is a transaction receipt or record\n // request to retry 10 times, because getReceiptQuery/getRecordQuery\n // are single node requests\n if (\n isTransactionReceiptOrRecordRequest(request) ||\n isLocalNode\n ) {\n await delayForAttempt(\n isLocalNode,\n attempt,\n this._minBackoff,\n this._maxBackoff,\n );\n continue;\n }\n\n if (isLastNode || this._nodeAccountIds.length <= 1) {\n throw new Error(\n `Network connectivity issue: All nodes are unhealthy. Original node list: ${this._nodeAccountIds.list.join(\", \")}`,\n );\n }\n\n if (this._logger) {\n this._logger.debug(\n `[${logId}] Node is not healthy, trying the next node.`,\n );\n }\n\n this._nodeAccountIds.advance();\n continue;\n }\n\n this._nodeAccountIds.advance();\n\n try {\n // Race the execution promise against the grpc timeout to prevent grpc connections\n // from blocking this request\n const promises = [];\n\n // If a grpc deadline is est, we should race it, otherwise the only thing in the\n // list of promises will be the execution promise.\n if (this._grpcDeadline != null) {\n promises.push(\n // eslint-disable-next-line ie11/no-loop-func\n new Promise((_, reject) =>\n setTimeout(\n // eslint-disable-next-line ie11/no-loop-func\n () =>\n reject(new Error(\"grpc deadline exceeded\")),\n /** @type {number=} */ (this._grpcDeadline),\n ),\n ),\n );\n }\n if (this._logger) {\n this._logger.trace(\n `[${this._getLogId()}] sending protobuf ${hex.encode(\n this._requestToBytes(request),\n )}`,\n );\n }\n\n promises.push(this._execute(channel, request));\n // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment\n response = /** @type {ResponseT} */ (\n await Promise.race(promises)\n );\n } catch (err) {\n // If we received a grpc status error we need to determine if\n // we should retry on this error, or err from the request entirely.\n const error = GrpcServiceError._fromResponse(\n /** @type {Error} */ (err),\n );\n\n // Save the error in case we retry\n persistentError = error;\n if (this._logger) {\n this._logger.debug(\n `[${logId}] received error ${JSON.stringify(error)}`,\n );\n }\n\n if (\n (error instanceof GrpcServiceError ||\n error instanceof HttpError) &&\n this._shouldRetryExceptionally(error) &&\n attempt <= maxAttempts\n ) {\n // Increase the backoff for the particular node and remove it from\n // the healthy node list\n if (this._logger) {\n this._logger.debug(\n `[${this._getLogId()}] node with accountId: ${node.accountId.toString()} and proxy IP: ${node.address.toString()} is unhealthy`,\n );\n }\n\n client._network.increaseBackoff(node);\n continue;\n }\n\n throw err;\n }\n if (this._logger) {\n this._logger.trace(\n `[${this._getLogId()}] sending protobuf ${hex.encode(\n this._responseToBytes(response),\n )}`,\n );\n }\n\n // If we didn't receive an error we should decrease the current nodes backoff\n // in case it is a recovering node\n client._network.decreaseBackoff(node);\n\n // Determine what execution state we're in by the response\n // For transactions this would be as simple as checking the response status is `OK`\n // while for _most_ queries it would check if the response status is `SUCCESS`\n // The only odd balls are `TransactionReceiptQuery` and `TransactionRecordQuery`\n const [status, shouldRetry] = this._shouldRetry(request, response);\n if (\n status.toString() !== Status.Ok.toString() &&\n status.toString() !== Status.Success.toString()\n ) {\n persistentError = status;\n }\n\n // Determine by the executing state what we should do\n switch (shouldRetry) {\n case ExecutionState.Retry:\n await delayForAttempt(\n isLocalNode,\n attempt,\n this._minBackoff,\n this._maxBackoff,\n );\n continue;\n case ExecutionState.Finished:\n return this._mapResponse(response, nodeAccountId, request);\n case ExecutionState.Error:\n throw this._mapStatusError(\n request,\n response,\n nodeAccountId,\n );\n default:\n throw new Error(\n \"(BUG) non-exhaustive switch statement for `ExecutionState`\",\n );\n }\n }\n\n // We'll only get here if we've run out of attempts, so we return an error wrapping the\n // persistent error we saved before.\n\n throw new MaxAttemptsOrTimeoutError(\n `max attempts of ${maxAttempts.toString()} was reached for request with last error being: ${\n persistentError != null ? persistentError.toString() : \"\"\n }`,\n this._nodeAccountIds.current.toString(),\n );\n }\n\n /**\n * The current purpose of this method is to easily support signature providers since\n * signature providers need to serialize _any_ request into bytes. `Query` and `Transaction`\n * already implement `toBytes()` so it only made sense to make it available here too.\n *\n * @abstract\n * @returns {Uint8Array}\n */\n toBytes() {\n throw new Error(\"not implemented\");\n }\n\n /**\n * Set logger\n *\n * @param {Logger} logger\n * @returns {this}\n */\n setLogger(logger) {\n this._logger = logger;\n return this;\n }\n\n /**\n * Get logger if set\n *\n * @returns {?Logger}\n */\n get logger() {\n return this._logger;\n }\n}\n\n/**\n * Checks if the request is a transaction receipt or record request\n *\n * @template T\n * @param {T} request - The request to check\n * @returns {boolean} - True if the request is a transaction receipt or record\n */\nfunction isTransactionReceiptOrRecordRequest(request) {\n if (typeof request !== \"object\" || request === null) {\n return false;\n }\n\n return (\n \"transactionGetReceipt\" in request || \"transactionGetRecord\" in request\n );\n}\n\n/**\n * A simple function that returns a promise timeout for a specific period of time\n *\n * @param {boolean} isLocalNode\n * @param {number} attempt\n * @param {number} minBackoff\n * @param {number} maxBackoff\n * @returns {Promise<void>}\n */\nfunction delayForAttempt(isLocalNode, attempt, minBackoff, maxBackoff) {\n if (isLocalNode) {\n return new Promise((resolve) => setTimeout(resolve, minBackoff));\n }\n\n // 0.1s, 0.2s, 0.4s, 0.8s, ...\n const ms = Math.min(\n Math.floor(minBackoff * Math.pow(2, attempt)),\n maxBackoff,\n );\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"names":["ExecutionState","Finished","Retry","Error","RST_STREAM","DEFAULT_MAX_ATTEMPTS","Executable","constructor","this","_maxAttempts","_nodeAccountIds","List","transactionNodeIds","_signOnDemand","_minBackoff","_maxBackoff","_operator","_requestTimeout","_grpcDeadline","_logger","nodeAccountIds","isEmpty","setLocked","list","setNodeAccountIds","nodeIds","setList","maxRetries","console","warn","maxAttempts","setMaxRetries","setMaxAttempts","grpcDeadline","setGrpcDeadline","setMinBackoff","minBackoff","setMaxBackoff","maxBackoff","_beforeExecute","client","_makeRequestAsync","_mapStatusError","request","response","nodeId","_mapResponse","nodeAccountId","_execute","channel","_getTransactionId","_getLogId","_requestToBytes","_responseToBytes","_shouldRetry","_shouldRetryExceptionally","error","GrpcServiceError","status","_code","GrpcStatus","Timeout","Unavailable","ResourceExhausted","GrpcWeb","Internal","test","message","_setOperatorWith","accountId","publicKey","transactionSigner","executeWithSigner","signer","call","isBatchedAndNotBatchTransaction","execute","requestTimeout","isLocalNode","network","startTime","Date","now","persistentError","length","map","toString","some","includes","displayNodeAccountIds","slice","join","isSingleNode","attempt","MaxAttemptsOrTimeoutError","current","node","_network","getNode","advance","logId","debug","address","getChannel","isHealthy","isLastNode","index","isTransactionReceiptOrRecordRequest","delayForAttempt","promises","push","Promise","_","reject","setTimeout","trace","hex.encode","race","err","_fromResponse","JSON","stringify","HttpError","increaseBackoff","decreaseBackoff","shouldRetry","Status","Ok","Success","toBytes","setLogger","logger","resolve","ms","Math","min","floor","pow"],"mappings":"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"}
@@ -0,0 +1,170 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var HieroProto = _interopRequireWildcard(require("@hashgraph/proto"));
8
+ var _long = _interopRequireDefault(require("long"));
9
+ function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
10
+ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
11
+ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
12
+ // SPDX-License-Identifier: Apache-2.0
13
+
14
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
15
+
16
+ /**
17
+ * A set of values the nodes use in determining transaction and query fees, and
18
+ * constants involved in fee calculations.
19
+ */
20
+ class FeeComponents {
21
+ /**
22
+ * @param {object} [props]
23
+ * @param {Long} [props.min]
24
+ * @param {Long} [props.max]
25
+ * @param {Long} [props.constant]
26
+ * @param {Long} [props.transactionBandwidthByte]
27
+ * @param {Long} [props.transactionVerification]
28
+ * @param {Long} [props.transactionRamByteHour]
29
+ * @param {Long} [props.transactionStorageByteHour]
30
+ * @param {Long} [props.contractTransactionGas]
31
+ * @param {Long} [props.transferVolumeHbar]
32
+ * @param {Long} [props.responseMemoryByte]
33
+ * @param {Long} [props.responseDiskByte]
34
+ */
35
+ constructor(props = {}) {
36
+ /*
37
+ * A minimum, the calculated fee must be greater than this value
38
+ *
39
+ * @type {Long}
40
+ */
41
+ this.min = props.min;
42
+
43
+ /*
44
+ * A maximum, the calculated fee must be less than this value
45
+ *
46
+ * @type {Long}
47
+ */
48
+ this.max = props.max;
49
+
50
+ /*
51
+ * A constant contribution to the fee
52
+ *
53
+ * @type {Long}
54
+ */
55
+ this.constant = props.constant;
56
+
57
+ /*
58
+ * The price of bandwidth consumed by a transaction, measured in bytes
59
+ *
60
+ * @type {Long}
61
+ */
62
+ this.transactionBandwidthByte = props.transactionBandwidthByte;
63
+
64
+ /*
65
+ * The price per signature verification for a transaction
66
+ *
67
+ * @type {Long}
68
+ */
69
+ this.transactionVerification = props.transactionVerification;
70
+
71
+ /*
72
+ * The price of RAM consumed by a transaction, measured in byte-hours
73
+ *
74
+ * @type {Long}
75
+ */
76
+ this.transactionRamByteHour = props.transactionRamByteHour;
77
+
78
+ /*
79
+ * The price of storage consumed by a transaction, measured in byte-hours
80
+ *
81
+ * @type {Long}
82
+ */
83
+ this.transactionStorageByteHour = props.transactionStorageByteHour;
84
+
85
+ /*
86
+ * The price of computation for a smart contract transaction, measured in gas
87
+ *
88
+ * @type {Long}
89
+ */
90
+ this.contractTransactionGas = props.contractTransactionGas;
91
+
92
+ /*
93
+ * The price per hbar transferred for a transfer
94
+ *
95
+ * @type {Long}
96
+ */
97
+ this.transferVolumeHbar = props.transferVolumeHbar;
98
+
99
+ /*
100
+ * The price of bandwidth for data retrieved from memory for a response, measured in bytes
101
+ *
102
+ * @type {Long}
103
+ */
104
+ this.responseMemoryByte = props.responseMemoryByte;
105
+
106
+ /*
107
+ * The price of bandwidth for data retrieved from disk for a response, measured in bytes
108
+ *
109
+ * @type {Long}
110
+ */
111
+ this.responseDiskByte = props.responseDiskByte;
112
+ }
113
+
114
+ /**
115
+ * @param {Uint8Array} bytes
116
+ * @returns {FeeComponents}
117
+ */
118
+ static fromBytes(bytes) {
119
+ return FeeComponents._fromProtobuf(HieroProto.proto.FeeComponents.decode(bytes));
120
+ }
121
+
122
+ /**
123
+ * @internal
124
+ * @param {HieroProto.proto.IFeeComponents} feeComponents
125
+ * @returns {FeeComponents}
126
+ */
127
+ static _fromProtobuf(feeComponents) {
128
+ return new FeeComponents({
129
+ min: feeComponents.min != null ? feeComponents.min : undefined,
130
+ max: feeComponents.max != null ? feeComponents.max : undefined,
131
+ constant: feeComponents.constant != null ? feeComponents.constant : undefined,
132
+ transactionBandwidthByte: feeComponents.bpt != null ? feeComponents.bpt : undefined,
133
+ transactionVerification: feeComponents.vpt != null ? feeComponents.vpt : undefined,
134
+ transactionRamByteHour: feeComponents.rbh != null ? feeComponents.rbh : undefined,
135
+ transactionStorageByteHour: feeComponents.sbh != null ? feeComponents.sbh : undefined,
136
+ contractTransactionGas: feeComponents.gas != null ? feeComponents.gas : undefined,
137
+ transferVolumeHbar: feeComponents.tv != null ? feeComponents.tv : undefined,
138
+ responseMemoryByte: feeComponents.bpr != null ? feeComponents.bpr : undefined,
139
+ responseDiskByte: feeComponents.sbpr != null ? feeComponents.sbpr : undefined
140
+ });
141
+ }
142
+
143
+ /**
144
+ * @internal
145
+ * @returns {HieroProto.proto.IFeeComponents}
146
+ */
147
+ _toProtobuf() {
148
+ return {
149
+ min: this.min != null ? this.min : undefined,
150
+ max: this.max != null ? this.max : undefined,
151
+ constant: this.constant != null ? this.constant : undefined,
152
+ bpt: this.transactionBandwidthByte != null ? this.transactionBandwidthByte : undefined,
153
+ vpt: this.transactionVerification != null ? this.transactionVerification : undefined,
154
+ rbh: this.transactionRamByteHour != null ? this.transactionRamByteHour : undefined,
155
+ sbh: this.transactionStorageByteHour != null ? this.transactionStorageByteHour : undefined,
156
+ gas: this.contractTransactionGas != null ? this.contractTransactionGas : undefined,
157
+ tv: this.transferVolumeHbar != null ? this.transferVolumeHbar : undefined,
158
+ bpr: this.responseMemoryByte != null ? this.responseMemoryByte : undefined,
159
+ sbpr: this.responseDiskByte != null ? this.responseDiskByte : undefined
160
+ };
161
+ }
162
+
163
+ /**
164
+ * @returns {Uint8Array}
165
+ */
166
+ toBytes() {
167
+ return HieroProto.proto.FeeComponents.encode(this._toProtobuf()).finish();
168
+ }
169
+ }
170
+ exports.default = FeeComponents;