@ecency/sdk 2.4.23 → 2.4.24

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 (536) hide show
  1. package/dist/browser/{chunk-RBORSSX5.js → chunk-2JKJ4XWU.js} +2 -2
  2. package/dist/browser/{chunk-RBORSSX5.js.map → chunk-2JKJ4XWU.js.map} +1 -1
  3. package/dist/browser/{chunk-HV4BKN6J.js → chunk-2KEJTQE4.js} +2 -2
  4. package/dist/browser/{chunk-HV4BKN6J.js.map → chunk-2KEJTQE4.js.map} +1 -1
  5. package/dist/browser/{chunk-4R7PDEUP.js → chunk-32UMQJXQ.js} +2 -2
  6. package/dist/browser/{chunk-4R7PDEUP.js.map → chunk-32UMQJXQ.js.map} +1 -1
  7. package/dist/browser/{chunk-C2EISS5O.js → chunk-37K2OPGL.js} +2 -2
  8. package/dist/browser/{chunk-C2EISS5O.js.map → chunk-37K2OPGL.js.map} +1 -1
  9. package/dist/browser/{chunk-QV7IOAFD.js → chunk-3XRU3DXW.js} +2 -2
  10. package/dist/browser/{chunk-QV7IOAFD.js.map → chunk-3XRU3DXW.js.map} +1 -1
  11. package/dist/browser/{chunk-7N4UF43Y.js → chunk-4C57MZP6.js} +2 -2
  12. package/dist/browser/{chunk-7N4UF43Y.js.map → chunk-4C57MZP6.js.map} +1 -1
  13. package/dist/browser/{chunk-BBBMEKXU.js → chunk-4CZFR2OD.js} +2 -2
  14. package/dist/browser/{chunk-BBBMEKXU.js.map → chunk-4CZFR2OD.js.map} +1 -1
  15. package/dist/browser/{chunk-C5PSLR7Z.js → chunk-4OOAGHRD.js} +2 -2
  16. package/dist/browser/{chunk-C5PSLR7Z.js.map → chunk-4OOAGHRD.js.map} +1 -1
  17. package/dist/browser/{chunk-C6K4OJC4.js → chunk-5X6R7EPZ.js} +2 -2
  18. package/dist/browser/{chunk-C6K4OJC4.js.map → chunk-5X6R7EPZ.js.map} +1 -1
  19. package/dist/browser/{chunk-QGLHPALU.js → chunk-65S4AS6C.js} +2 -2
  20. package/dist/browser/{chunk-QGLHPALU.js.map → chunk-65S4AS6C.js.map} +1 -1
  21. package/dist/browser/{chunk-RC4MOYY5.js → chunk-6A7YD57H.js} +2 -2
  22. package/dist/browser/{chunk-RC4MOYY5.js.map → chunk-6A7YD57H.js.map} +1 -1
  23. package/dist/browser/{chunk-36UTWSH7.js → chunk-6IABT7MJ.js} +2 -2
  24. package/dist/browser/{chunk-36UTWSH7.js.map → chunk-6IABT7MJ.js.map} +1 -1
  25. package/dist/browser/{chunk-SAWB4N2Y.js → chunk-7EICUHR3.js} +2 -2
  26. package/dist/browser/{chunk-SAWB4N2Y.js.map → chunk-7EICUHR3.js.map} +1 -1
  27. package/dist/browser/{chunk-4EL7BARO.js → chunk-AIDCGQFG.js} +2 -2
  28. package/dist/browser/{chunk-4EL7BARO.js.map → chunk-AIDCGQFG.js.map} +1 -1
  29. package/dist/browser/{chunk-E2HXPVGT.js → chunk-APLDSWPX.js} +2 -2
  30. package/dist/browser/{chunk-E2HXPVGT.js.map → chunk-APLDSWPX.js.map} +1 -1
  31. package/dist/browser/{chunk-H7HEYDU6.js → chunk-ASSGVHJB.js} +2 -2
  32. package/dist/browser/{chunk-H7HEYDU6.js.map → chunk-ASSGVHJB.js.map} +1 -1
  33. package/dist/browser/{chunk-HS6NJH6H.js → chunk-BHMOSSSW.js} +2 -2
  34. package/dist/browser/{chunk-HS6NJH6H.js.map → chunk-BHMOSSSW.js.map} +1 -1
  35. package/dist/browser/{chunk-U2AQDDCH.js → chunk-CAOGIMWX.js} +2 -2
  36. package/dist/browser/{chunk-U2AQDDCH.js.map → chunk-CAOGIMWX.js.map} +1 -1
  37. package/dist/browser/{chunk-MPGCDOY7.js → chunk-CKHL2O7X.js} +2 -2
  38. package/dist/browser/{chunk-MPGCDOY7.js.map → chunk-CKHL2O7X.js.map} +1 -1
  39. package/dist/browser/{chunk-R6OHEJX2.js → chunk-DA6YYF2F.js} +2 -2
  40. package/dist/browser/{chunk-R6OHEJX2.js.map → chunk-DA6YYF2F.js.map} +1 -1
  41. package/dist/browser/{chunk-W3TAAAAM.js → chunk-ETHEILN6.js} +2 -2
  42. package/dist/browser/{chunk-W3TAAAAM.js.map → chunk-ETHEILN6.js.map} +1 -1
  43. package/dist/browser/{chunk-4VII2U33.js → chunk-FJ5CJPZL.js} +2 -2
  44. package/dist/browser/{chunk-4VII2U33.js.map → chunk-FJ5CJPZL.js.map} +1 -1
  45. package/dist/browser/{chunk-JT3FBTE4.js → chunk-FJ6MJL6G.js} +2 -2
  46. package/dist/browser/{chunk-JT3FBTE4.js.map → chunk-FJ6MJL6G.js.map} +1 -1
  47. package/dist/browser/chunk-FJXZ5DK2.js +2 -0
  48. package/dist/browser/chunk-FJXZ5DK2.js.map +1 -0
  49. package/dist/browser/{chunk-LAXQ3PZ3.js → chunk-FL3ZYHPE.js} +2 -2
  50. package/dist/browser/{chunk-LAXQ3PZ3.js.map → chunk-FL3ZYHPE.js.map} +1 -1
  51. package/dist/browser/{chunk-ICLETUUV.js → chunk-FT5QYVCP.js} +2 -2
  52. package/dist/browser/{chunk-ICLETUUV.js.map → chunk-FT5QYVCP.js.map} +1 -1
  53. package/dist/browser/{chunk-LPQIHN5Z.js → chunk-GCSYVQXA.js} +2 -2
  54. package/dist/browser/{chunk-LPQIHN5Z.js.map → chunk-GCSYVQXA.js.map} +1 -1
  55. package/dist/browser/{chunk-DJWMP2O4.js → chunk-GN3PKAHB.js} +2 -2
  56. package/dist/browser/{chunk-DJWMP2O4.js.map → chunk-GN3PKAHB.js.map} +1 -1
  57. package/dist/browser/{chunk-PCUZP45U.js → chunk-HAIUMSGN.js} +2 -2
  58. package/dist/browser/{chunk-PCUZP45U.js.map → chunk-HAIUMSGN.js.map} +1 -1
  59. package/dist/browser/{chunk-IOGRMGRX.js → chunk-HOEDGBRX.js} +2 -2
  60. package/dist/browser/{chunk-IOGRMGRX.js.map → chunk-HOEDGBRX.js.map} +1 -1
  61. package/dist/browser/{chunk-JM4J2N4W.js → chunk-HQFYXVBS.js} +2 -2
  62. package/dist/browser/{chunk-JM4J2N4W.js.map → chunk-HQFYXVBS.js.map} +1 -1
  63. package/dist/browser/chunk-HWUXXAKE.js +2 -0
  64. package/dist/browser/{chunk-M63I2JJV.js.map → chunk-HWUXXAKE.js.map} +1 -1
  65. package/dist/browser/{chunk-5ANV6VYI.js → chunk-I77ZLLQJ.js} +2 -2
  66. package/dist/browser/{chunk-5ANV6VYI.js.map → chunk-I77ZLLQJ.js.map} +1 -1
  67. package/dist/browser/{chunk-UNKOXV36.js → chunk-IDZVSJHQ.js} +2 -2
  68. package/dist/browser/{chunk-UNKOXV36.js.map → chunk-IDZVSJHQ.js.map} +1 -1
  69. package/dist/browser/{chunk-4KTE2S6L.js → chunk-IGKMIJW2.js} +2 -2
  70. package/dist/browser/{chunk-4KTE2S6L.js.map → chunk-IGKMIJW2.js.map} +1 -1
  71. package/dist/browser/{chunk-AZZRCIT3.js → chunk-IRITFNBC.js} +2 -2
  72. package/dist/browser/{chunk-AZZRCIT3.js.map → chunk-IRITFNBC.js.map} +1 -1
  73. package/dist/browser/{chunk-P6GFUYJZ.js → chunk-K4CHL32C.js} +2 -2
  74. package/dist/browser/{chunk-P6GFUYJZ.js.map → chunk-K4CHL32C.js.map} +1 -1
  75. package/dist/browser/{chunk-36XVEJ3I.js → chunk-L362IYM3.js} +2 -2
  76. package/dist/browser/{chunk-36XVEJ3I.js.map → chunk-L362IYM3.js.map} +1 -1
  77. package/dist/browser/{chunk-GXSNHTGO.js → chunk-L4LDM3J5.js} +2 -2
  78. package/dist/browser/{chunk-GXSNHTGO.js.map → chunk-L4LDM3J5.js.map} +1 -1
  79. package/dist/browser/{chunk-PN4AFXFW.js → chunk-LER3TBTJ.js} +2 -2
  80. package/dist/browser/{chunk-PN4AFXFW.js.map → chunk-LER3TBTJ.js.map} +1 -1
  81. package/dist/browser/{chunk-MYMGKU5V.js → chunk-MTL3QUPP.js} +2 -2
  82. package/dist/browser/{chunk-MYMGKU5V.js.map → chunk-MTL3QUPP.js.map} +1 -1
  83. package/dist/browser/{chunk-M332H37M.js → chunk-NF4XUXML.js} +2 -2
  84. package/dist/browser/{chunk-M332H37M.js.map → chunk-NF4XUXML.js.map} +1 -1
  85. package/dist/browser/{chunk-XLTYBCR5.js → chunk-NIE5XZ45.js} +2 -2
  86. package/dist/browser/{chunk-XLTYBCR5.js.map → chunk-NIE5XZ45.js.map} +1 -1
  87. package/dist/browser/chunk-OAOOURDH.js +2 -0
  88. package/dist/browser/{chunk-Z7R2PK35.js.map → chunk-OAOOURDH.js.map} +1 -1
  89. package/dist/browser/{chunk-YUTSHZGV.js → chunk-OG6WTNVW.js} +2 -2
  90. package/dist/browser/{chunk-YUTSHZGV.js.map → chunk-OG6WTNVW.js.map} +1 -1
  91. package/dist/browser/{chunk-XEB43J5Q.js → chunk-OQA55EE6.js} +2 -2
  92. package/dist/browser/{chunk-XEB43J5Q.js.map → chunk-OQA55EE6.js.map} +1 -1
  93. package/dist/browser/{chunk-DSUV7SML.js → chunk-OTDWQRUL.js} +2 -2
  94. package/dist/browser/{chunk-DSUV7SML.js.map → chunk-OTDWQRUL.js.map} +1 -1
  95. package/dist/browser/{chunk-VDPNUKQ6.js → chunk-P4XPKFYI.js} +2 -2
  96. package/dist/browser/{chunk-VDPNUKQ6.js.map → chunk-P4XPKFYI.js.map} +1 -1
  97. package/dist/browser/{chunk-J2HM6MWA.js → chunk-PFVWZI3W.js} +2 -2
  98. package/dist/browser/{chunk-J2HM6MWA.js.map → chunk-PFVWZI3W.js.map} +1 -1
  99. package/dist/browser/{chunk-FRXPHA7Y.js → chunk-PW42FHVU.js} +2 -2
  100. package/dist/browser/{chunk-FRXPHA7Y.js.map → chunk-PW42FHVU.js.map} +1 -1
  101. package/dist/browser/{chunk-NS5UVFUZ.js → chunk-R6UPSSYV.js} +2 -2
  102. package/dist/browser/{chunk-NS5UVFUZ.js.map → chunk-R6UPSSYV.js.map} +1 -1
  103. package/dist/browser/{chunk-373JQPTA.js → chunk-S3LJG457.js} +2 -2
  104. package/dist/browser/{chunk-373JQPTA.js.map → chunk-S3LJG457.js.map} +1 -1
  105. package/dist/browser/{chunk-EHCNEMO7.js → chunk-SB6LDMEP.js} +2 -2
  106. package/dist/browser/{chunk-EHCNEMO7.js.map → chunk-SB6LDMEP.js.map} +1 -1
  107. package/dist/browser/{chunk-7JPEXH7J.js → chunk-UGE6ZEXY.js} +2 -2
  108. package/dist/browser/{chunk-7JPEXH7J.js.map → chunk-UGE6ZEXY.js.map} +1 -1
  109. package/dist/browser/{chunk-JG7HMCAI.js → chunk-VCYNR26T.js} +2 -2
  110. package/dist/browser/{chunk-JG7HMCAI.js.map → chunk-VCYNR26T.js.map} +1 -1
  111. package/dist/browser/{chunk-R3DMLKGZ.js → chunk-W4TAERQX.js} +2 -2
  112. package/dist/browser/{chunk-R3DMLKGZ.js.map → chunk-W4TAERQX.js.map} +1 -1
  113. package/dist/browser/{chunk-5E7DWZPN.js → chunk-W6CO2WKX.js} +2 -2
  114. package/dist/browser/{chunk-5E7DWZPN.js.map → chunk-W6CO2WKX.js.map} +1 -1
  115. package/dist/browser/{chunk-Q2ACQBL2.js → chunk-WCIDGHGX.js} +2 -2
  116. package/dist/browser/{chunk-Q2ACQBL2.js.map → chunk-WCIDGHGX.js.map} +1 -1
  117. package/dist/browser/{chunk-IEAAYAFA.js → chunk-WDWR4RZ6.js} +2 -2
  118. package/dist/browser/{chunk-IEAAYAFA.js.map → chunk-WDWR4RZ6.js.map} +1 -1
  119. package/dist/browser/{chunk-IMCYKBDV.js → chunk-WE6EIHC6.js} +2 -2
  120. package/dist/browser/{chunk-IMCYKBDV.js.map → chunk-WE6EIHC6.js.map} +1 -1
  121. package/dist/browser/{chunk-CFHER3WM.js → chunk-WGKD2O73.js} +2 -2
  122. package/dist/browser/{chunk-CFHER3WM.js.map → chunk-WGKD2O73.js.map} +1 -1
  123. package/dist/browser/{chunk-VOET5ABO.js → chunk-WHH45AA3.js} +2 -2
  124. package/dist/browser/{chunk-VOET5ABO.js.map → chunk-WHH45AA3.js.map} +1 -1
  125. package/dist/browser/{chunk-EPPY5SE6.js → chunk-WLHXAS5P.js} +2 -2
  126. package/dist/browser/{chunk-EPPY5SE6.js.map → chunk-WLHXAS5P.js.map} +1 -1
  127. package/dist/browser/{chunk-6JEMIQQJ.js → chunk-XBAS5ZUQ.js} +2 -2
  128. package/dist/browser/{chunk-6JEMIQQJ.js.map → chunk-XBAS5ZUQ.js.map} +1 -1
  129. package/dist/browser/{chunk-QAXITR2P.js → chunk-XQLIW5VC.js} +2 -2
  130. package/dist/browser/{chunk-QAXITR2P.js.map → chunk-XQLIW5VC.js.map} +1 -1
  131. package/dist/browser/{chunk-AU2I7Q6Y.js → chunk-XVW7ZC72.js} +2 -2
  132. package/dist/browser/{chunk-AU2I7Q6Y.js.map → chunk-XVW7ZC72.js.map} +1 -1
  133. package/dist/browser/{chunk-6PK5KYS5.js → chunk-XX32ZFT4.js} +2 -2
  134. package/dist/browser/{chunk-6PK5KYS5.js.map → chunk-XX32ZFT4.js.map} +1 -1
  135. package/dist/browser/{chunk-VPRG4WZA.js → chunk-XZIXDSRW.js} +2 -2
  136. package/dist/browser/{chunk-VPRG4WZA.js.map → chunk-XZIXDSRW.js.map} +1 -1
  137. package/dist/browser/{chunk-SI7S4VLE.js → chunk-Z2HIVTNL.js} +2 -2
  138. package/dist/browser/{chunk-SI7S4VLE.js.map → chunk-Z2HIVTNL.js.map} +1 -1
  139. package/dist/browser/chunk-Z3FAL7TO.js +2 -0
  140. package/dist/browser/{chunk-LRO6EB5Y.js.map → chunk-Z3FAL7TO.js.map} +1 -1
  141. package/dist/browser/{chunk-DWJJGDRC.js → chunk-ZCURRWT2.js} +2 -2
  142. package/dist/browser/{chunk-DWJJGDRC.js.map → chunk-ZCURRWT2.js.map} +1 -1
  143. package/dist/browser/{chunk-BCISRGHL.js → chunk-ZSARKV4B.js} +2 -2
  144. package/dist/browser/{chunk-BCISRGHL.js.map → chunk-ZSARKV4B.js.map} +1 -1
  145. package/dist/browser/{chunk-NKALZNPX.js → chunk-ZVICL7AK.js} +2 -2
  146. package/dist/browser/{chunk-NKALZNPX.js.map → chunk-ZVICL7AK.js.map} +1 -1
  147. package/dist/browser/hive-tx/Transaction.js +1 -1
  148. package/dist/browser/hive-tx/helpers/memo.js +1 -1
  149. package/dist/browser/hive-tx/helpers/serializer.js +1 -1
  150. package/dist/browser/hive-tx/helpers/utils.js +1 -1
  151. package/dist/browser/hive-tx/index.js +1 -1
  152. package/dist/browser/hive.js +1 -1
  153. package/dist/browser/index.js +1 -1
  154. package/dist/browser/modules/accounts/index.js +1 -1
  155. package/dist/browser/modules/accounts/mutations/bookmarks/index.js +1 -1
  156. package/dist/browser/modules/accounts/mutations/bookmarks/use-account-bookmark-add.js +1 -1
  157. package/dist/browser/modules/accounts/mutations/bookmarks/use-account-bookmark-delete.js +1 -1
  158. package/dist/browser/modules/accounts/mutations/favorite-tags/index.js +1 -1
  159. package/dist/browser/modules/accounts/mutations/favorite-tags/requests.js +1 -1
  160. package/dist/browser/modules/accounts/mutations/favorite-tags/use-favorite-tag-add.js +1 -1
  161. package/dist/browser/modules/accounts/mutations/favorite-tags/use-favorite-tag-delete.js +1 -1
  162. package/dist/browser/modules/accounts/mutations/favorites/index.js +1 -1
  163. package/dist/browser/modules/accounts/mutations/favorites/use-account-favorite-add.js +1 -1
  164. package/dist/browser/modules/accounts/mutations/favorites/use-account-favorite-delete.js +1 -1
  165. package/dist/browser/modules/accounts/mutations/index.js +1 -1
  166. package/dist/browser/modules/accounts/mutations/use-account-relations-update.js +1 -1
  167. package/dist/browser/modules/accounts/mutations/use-account-revoke-key.js +1 -1
  168. package/dist/browser/modules/accounts/mutations/use-account-revoke-posting.js +1 -1
  169. package/dist/browser/modules/accounts/mutations/use-account-update-key-auths.js +1 -1
  170. package/dist/browser/modules/accounts/mutations/use-account-update-password.js +1 -1
  171. package/dist/browser/modules/accounts/mutations/use-account-update-recovery.js +1 -1
  172. package/dist/browser/modules/accounts/mutations/use-account-update.js +1 -1
  173. package/dist/browser/modules/accounts/mutations/use-claim-account.js +1 -1
  174. package/dist/browser/modules/accounts/mutations/use-create-account.js +1 -1
  175. package/dist/browser/modules/accounts/mutations/use-follow.js +1 -1
  176. package/dist/browser/modules/accounts/mutations/use-grant-posting-permission.js +1 -1
  177. package/dist/browser/modules/accounts/mutations/use-unfollow.js +1 -1
  178. package/dist/browser/modules/accounts/queries/check-favorite-query-options.js +1 -1
  179. package/dist/browser/modules/accounts/queries/check-username-wallets-pending-query-options.js +1 -1
  180. package/dist/browser/modules/accounts/queries/get-account-full-query-options.js +1 -1
  181. package/dist/browser/modules/accounts/queries/get-account-pending-recovery-query-options.js +1 -1
  182. package/dist/browser/modules/accounts/queries/get-account-recoveries-query-options.js +1 -1
  183. package/dist/browser/modules/accounts/queries/get-account-reputations-query-options.js +1 -1
  184. package/dist/browser/modules/accounts/queries/get-account-subscriptions-query-options.js +1 -1
  185. package/dist/browser/modules/accounts/queries/get-account-vote-history-infinite-query-options.js +1 -1
  186. package/dist/browser/modules/accounts/queries/get-accounts-query-options.js +1 -1
  187. package/dist/browser/modules/accounts/queries/get-aggregated-balance-query-options.js +1 -1
  188. package/dist/browser/modules/accounts/queries/get-balance-history-query-options.js +1 -1
  189. package/dist/browser/modules/accounts/queries/get-bookmarks-query-options.js +1 -1
  190. package/dist/browser/modules/accounts/queries/get-bots-query-options.js +1 -1
  191. package/dist/browser/modules/accounts/queries/get-favorite-tag-check-query-options.js +1 -1
  192. package/dist/browser/modules/accounts/queries/get-favorite-tags-query-options.js +1 -1
  193. package/dist/browser/modules/accounts/queries/get-favorites-query-options.js +1 -1
  194. package/dist/browser/modules/accounts/queries/get-follow-count-query-options.js +1 -1
  195. package/dist/browser/modules/accounts/queries/get-followers-query-options.js +1 -1
  196. package/dist/browser/modules/accounts/queries/get-following-query-options.js +1 -1
  197. package/dist/browser/modules/accounts/queries/get-friends-infinite-query-options.js +1 -1
  198. package/dist/browser/modules/accounts/queries/get-muted-users-query-options.js +1 -1
  199. package/dist/browser/modules/accounts/queries/get-pro-members-query-options.js +1 -1
  200. package/dist/browser/modules/accounts/queries/get-profiles-query-options.js +1 -1
  201. package/dist/browser/modules/accounts/queries/get-referrals-infinite-query-options.js +1 -1
  202. package/dist/browser/modules/accounts/queries/get-referrals-stats-query-options.js +1 -1
  203. package/dist/browser/modules/accounts/queries/get-relationship-between-accounts-query-options.js +1 -1
  204. package/dist/browser/modules/accounts/queries/get-search-friends-query-options.js +1 -1
  205. package/dist/browser/modules/accounts/queries/get-transactions-infinite-query-options.js +1 -1
  206. package/dist/browser/modules/accounts/queries/index.js +1 -1
  207. package/dist/browser/modules/accounts/queries/lookup-accounts-query-options.js +1 -1
  208. package/dist/browser/modules/accounts/queries/search-accounts-by-username-query-options.js +1 -1
  209. package/dist/browser/modules/accounts/utils/account-power.js +1 -1
  210. package/dist/browser/modules/accounts/utils/index.js +1 -1
  211. package/dist/browser/modules/ai/index.js +1 -1
  212. package/dist/browser/modules/ai/mutations/index.js +1 -1
  213. package/dist/browser/modules/ai/mutations/use-ai-assist.js +1 -1
  214. package/dist/browser/modules/ai/mutations/use-ai-transcribe.js +1 -1
  215. package/dist/browser/modules/ai/mutations/use-generate-image.js +1 -1
  216. package/dist/browser/modules/ai/queries/get-ai-assist-price-query-options.js +1 -1
  217. package/dist/browser/modules/ai/queries/get-ai-generate-price-query-options.js +1 -1
  218. package/dist/browser/modules/ai/queries/get-ai-images-query-options.js +1 -1
  219. package/dist/browser/modules/ai/queries/get-ai-transcribe-price-query-options.js +1 -1
  220. package/dist/browser/modules/ai/queries/index.js +1 -1
  221. package/dist/browser/modules/analytics/index.js +1 -1
  222. package/dist/browser/modules/analytics/mutations/index.js +1 -1
  223. package/dist/browser/modules/analytics/mutations/use-record-activity.js +1 -1
  224. package/dist/browser/modules/analytics/queries/get-discover-curation-query-options.js +1 -1
  225. package/dist/browser/modules/analytics/queries/get-discover-leaderboard-query-options.js +1 -1
  226. package/dist/browser/modules/analytics/queries/get-page-stats-query-options.js +1 -1
  227. package/dist/browser/modules/analytics/queries/index.js +1 -1
  228. package/dist/browser/modules/auth/index.js +1 -1
  229. package/dist/browser/modules/auth/requests.js +1 -1
  230. package/dist/browser/modules/bad-actors/index.js +1 -1
  231. package/dist/browser/modules/bad-actors/queries/get-bad-actors-query-options.js +1 -1
  232. package/dist/browser/modules/bad-actors/queries/index.js +1 -1
  233. package/dist/browser/modules/bridge/index.js +1 -1
  234. package/dist/browser/modules/bridge/requests.js +1 -1
  235. package/dist/browser/modules/bridge/verify-on-alternate-node.js +1 -1
  236. package/dist/browser/modules/communities/index.js +1 -1
  237. package/dist/browser/modules/communities/mutations/index.js +1 -1
  238. package/dist/browser/modules/communities/mutations/use-mute-post.js +1 -1
  239. package/dist/browser/modules/communities/mutations/use-pin-post.js +1 -1
  240. package/dist/browser/modules/communities/mutations/use-register-community-rewards.js +1 -1
  241. package/dist/browser/modules/communities/mutations/use-set-community-role.js +1 -1
  242. package/dist/browser/modules/communities/mutations/use-subscribe-community.js +1 -1
  243. package/dist/browser/modules/communities/mutations/use-unsubscribe-community.js +1 -1
  244. package/dist/browser/modules/communities/mutations/use-update-community.js +1 -1
  245. package/dist/browser/modules/communities/queries/get-account-notifications-infinite-query-options.js +1 -1
  246. package/dist/browser/modules/communities/queries/get-communities-query-options.js +1 -1
  247. package/dist/browser/modules/communities/queries/get-community-context-query-options.js +1 -1
  248. package/dist/browser/modules/communities/queries/get-community-query-options.js +1 -1
  249. package/dist/browser/modules/communities/queries/get-community-subscribers-query-options.js +1 -1
  250. package/dist/browser/modules/communities/queries/get-rewarded-communities-query-options.js +1 -1
  251. package/dist/browser/modules/communities/queries/index.js +1 -1
  252. package/dist/browser/modules/core/config.js +1 -1
  253. package/dist/browser/modules/core/hive-tx.js +1 -1
  254. package/dist/browser/modules/core/index.js +1 -1
  255. package/dist/browser/modules/core/mutations/broadcast-json.js +1 -1
  256. package/dist/browser/modules/core/mutations/index.js +1 -1
  257. package/dist/browser/modules/core/mutations/use-broadcast-mutation.js +1 -1
  258. package/dist/browser/modules/core/queries/get-chain-properties-query-options.js +1 -1
  259. package/dist/browser/modules/core/queries/get-dynamic-props-query-options.js +1 -1
  260. package/dist/browser/modules/core/queries/get-reward-fund-query-options.js +1 -1
  261. package/dist/browser/modules/core/queries/index.js +1 -1
  262. package/dist/browser/modules/core/queries-manager.js +1 -1
  263. package/dist/browser/modules/curation/dmca.js +1 -1
  264. package/dist/browser/modules/curation/index.js +1 -1
  265. package/dist/browser/modules/curation/mutations/index.js +1 -1
  266. package/dist/browser/modules/curation/mutations/use-curation-recommend.js +1 -1
  267. package/dist/browser/modules/curation/queries/get-curation-application-query-options.js +1 -1
  268. package/dist/browser/modules/curation/queries/get-curation-applications-query-options.js +1 -1
  269. package/dist/browser/modules/curation/queries/get-curation-feed-infinite-query-options.js +1 -1
  270. package/dist/browser/modules/curation/queries/get-curation-post-query-options.js +1 -1
  271. package/dist/browser/modules/curation/queries/get-curation-recommendations-infinite-query-options.js +1 -1
  272. package/dist/browser/modules/curation/queries/get-curation-recommender-query-options.js +1 -1
  273. package/dist/browser/modules/curation/queries/get-curation-roster-admin-query-options.js +1 -1
  274. package/dist/browser/modules/curation/queries/get-curation-roster-query-options.js +1 -1
  275. package/dist/browser/modules/curation/queries/get-curation-status-query-options.js +1 -1
  276. package/dist/browser/modules/curation/queries/index.js +1 -1
  277. package/dist/browser/modules/curation/requests.js +1 -1
  278. package/dist/browser/modules/games/index.js +1 -1
  279. package/dist/browser/modules/games/mutations/game-claim.js +1 -1
  280. package/dist/browser/modules/games/mutations/index.js +1 -1
  281. package/dist/browser/modules/games/queries/game-status-check-query-options.js +1 -1
  282. package/dist/browser/modules/games/queries/index.js +1 -1
  283. package/dist/browser/modules/hive-engine/index.js +1 -1
  284. package/dist/browser/modules/hive-engine/queries/get-all-hive-engine-tokens-query-options.js +1 -1
  285. package/dist/browser/modules/hive-engine/queries/get-hive-engine-balances-with-usd-query-options.js +1 -1
  286. package/dist/browser/modules/hive-engine/queries/get-hive-engine-token-general-info-query-options.js +1 -1
  287. package/dist/browser/modules/hive-engine/queries/get-hive-engine-token-metrics-query-options.js +1 -1
  288. package/dist/browser/modules/hive-engine/queries/get-hive-engine-token-transactions-query-options.js +1 -1
  289. package/dist/browser/modules/hive-engine/queries/get-hive-engine-tokens-balances-query-options.js +1 -1
  290. package/dist/browser/modules/hive-engine/queries/get-hive-engine-tokens-market-query-options.js +1 -1
  291. package/dist/browser/modules/hive-engine/queries/get-hive-engine-tokens-metadata-query-options.js +1 -1
  292. package/dist/browser/modules/hive-engine/queries/get-hive-engine-unclaimed-rewards-query-options.js +1 -1
  293. package/dist/browser/modules/hive-engine/queries/index.js +1 -1
  294. package/dist/browser/modules/hive-engine/requests.js +1 -1
  295. package/dist/browser/modules/integrations/3speak/index.js +1 -1
  296. package/dist/browser/modules/integrations/3speak/queries/get-account-token-query-options.js +1 -1
  297. package/dist/browser/modules/integrations/3speak/queries/get-account-videos-query-options.js +1 -1
  298. package/dist/browser/modules/integrations/3speak/queries/index.js +1 -1
  299. package/dist/browser/modules/integrations/hiveposh/index.js +1 -1
  300. package/dist/browser/modules/integrations/hiveposh/queries/get-hiveposh-links-query-options.js +1 -1
  301. package/dist/browser/modules/integrations/hiveposh/queries/index.js +1 -1
  302. package/dist/browser/modules/integrations/index.js +1 -1
  303. package/dist/browser/modules/integrations/plausible/index.js +1 -1
  304. package/dist/browser/modules/integrations/plausible/queries/get-stats-query-options.js +1 -1
  305. package/dist/browser/modules/integrations/plausible/queries/index.js +1 -1
  306. package/dist/browser/modules/market/index.js +1 -1
  307. package/dist/browser/modules/market/mutations/index.js +1 -1
  308. package/dist/browser/modules/market/mutations/use-limit-order-cancel.js +1 -1
  309. package/dist/browser/modules/market/mutations/use-limit-order-create.js +1 -1
  310. package/dist/browser/modules/market/queries/get-current-median-history-price-query-options.js +1 -1
  311. package/dist/browser/modules/market/queries/get-feed-history-query-options.js +1 -1
  312. package/dist/browser/modules/market/queries/get-hive-hbd-stats-query-options.js +1 -1
  313. package/dist/browser/modules/market/queries/get-market-data-query-options.js +1 -1
  314. package/dist/browser/modules/market/queries/get-market-history-query-options.js +1 -1
  315. package/dist/browser/modules/market/queries/get-market-statistics-query-options.js +1 -1
  316. package/dist/browser/modules/market/queries/get-order-book-query-options.js +1 -1
  317. package/dist/browser/modules/market/queries/get-trade-history-query-options.js +1 -1
  318. package/dist/browser/modules/market/queries/index.js +1 -1
  319. package/dist/browser/modules/market/requests.js +1 -1
  320. package/dist/browser/modules/newsletter/api.js +1 -1
  321. package/dist/browser/modules/newsletter/index.js +1 -1
  322. package/dist/browser/modules/newsletter/mutations/index.js +1 -1
  323. package/dist/browser/modules/newsletter/mutations/use-leave-digest.js +1 -1
  324. package/dist/browser/modules/newsletter/mutations/use-send-newsletter-issue.js +1 -1
  325. package/dist/browser/modules/newsletter/mutations/use-subscribe-digest.js +1 -1
  326. package/dist/browser/modules/newsletter/mutations/use-unsubscribe-all-digests.js +1 -1
  327. package/dist/browser/modules/newsletter/queries/get-digest-subscriptions-query-options.js +1 -1
  328. package/dist/browser/modules/newsletter/queries/get-newsletter-issues-query-options.js +1 -1
  329. package/dist/browser/modules/newsletter/queries/get-newsletter-posts-query-options.js +1 -1
  330. package/dist/browser/modules/newsletter/queries/get-newsletter-sender-query-options.js +1 -1
  331. package/dist/browser/modules/newsletter/queries/index.js +1 -1
  332. package/dist/browser/modules/notifications/index.js +1 -1
  333. package/dist/browser/modules/notifications/mutations/index.js +1 -1
  334. package/dist/browser/modules/notifications/mutations/use-mark-notifications-read.js +1 -1
  335. package/dist/browser/modules/notifications/mutations/use-set-last-read.js +1 -1
  336. package/dist/browser/modules/notifications/queries/get-announcements-query-options.js +1 -1
  337. package/dist/browser/modules/notifications/queries/get-notifications-infinite-query-options.js +1 -1
  338. package/dist/browser/modules/notifications/queries/get-notifications-settings-query-options.js +1 -1
  339. package/dist/browser/modules/notifications/queries/get-notifications-unread-count-query-options.js +1 -1
  340. package/dist/browser/modules/notifications/queries/get-spotlights-query-options.js +1 -1
  341. package/dist/browser/modules/notifications/queries/index.js +1 -1
  342. package/dist/browser/modules/operations/index.js +1 -1
  343. package/dist/browser/modules/operations/mutations/index.js +1 -1
  344. package/dist/browser/modules/operations/mutations/sign-operation-by-key.js +1 -1
  345. package/dist/browser/modules/operations/queries/get-chain-properties-query-options.js +1 -1
  346. package/dist/browser/modules/operations/queries/index.js +1 -1
  347. package/dist/browser/modules/points/index.js +1 -1
  348. package/dist/browser/modules/points/mutations/index.js +1 -1
  349. package/dist/browser/modules/points/mutations/use-claim-points.js +1 -1
  350. package/dist/browser/modules/points/queries/get-points-asset-general-info-query-options.js +1 -1
  351. package/dist/browser/modules/points/queries/get-points-asset-transactions-query-options.js +1 -1
  352. package/dist/browser/modules/points/queries/get-points-query-options.js +1 -1
  353. package/dist/browser/modules/points/queries/index.js +1 -1
  354. package/dist/browser/modules/polls/index.js +1 -1
  355. package/dist/browser/modules/polls/mutations/index.js +1 -1
  356. package/dist/browser/modules/polls/mutations/use-poll-vote.js +1 -1
  357. package/dist/browser/modules/polls/queries/get-poll-query-options.js +1 -1
  358. package/dist/browser/modules/polls/queries/index.js +1 -1
  359. package/dist/browser/modules/posts/cache/discussions-cache-utils.js +1 -1
  360. package/dist/browser/modules/posts/cache/entries-cache-management.js +1 -1
  361. package/dist/browser/modules/posts/cache/index.js +1 -1
  362. package/dist/browser/modules/posts/index.js +1 -1
  363. package/dist/browser/modules/posts/mutations/add-fragment.js +1 -1
  364. package/dist/browser/modules/posts/mutations/edit-fragment.js +1 -1
  365. package/dist/browser/modules/posts/mutations/index.js +1 -1
  366. package/dist/browser/modules/posts/mutations/remove-fragment.js +1 -1
  367. package/dist/browser/modules/posts/mutations/use-add-draft.js +1 -1
  368. package/dist/browser/modules/posts/mutations/use-add-image.js +1 -1
  369. package/dist/browser/modules/posts/mutations/use-add-schedule.js +1 -1
  370. package/dist/browser/modules/posts/mutations/use-comment.js +1 -1
  371. package/dist/browser/modules/posts/mutations/use-cross-post.js +1 -1
  372. package/dist/browser/modules/posts/mutations/use-delete-comment.js +1 -1
  373. package/dist/browser/modules/posts/mutations/use-delete-draft.js +1 -1
  374. package/dist/browser/modules/posts/mutations/use-delete-image.js +1 -1
  375. package/dist/browser/modules/posts/mutations/use-delete-schedule.js +1 -1
  376. package/dist/browser/modules/posts/mutations/use-move-schedule.js +1 -1
  377. package/dist/browser/modules/posts/mutations/use-promote.js +1 -1
  378. package/dist/browser/modules/posts/mutations/use-reblog.js +1 -1
  379. package/dist/browser/modules/posts/mutations/use-update-draft.js +1 -1
  380. package/dist/browser/modules/posts/mutations/use-update-reply.js +1 -1
  381. package/dist/browser/modules/posts/mutations/use-upload-image.js +1 -1
  382. package/dist/browser/modules/posts/mutations/use-vote.js +1 -1
  383. package/dist/browser/modules/posts/queries/get-account-posts-query-options.js +1 -1
  384. package/dist/browser/modules/posts/queries/get-comment-history-query-options.js +1 -1
  385. package/dist/browser/modules/posts/queries/get-content-query-options.js +1 -1
  386. package/dist/browser/modules/posts/queries/get-content-replies-query-options.js +1 -1
  387. package/dist/browser/modules/posts/queries/get-deleted-entry-query-options.js +1 -1
  388. package/dist/browser/modules/posts/queries/get-discussions-query-options.js +1 -1
  389. package/dist/browser/modules/posts/queries/get-drafts-query-options.js +1 -1
  390. package/dist/browser/modules/posts/queries/get-entry-active-votes-query-options.js +1 -1
  391. package/dist/browser/modules/posts/queries/get-fragments-query-options.js +1 -1
  392. package/dist/browser/modules/posts/queries/get-images-query-options.js +1 -1
  393. package/dist/browser/modules/posts/queries/get-normalize-post-query-options.js +1 -1
  394. package/dist/browser/modules/posts/queries/get-post-header-query-options.js +1 -1
  395. package/dist/browser/modules/posts/queries/get-post-query-options.js +1 -1
  396. package/dist/browser/modules/posts/queries/get-post-tips-query-options.js +1 -1
  397. package/dist/browser/modules/posts/queries/get-posts-ranked-query-options.js +1 -1
  398. package/dist/browser/modules/posts/queries/get-promoted-posts-query-options.js +1 -1
  399. package/dist/browser/modules/posts/queries/get-reblogged-by-query-options.js +1 -1
  400. package/dist/browser/modules/posts/queries/get-reblogs-query-options.js +1 -1
  401. package/dist/browser/modules/posts/queries/get-schedules-query-options.js +1 -1
  402. package/dist/browser/modules/posts/queries/get-shorts-feed-query-options.js +1 -1
  403. package/dist/browser/modules/posts/queries/get-trending-tags-query-options.js +1 -1
  404. package/dist/browser/modules/posts/queries/get-trending-tags-with-stats-query-options.js +1 -1
  405. package/dist/browser/modules/posts/queries/get-user-post-vote-query-options.js +1 -1
  406. package/dist/browser/modules/posts/queries/get-waves-by-account-query-options.js +1 -1
  407. package/dist/browser/modules/posts/queries/get-waves-by-host-query-options.js +1 -1
  408. package/dist/browser/modules/posts/queries/get-waves-by-tag-query-options.js +1 -1
  409. package/dist/browser/modules/posts/queries/get-waves-feed-query-options.js +1 -1
  410. package/dist/browser/modules/posts/queries/get-waves-following-query-options.js +1 -1
  411. package/dist/browser/modules/posts/queries/get-waves-trending-authors-query-options.js +1 -1
  412. package/dist/browser/modules/posts/queries/get-waves-trending-tags-query-options.js +1 -1
  413. package/dist/browser/modules/posts/queries/index.js +1 -1
  414. package/dist/browser/modules/posts/utils/filter-dmca-entries.js +1 -1
  415. package/dist/browser/modules/posts/utils/validate-post-creating.js +1 -1
  416. package/dist/browser/modules/posts/utils/waves-helpers.js +1 -1
  417. package/dist/browser/modules/private-api/index.js +1 -1
  418. package/dist/browser/modules/private-api/requests.js +1 -1
  419. package/dist/browser/modules/promotions/index.js +1 -1
  420. package/dist/browser/modules/promotions/mutations/index.js +1 -1
  421. package/dist/browser/modules/promotions/mutations/use-boost-plus.js +1 -1
  422. package/dist/browser/modules/promotions/mutations/use-rc-delegation.js +1 -1
  423. package/dist/browser/modules/promotions/queries/get-boost-plus-account-prices-query-options.js +1 -1
  424. package/dist/browser/modules/promotions/queries/get-boost-plus-prices-query-options.js +1 -1
  425. package/dist/browser/modules/promotions/queries/get-promote-price-query-options.js +1 -1
  426. package/dist/browser/modules/promotions/queries/get-rc-delegation-active-query-options.js +1 -1
  427. package/dist/browser/modules/promotions/queries/get-rc-delegation-prices-query-options.js +1 -1
  428. package/dist/browser/modules/promotions/queries/index.js +1 -1
  429. package/dist/browser/modules/proposals/index.js +1 -1
  430. package/dist/browser/modules/proposals/mutations/index.js +1 -1
  431. package/dist/browser/modules/proposals/mutations/use-proposal-create.js +1 -1
  432. package/dist/browser/modules/proposals/mutations/use-proposal-vote.js +1 -1
  433. package/dist/browser/modules/proposals/queries/get-proposal-query-options.js +1 -1
  434. package/dist/browser/modules/proposals/queries/get-proposal-votes-query-options.js +1 -1
  435. package/dist/browser/modules/proposals/queries/get-proposals-query-options.js +1 -1
  436. package/dist/browser/modules/proposals/queries/get-user-proposal-votes-query-options.js +1 -1
  437. package/dist/browser/modules/proposals/queries/index.js +1 -1
  438. package/dist/browser/modules/quests/index.js +1 -1
  439. package/dist/browser/modules/quests/mutations/buy-streak-freeze.js +1 -1
  440. package/dist/browser/modules/quests/mutations/index.js +1 -1
  441. package/dist/browser/modules/quests/queries/get-quests-query-options.js +1 -1
  442. package/dist/browser/modules/quests/queries/index.js +1 -1
  443. package/dist/browser/modules/resource-credits/index.js +1 -1
  444. package/dist/browser/modules/resource-credits/queries/get-account-rc-query-options.js +1 -1
  445. package/dist/browser/modules/resource-credits/queries/get-rc-resource-params-query-options.js +1 -1
  446. package/dist/browser/modules/resource-credits/queries/get-rc-stats-query-options.js +1 -1
  447. package/dist/browser/modules/resource-credits/queries/index.js +1 -1
  448. package/dist/browser/modules/resource-credits/utils/estimate-rc-precheck.js +1 -1
  449. package/dist/browser/modules/resource-credits/utils/index.js +1 -1
  450. package/dist/browser/modules/search/dmca.js +1 -1
  451. package/dist/browser/modules/search/index.js +1 -1
  452. package/dist/browser/modules/search/parse-json-response.js +1 -1
  453. package/dist/browser/modules/search/queries/get-search-account-query-options.js +1 -1
  454. package/dist/browser/modules/search/queries/get-search-api-infinite-query-options.js +1 -1
  455. package/dist/browser/modules/search/queries/get-search-path-query-options.js +1 -1
  456. package/dist/browser/modules/search/queries/get-search-query-options.js +1 -1
  457. package/dist/browser/modules/search/queries/get-search-topics-query-options.js +1 -1
  458. package/dist/browser/modules/search/queries/get-similar-entries-query-options.js +1 -1
  459. package/dist/browser/modules/search/queries/index.js +1 -1
  460. package/dist/browser/modules/search/requests.js +1 -1
  461. package/dist/browser/modules/support/index.js +1 -1
  462. package/dist/browser/modules/support/mutations/index.js +1 -1
  463. package/dist/browser/modules/support/mutations/update-support-settings.js +1 -1
  464. package/dist/browser/modules/support/queries/get-support-settings-query-options.js +1 -1
  465. package/dist/browser/modules/support/queries/index.js +1 -1
  466. package/dist/browser/modules/wallet/consts/hive-account-operation-groups.js +1 -1
  467. package/dist/browser/modules/wallet/consts/hive-operation-list.js +1 -1
  468. package/dist/browser/modules/wallet/consts/hive-operation-orders.js +1 -1
  469. package/dist/browser/modules/wallet/consts/index.js +1 -1
  470. package/dist/browser/modules/wallet/index.js +1 -1
  471. package/dist/browser/modules/wallet/mutations/index.js +1 -1
  472. package/dist/browser/modules/wallet/mutations/use-claim-engine-rewards.js +1 -1
  473. package/dist/browser/modules/wallet/mutations/use-claim-interest.js +1 -1
  474. package/dist/browser/modules/wallet/mutations/use-claim-rewards.js +1 -1
  475. package/dist/browser/modules/wallet/mutations/use-convert.js +1 -1
  476. package/dist/browser/modules/wallet/mutations/use-delegate-engine-token.js +1 -1
  477. package/dist/browser/modules/wallet/mutations/use-delegate-rc.js +1 -1
  478. package/dist/browser/modules/wallet/mutations/use-delegate-vesting-shares.js +1 -1
  479. package/dist/browser/modules/wallet/mutations/use-engine-market-order.js +1 -1
  480. package/dist/browser/modules/wallet/mutations/use-set-withdraw-vesting-route.js +1 -1
  481. package/dist/browser/modules/wallet/mutations/use-stake-engine-token.js +1 -1
  482. package/dist/browser/modules/wallet/mutations/use-transfer-engine-token.js +1 -1
  483. package/dist/browser/modules/wallet/mutations/use-transfer-from-savings.js +1 -1
  484. package/dist/browser/modules/wallet/mutations/use-transfer-point.js +1 -1
  485. package/dist/browser/modules/wallet/mutations/use-transfer-to-savings.js +1 -1
  486. package/dist/browser/modules/wallet/mutations/use-transfer-to-vesting.js +1 -1
  487. package/dist/browser/modules/wallet/mutations/use-transfer.js +1 -1
  488. package/dist/browser/modules/wallet/mutations/use-undelegate-engine-token.js +1 -1
  489. package/dist/browser/modules/wallet/mutations/use-unstake-engine-token.js +1 -1
  490. package/dist/browser/modules/wallet/mutations/use-wallet-operation.js +1 -1
  491. package/dist/browser/modules/wallet/mutations/use-withdraw-vesting.js +1 -1
  492. package/dist/browser/modules/wallet/queries/get-account-delegations-query-options.js +1 -1
  493. package/dist/browser/modules/wallet/queries/get-account-wallet-asset-info-query-options.js +1 -1
  494. package/dist/browser/modules/wallet/queries/get-collateralized-conversion-requests-query-options.js +1 -1
  495. package/dist/browser/modules/wallet/queries/get-conversion-requests-query-options.js +1 -1
  496. package/dist/browser/modules/wallet/queries/get-hbd-asset-general-info-query-options.js +1 -1
  497. package/dist/browser/modules/wallet/queries/get-hbd-asset-transactions-query-options.js +1 -1
  498. package/dist/browser/modules/wallet/queries/get-hive-asset-general-info-query-options.js +1 -1
  499. package/dist/browser/modules/wallet/queries/get-hive-asset-metric-query-options.js +1 -1
  500. package/dist/browser/modules/wallet/queries/get-hive-asset-transactions-query-options.js +1 -1
  501. package/dist/browser/modules/wallet/queries/get-hive-asset-withdrawal-routes-query-options.js +1 -1
  502. package/dist/browser/modules/wallet/queries/get-hive-power-asset-general-info-query-options.js +1 -1
  503. package/dist/browser/modules/wallet/queries/get-hive-power-asset-transactions-query-options.js +1 -1
  504. package/dist/browser/modules/wallet/queries/get-hive-power-delegates-query-options.js +1 -1
  505. package/dist/browser/modules/wallet/queries/get-hive-power-delegatings-query-options.js +1 -1
  506. package/dist/browser/modules/wallet/queries/get-incoming-rc-query-options.js +1 -1
  507. package/dist/browser/modules/wallet/queries/get-open-orders-query-options.js +1 -1
  508. package/dist/browser/modules/wallet/queries/get-outgoing-rc-delegations-infinite-query-options.js +1 -1
  509. package/dist/browser/modules/wallet/queries/get-portfolio-query-options.js +1 -1
  510. package/dist/browser/modules/wallet/queries/get-received-vesting-shares-query-options.js +1 -1
  511. package/dist/browser/modules/wallet/queries/get-recurrent-transfers-query-options.js +1 -1
  512. package/dist/browser/modules/wallet/queries/get-savings-withdraw-from-query-options.js +1 -1
  513. package/dist/browser/modules/wallet/queries/get-vesting-delegation-expirations-query-options.js +1 -1
  514. package/dist/browser/modules/wallet/queries/get-vesting-delegations-query-options.js +1 -1
  515. package/dist/browser/modules/wallet/queries/get-withdraw-routes-query-options.js +1 -1
  516. package/dist/browser/modules/wallet/queries/index.js +1 -1
  517. package/dist/browser/modules/witnesses/index.js +1 -1
  518. package/dist/browser/modules/witnesses/mutations/index.js +1 -1
  519. package/dist/browser/modules/witnesses/mutations/use-witness-proxy.js +1 -1
  520. package/dist/browser/modules/witnesses/mutations/use-witness-vote.js +1 -1
  521. package/dist/browser/modules/witnesses/queries/get-witnesses-query-options.js +1 -1
  522. package/dist/browser/modules/witnesses/queries/index.js +1 -1
  523. package/dist/node/hive.cjs +2 -2
  524. package/dist/node/hive.cjs.map +1 -1
  525. package/dist/node/hive.mjs +2 -2
  526. package/dist/node/hive.mjs.map +1 -1
  527. package/dist/node/index.cjs +3 -3
  528. package/dist/node/index.cjs.map +1 -1
  529. package/dist/node/index.mjs +3 -3
  530. package/dist/node/index.mjs.map +1 -1
  531. package/package.json +1 -1
  532. package/dist/browser/chunk-LRO6EB5Y.js +0 -2
  533. package/dist/browser/chunk-M63I2JJV.js +0 -2
  534. package/dist/browser/chunk-W6TVTSY5.js +0 -2
  535. package/dist/browser/chunk-W6TVTSY5.js.map +0 -1
  536. package/dist/browser/chunk-Z7R2PK35.js +0 -2
@@ -1,2 +1,2 @@
1
- import {a as a$3}from'./chunk-W6TVTSY5.js';import {j,k as k$1,c}from'./chunk-RAWKN3XW.js';import {a as a$1}from'./chunk-PQSG5K4Y.js';import {a as a$2}from'./chunk-KT7GFFA7.js';import {a}from'./chunk-S364K442.js';import {b as b$1}from'./chunk-OS3FCYZY.js';import {hexToBytes,bytesToHex}from'@noble/hashes/utils.js';import {sha256}from'@noble/hashes/sha2.js';var I=hexToBytes(a.chain_id),w=256,y=64*1024,b=2*1024*1024,N=y-w,S=65,f=class extends Error{constructor(i,r){super(`Transaction too large: ${i} bytes. Hive allows up to ${r} bytes.`);b$1(this,"size");b$1(this,"limit");this.name="TransactionTooLargeError",this.size=i,this.limit=r;}},m=3,k=async()=>{let s=await j("condenser_api.get_dynamic_global_properties",[]),t=s.head_block_number,i=s.head_block_id;try{let a=(await j("condenser_api.get_block_header",[t-m+1],3e3,1))?.previous;typeof a=="string"&&/^[0-9a-f]{40}$/.test(a)&&parseInt(a.slice(0,8),16)===t-m&&(t-=m,i=a);}catch{}let r=hexToBytes(i);return {ref_block_num:t&65535,ref_block_prefix:Number(new Uint32Array(r.buffer,r.byteOffset+4,1)[0]),maximum_block_size:s.maximum_block_size}},x=class s{constructor(t){b$1(this,"transaction");b$1(this,"expiration",6e4);b$1(this,"maximumBlockSize");b$1(this,"txId");b$1(this,"createTransaction",async t=>{let i=await k(),r=new Date(Date.now()+t).toISOString().slice(0,-5);this.maximumBlockSize=i.maximum_block_size,this.transaction={expiration:r,extensions:[],operations:[],ref_block_num:i.ref_block_num,ref_block_prefix:i.ref_block_prefix,signatures:[]};});t?.transaction&&(t.transaction instanceof s?(this.transaction=t.transaction.transaction,this.expiration=t.transaction.expiration,this.maximumBlockSize=t.transaction.maximumBlockSize):this.transaction=t.transaction,this.transaction&&!Array.isArray(this.transaction.signatures)&&(this.transaction.signatures=[]),this.txId=this.digest().txId),t?.expiration&&(this.expiration=t.expiration);}async addOperation(t,i){this.transaction||await this.createTransaction(this.expiration),this.transaction.operations.push([t,i]);}sign(t){if(!this.transaction)throw new Error("First create a transaction by .addOperation()");if(this.transaction){let{digest:i,txId:r}=this.digest();Array.isArray(t)||(t=[t]),this.assertSize(t.length);for(let e of t){let a=e.sign(i);this.transaction.signatures.push(a.customToString());}return this.txId=r,this.transaction}else throw new Error("No transaction to sign")}async broadcast(t=false){if(!this.transaction)throw new Error("Attempted to broadcast an empty transaction. Add operations by .addOperation()");if(this.transaction.signatures.length===0)throw new Error("Attempted to broadcast a transaction with no signatures. Sign using .sign(keys)");try{await k$1("condenser_api.broadcast_transaction",[this.transaction],void 0,void 0,{failoverOnTimeoutUntil:Date.parse(this.transaction.expiration+"Z")-a.broadcastTimeout-5e3});}catch(a){if(!(a instanceof c&&a.message.includes("Duplicate transaction check failed")))throw a}if(this.txId||(this.txId=this.digest().txId),!t)return {tx_id:this.txId,status:"unknown"};let i=60;await a$1(1e3);let r=await this.checkStatus(),e=1;for(;r?.status!=="within_irreversible_block"&&r?.status!=="expired_irreversible"&&r?.status!=="too_old"&&e<i;)await a$1(1e3+e*300),r=await this.checkStatus(),e++;return {tx_id:this.txId,status:r?.status??"unknown"}}digest(){if(!this.transaction)throw new Error("First create a transaction by .addOperation()");let t=this.serialize(),i=bytesToHex(sha256(t)).slice(0,40);return {digest:sha256(new Uint8Array([...I,...t])),txId:i}}size(t=0){let i=(this.transaction?.signatures.length??0)+t,r=1;for(let e=i;e>=128;e>>>=7)r++;return this.serialize().length+r+i*S}assertSize(t=0){let i=this.size(t),r=Number(this.maximumBlockSize),a=(r>=y&&r<=b?r:b)-w;if(i>a)throw new f(i,a)}serialize(){if(!this.transaction)throw new Error("First create a transaction by .addOperation()");let t=new a$2(a$2.DEFAULT_CAPACITY,a$2.LITTLE_ENDIAN),i={...this.transaction};try{a$3.Transaction(t,i);}catch(r){throw new Error("Unable to serialize transaction: "+r)}return t.flip(),new Uint8Array(t.toBuffer())}addSignature(t){if(!this.transaction)throw new Error("First create a transaction by .create(operations)");if(typeof t!="string")throw new Error("Signature must be string");if(t.length!==130)throw new Error("Signature must be 130 characters long");return this.transaction.signatures.push(t),this.transaction}async checkStatus(){return this.txId||(this.txId=this.digest().txId),j("transaction_status_api.find_transaction",{transaction_id:this.txId,expiration:this.transaction?.expiration})}};export{N as a,f as b,k as c,x as d};//# sourceMappingURL=chunk-IMCYKBDV.js.map
2
- //# sourceMappingURL=chunk-IMCYKBDV.js.map
1
+ import {a as a$3}from'./chunk-FJXZ5DK2.js';import {j,k as k$1,c}from'./chunk-RAWKN3XW.js';import {a as a$1}from'./chunk-PQSG5K4Y.js';import {a as a$2}from'./chunk-KT7GFFA7.js';import {a}from'./chunk-S364K442.js';import {b as b$1}from'./chunk-OS3FCYZY.js';import {hexToBytes,bytesToHex}from'@noble/hashes/utils.js';import {sha256}from'@noble/hashes/sha2.js';var I=hexToBytes(a.chain_id),w=256,y=64*1024,b=2*1024*1024,N=y-w,S=65,f=class extends Error{constructor(i,r){super(`Transaction too large: ${i} bytes. Hive allows up to ${r} bytes.`);b$1(this,"size");b$1(this,"limit");this.name="TransactionTooLargeError",this.size=i,this.limit=r;}},m=3,k=async()=>{let s=await j("condenser_api.get_dynamic_global_properties",[]),t=s.head_block_number,i=s.head_block_id;try{let a=(await j("condenser_api.get_block_header",[t-m+1],3e3,1))?.previous;typeof a=="string"&&/^[0-9a-f]{40}$/.test(a)&&parseInt(a.slice(0,8),16)===t-m&&(t-=m,i=a);}catch{}let r=hexToBytes(i);return {ref_block_num:t&65535,ref_block_prefix:Number(new Uint32Array(r.buffer,r.byteOffset+4,1)[0]),maximum_block_size:s.maximum_block_size}},x=class s{constructor(t){b$1(this,"transaction");b$1(this,"expiration",6e4);b$1(this,"maximumBlockSize");b$1(this,"txId");b$1(this,"createTransaction",async t=>{let i=await k(),r=new Date(Date.now()+t).toISOString().slice(0,-5);this.maximumBlockSize=i.maximum_block_size,this.transaction={expiration:r,extensions:[],operations:[],ref_block_num:i.ref_block_num,ref_block_prefix:i.ref_block_prefix,signatures:[]};});t?.transaction&&(t.transaction instanceof s?(this.transaction=t.transaction.transaction,this.expiration=t.transaction.expiration,this.maximumBlockSize=t.transaction.maximumBlockSize):this.transaction=t.transaction,this.transaction&&!Array.isArray(this.transaction.signatures)&&(this.transaction.signatures=[]),this.txId=this.digest().txId),t?.expiration&&(this.expiration=t.expiration);}async addOperation(t,i){this.transaction||await this.createTransaction(this.expiration),this.transaction.operations.push([t,i]);}sign(t){if(!this.transaction)throw new Error("First create a transaction by .addOperation()");if(this.transaction){let{digest:i,txId:r}=this.digest();Array.isArray(t)||(t=[t]),this.assertSize(t.length);for(let e of t){let a=e.sign(i);this.transaction.signatures.push(a.customToString());}return this.txId=r,this.transaction}else throw new Error("No transaction to sign")}async broadcast(t=false){if(!this.transaction)throw new Error("Attempted to broadcast an empty transaction. Add operations by .addOperation()");if(this.transaction.signatures.length===0)throw new Error("Attempted to broadcast a transaction with no signatures. Sign using .sign(keys)");try{await k$1("condenser_api.broadcast_transaction",[this.transaction],void 0,void 0,{failoverOnTimeoutUntil:Date.parse(this.transaction.expiration+"Z")-a.broadcastTimeout-5e3});}catch(a){if(!(a instanceof c&&a.message.includes("Duplicate transaction check failed")))throw a}if(this.txId||(this.txId=this.digest().txId),!t)return {tx_id:this.txId,status:"unknown"};let i=60;await a$1(1e3);let r=await this.checkStatus(),e=1;for(;r?.status!=="within_irreversible_block"&&r?.status!=="expired_irreversible"&&r?.status!=="too_old"&&e<i;)await a$1(1e3+e*300),r=await this.checkStatus(),e++;return {tx_id:this.txId,status:r?.status??"unknown"}}digest(){if(!this.transaction)throw new Error("First create a transaction by .addOperation()");let t=this.serialize(),i=bytesToHex(sha256(t)).slice(0,40);return {digest:sha256(new Uint8Array([...I,...t])),txId:i}}size(t=0){let i=(this.transaction?.signatures.length??0)+t,r=1;for(let e=i;e>=128;e>>>=7)r++;return this.serialize().length+r+i*S}assertSize(t=0){let i=this.size(t),r=Number(this.maximumBlockSize),a=(r>=y&&r<=b?r:b)-w;if(i>a)throw new f(i,a)}serialize(){if(!this.transaction)throw new Error("First create a transaction by .addOperation()");let t=new a$2(a$2.DEFAULT_CAPACITY,a$2.LITTLE_ENDIAN),i={...this.transaction};try{a$3.Transaction(t,i);}catch(r){throw new Error("Unable to serialize transaction: "+r)}return t.flip(),new Uint8Array(t.toBuffer())}addSignature(t){if(!this.transaction)throw new Error("First create a transaction by .create(operations)");if(typeof t!="string")throw new Error("Signature must be string");if(t.length!==130)throw new Error("Signature must be 130 characters long");return this.transaction.signatures.push(t),this.transaction}async checkStatus(){return this.txId||(this.txId=this.digest().txId),j("transaction_status_api.find_transaction",{transaction_id:this.txId,expiration:this.transaction?.expiration})}};export{N as a,f as b,k as c,x as d};//# sourceMappingURL=chunk-WE6EIHC6.js.map
2
+ //# sourceMappingURL=chunk-WE6EIHC6.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hive-tx/Transaction.ts"],"names":["chainId","hexToBytes","config","BLOCK_SIZE_RESERVE","MIN_BLOCK_SIZE_LIMIT","MAX_BLOCK_SIZE","MIN_TRANSACTION_SIZE_LIMIT","SIGNATURE_SIZE","TransactionTooLargeError","size","limit","__publicField","TAPOS_DEPTH","getTransactionReference","props","callRPC","refNum","refId","previous","bytes","Transaction","_Transaction","options","expiration","reference","expirationIso","operationName","operationBody","keys","digest","txId","key","signature","checkStatus","callRPCBroadcast","e","RPCError","maxPollAttempts","sleep","status","i","transactionData","bytesToHex","sha256","extraSignatures","signatures","countBytes","n","voted","buffer","ByteBuffer","temp","Serializer","cause"],"mappings":"qWAiBA,IAAMA,CAAAA,CAAUC,WAAWC,CAAAA,CAAO,QAAQ,EAGpCC,CAAAA,CAAqB,GAAA,CAMrBC,EAAuB,EAAA,CAAK,IAAA,CAC5BC,CAAAA,CAAiB,CAAA,CAAI,KAAO,IAAA,CAMrBC,CAAAA,CAA6BF,EAAuBD,CAAAA,CAG3DI,CAAAA,CAAiB,GAGVC,CAAAA,CAAN,cAAuC,KAAM,CAGlD,WAAA,CAAYC,EAAcC,CAAAA,CAAe,CACvC,MAAM,CAAA,uBAAA,EAA0BD,CAAI,6BAA6BC,CAAK,CAAA,OAAA,CAAS,CAAA,CAHjFC,GAAAA,CAAA,aACAA,GAAAA,CAA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EAA0C,CAC9C,OAAK,IAAA,CAAK,OACR,IAAA,CAAK,IAAA,CAAO,KAAK,MAAA,EAAO,CAAE,MAErBjB,CAAAA,CAAQ,yCAAA,CAA2C,CACxD,cAAA,CAAgB,IAAA,CAAK,KACrB,UAAA,CAAY,IAAA,CAAK,aAAa,UAChC,CAAC,CACH,CAqBF","file":"chunk-IMCYKBDV.js","sourcesContent":["import { bytesToHex, hexToBytes } from '@noble/hashes/utils.js'\nimport { PrivateKey } from './helpers/PrivateKey'\nimport {\n OperationName,\n OperationBody,\n TransactionType,\n TransactionStatus,\n BroadcastResult\n} from './types'\nimport { ByteBuffer } from './helpers/ByteBuffer'\nimport { Serializer } from './helpers/serializer'\nimport { sha256 } from '@noble/hashes/sha2.js'\nimport { config } from './config'\nimport { callRPC, callRPCBroadcast, RPCError } from './helpers/call'\nimport { DigestData } from './types'\nimport { sleep } from './helpers/sleep'\n\nconst chainId = hexToBytes(config.chain_id)\n\n/** hived rejects a signed transaction larger than `maximum_block_size - 256` (database.cpp). */\nconst BLOCK_SIZE_RESERVE = 256\n\n/**\n * Consensus bounds on the witness-voted maximum_block_size\n * (HIVE_MIN_BLOCK_SIZE_LIMIT and HIVE_MAX_BLOCK_SIZE in hived's config.hpp).\n */\nconst MIN_BLOCK_SIZE_LIMIT = 64 * 1024\nconst MAX_BLOCK_SIZE = 2 * 1024 * 1024\n\n/**\n * Size every transaction may have whatever witnesses vote. Only a larger one\n * needs the live maximum_block_size to be judged.\n */\nexport const MIN_TRANSACTION_SIZE_LIMIT = MIN_BLOCK_SIZE_LIMIT - BLOCK_SIZE_RESERVE\n\n/** Serialized bytes one signature adds (compact secp256k1 signature). */\nconst SIGNATURE_SIZE = 65\n\n/** Thrown before signing when a transaction can never be accepted by the chain. */\nexport class TransactionTooLargeError extends Error {\n size: number\n limit: number\n constructor(size: number, limit: number) {\n super(`Transaction too large: ${size} bytes. Hive allows up to ${limit} bytes.`)\n this.name = 'TransactionTooLargeError'\n this.size = size\n this.limit = limit\n }\n}\n\n/**\n * How many blocks behind head a transaction references (TaPoS). The node a\n * broadcast lands on is often not the one that reported the head, and one a\n * block or two behind rejects a reference to a block it has not seen with\n * \"transaction tapos exception\". Three back is a block every live node has.\n */\nconst TAPOS_DEPTH = 3\n\nexport interface TransactionReference {\n ref_block_num: number\n ref_block_prefix: number\n /** The witness-voted block size from the same properties, see Transaction.maximumBlockSize. */\n maximum_block_size?: number\n}\n\n/**\n * The block reference (ref_block_num / ref_block_prefix) for a new transaction:\n * a block TAPOS_DEPTH behind head, whose id comes from the header of the block\n * after it (`previous`). If that header is missing or does not name the\n * expected block, it falls back to the head block, as before.\n */\nexport const getTransactionReference = async (): Promise<TransactionReference> => {\n const props = await callRPC('condenser_api.get_dynamic_global_properties', [])\n let refNum: number = props.head_block_number\n let refId: string = props.head_block_id\n try {\n // Short budget: a slow answer here only delays the broadcast it is for.\n const header = await callRPC('condenser_api.get_block_header', [refNum - TAPOS_DEPTH + 1], 3000, 1)\n const previous = header?.previous\n // A block id starts with its block number, big-endian.\n if (\n typeof previous === 'string' &&\n /^[0-9a-f]{40}$/.test(previous) &&\n parseInt(previous.slice(0, 8), 16) === refNum - TAPOS_DEPTH\n ) {\n refNum -= TAPOS_DEPTH\n refId = previous\n }\n } catch {\n // Keep the head block; the transaction is only more likely to hit a lagging node.\n }\n const bytes = hexToBytes(refId)\n return {\n ref_block_num: refNum & 0xffff,\n ref_block_prefix: Number(new Uint32Array(bytes.buffer, bytes.byteOffset + 4, 1)[0]),\n maximum_block_size: props.maximum_block_size\n }\n}\n\ninterface TransactionOptions {\n transaction?: TransactionType | Transaction\n /**\n * Transaction expiration in milliseconds (ms) - max 86400000 (24 hours)\n * @default 60_000\n */\n expiration?: number\n}\n\nexport class Transaction {\n transaction?: TransactionType\n\n expiration: number = 60_000\n\n /**\n * The chain's witness-voted maximum_block_size, which sets the largest\n * transaction hived accepts. Recorded from the dynamic global properties\n * fetched when the transaction is created; set it yourself for a\n * transaction built elsewhere, or only the protocol ceiling is enforced.\n */\n maximumBlockSize?: number\n\n private txId?: string\n\n constructor(options?: TransactionOptions) {\n if (options?.transaction) {\n if (options.transaction instanceof Transaction) {\n this.transaction = options.transaction.transaction\n this.expiration = options.transaction.expiration\n this.maximumBlockSize = options.transaction.maximumBlockSize\n } else {\n this.transaction = options.transaction\n }\n // A transaction built externally (e.g. from a hive-uri signing request)\n // may omit the `signatures` array. sign(), addSignature() and broadcast()\n // all assume it exists, so normalize it here to avoid\n // \"Cannot read property 'push' of undefined\" on sign.\n if (this.transaction && !Array.isArray(this.transaction.signatures)) {\n this.transaction.signatures = []\n }\n this.txId = this.digest().txId\n }\n if (options?.expiration) {\n this.expiration = options.expiration\n }\n }\n\n /**\n * Adds an operation to the transaction. If no transaction exists, creates one first.\n * @template O Operation name type for type safety\n * @param operationName The name/type of the operation to add (e.g., 'transfer', 'vote', 'comment')\n * @param operationBody The operation data/body for the specified operation type\n * @returns Promise that resolves when the operation is added\n * @throws Error if transaction creation fails or global properties cannot be retrieved\n */\n async addOperation<O extends OperationName>(\n operationName: O,\n operationBody: OperationBody<O>\n ): Promise<void> {\n if (!this.transaction) {\n await this.createTransaction(this.expiration)\n }\n this.transaction!.operations.push([operationName, operationBody])\n }\n\n /**\n * Signs the transaction with the provided key(s), supporting both single and multi-signature transactions.\n * For multi-signature, you can sign with all keys at once or sign individually by calling this method multiple times.\n * @param keys Single PrivateKey or array of PrivateKeys to sign the transaction with\n * @returns The signed transaction\n * @throws Error if no transaction exists to sign\n */\n sign(keys: PrivateKey | PrivateKey[]): TransactionType {\n if (!this.transaction) {\n throw new Error('First create a transaction by .addOperation()')\n }\n if (this.transaction) {\n const { digest, txId } = this.digest()\n if (!Array.isArray(keys)) {\n keys = [keys]\n }\n this.assertSize(keys.length)\n for (const key of keys) {\n const signature = key.sign(digest)\n this.transaction.signatures.push(signature.customToString())\n }\n this.txId = txId\n return this.transaction\n } else {\n throw new Error('No transaction to sign')\n }\n }\n\n /**\n * Broadcasts the signed transaction to the Hive network.\n * Automatically handles retries and duplicate transaction detection.\n * @param checkStatus By default (false) the transaction is not guaranteed to be included in a block.\n * For example the transaction can expire while waiting in mempool.\n * If you pass true here, the function will wait for the transaction to be either included or dropped\n * before returning a result.\n * @returns Promise resolving to broadcast result\n * @throws Error if no transaction exists or transaction is not signed or transaction got rejected\n */\n async broadcast(checkStatus = false): Promise<BroadcastResult> {\n if (!this.transaction) {\n throw new Error(\n 'Attempted to broadcast an empty transaction. Add operations by .addOperation()'\n )\n }\n if (this.transaction.signatures.length === 0) {\n throw new Error(\n 'Attempted to broadcast a transaction with no signatures. Sign using .sign(keys)'\n )\n }\n try {\n // A node that timed out may have taken the transaction; the next one then\n // answers \"Duplicate transaction\", which is ignored below, so failing over\n // on a timeout is safe here, as long as the next attempt can finish (one\n // broadcast timeout plus 5 s of margin) before the transaction expires.\n await callRPCBroadcast('condenser_api.broadcast_transaction', [this.transaction], undefined, undefined, {\n failoverOnTimeoutUntil:\n Date.parse(this.transaction.expiration + 'Z') - config.broadcastTimeout - 5_000\n })\n } catch (e) {\n if (e instanceof RPCError && e.message.includes('Duplicate transaction check failed')) {\n // ignore duplicate transaction error as this can happen when we retry the broadcast\n } else {\n throw e\n }\n }\n if (!this.txId) {\n this.txId = this.digest().txId\n }\n if (!checkStatus) {\n return { tx_id: this.txId, status: 'unknown' }\n }\n // Poll until the transaction reaches a final state or max attempts exceeded.\n // With 60 attempts: delays grow from 1.3s to 19s, total wait ~10 minutes.\n const maxPollAttempts = 60\n await sleep(1000)\n let status = await this.checkStatus()\n let i = 1\n while (\n status?.status !== 'within_irreversible_block' &&\n status?.status !== 'expired_irreversible' &&\n status?.status !== 'too_old' &&\n i < maxPollAttempts\n ) {\n await sleep(1000 + i * 300)\n status = await this.checkStatus()\n i++\n }\n return {\n tx_id: this.txId,\n status: (status?.status ?? 'unknown') as BroadcastResult['status']\n }\n }\n\n /**\n * Returns the transaction digest containing the transaction ID and hash.\n * The digest can be used to verify signatures and for transaction identification.\n * @returns DigestData containing transaction ID and hash\n * @throws Error if no transaction exists\n */\n digest(): DigestData {\n if (!this.transaction) {\n throw new Error('First create a transaction by .addOperation()')\n }\n const transactionData = this.serialize()\n const txId = bytesToHex(sha256(transactionData)).slice(0, 40)\n const digest = sha256(new Uint8Array([...chainId, ...transactionData]))\n return { digest, txId }\n }\n\n /**\n * Serialized size of the transaction once it carries its current signatures\n * plus `extraSignatures` more. This is the size hived checks against\n * `maximum_block_size - 256`.\n */\n size(extraSignatures = 0): number {\n const signatures = (this.transaction?.signatures.length ?? 0) + extraSignatures\n // The signature count is a varint: one byte per 7 bits.\n let countBytes = 1\n for (let n = signatures; n >= 128; n >>>= 7) countBytes++\n return this.serialize().length + countBytes + signatures * SIGNATURE_SIZE\n }\n\n /**\n * Throws TransactionTooLargeError when the transaction, signed with\n * `extraSignatures` more signatures, would exceed what hived accepts under\n * `maximumBlockSize`, or under the largest block size the protocol allows\n * when it is unknown. Such a transaction is rejected by every node, so it\n * must never be signed.\n */\n assertSize(extraSignatures = 0): void {\n const size = this.size(extraSignatures)\n // A value outside the consensus bounds cannot be the chain's; ignore it.\n const voted = Number(this.maximumBlockSize)\n const blockSize =\n voted >= MIN_BLOCK_SIZE_LIMIT && voted <= MAX_BLOCK_SIZE ? voted : MAX_BLOCK_SIZE\n const limit = blockSize - BLOCK_SIZE_RESERVE\n if (size > limit) {\n throw new TransactionTooLargeError(size, limit)\n }\n }\n\n private serialize(): Uint8Array {\n if (!this.transaction) {\n throw new Error('First create a transaction by .addOperation()')\n }\n const buffer = new ByteBuffer(ByteBuffer.DEFAULT_CAPACITY, ByteBuffer.LITTLE_ENDIAN)\n const temp = { ...this.transaction }\n try {\n Serializer.Transaction(buffer, temp)\n } catch (cause) {\n throw new Error('Unable to serialize transaction: ' + cause)\n }\n buffer.flip()\n return new Uint8Array(buffer.toBuffer())\n }\n\n /**\n * Adds a signature to an already created transaction. Useful when signing with external tools.\n * Multiple signatures can be added one at a time for multi-signature transactions.\n * @param signature The signature string in hex format (must be exactly 130 characters)\n * @returns The transaction with the added signature\n * @throws Error if no transaction exists or signature format is invalid\n */\n addSignature(signature: string): TransactionType {\n if (!this.transaction) {\n throw new Error('First create a transaction by .create(operations)')\n }\n if (typeof signature !== 'string') {\n throw new Error('Signature must be string')\n }\n if (signature.length !== 130) {\n throw new Error('Signature must be 130 characters long')\n }\n this.transaction.signatures.push(signature)\n return this.transaction\n }\n\n /** Get status of this transaction. Usually called internally after broadcasting. */\n async checkStatus(): Promise<TransactionStatus> {\n if (!this.txId) {\n this.txId = this.digest().txId\n }\n return callRPC('transaction_status_api.find_transaction', {\n transaction_id: this.txId,\n expiration: this.transaction?.expiration\n })\n }\n\n /**\n * Creates the transaction structure and initializes it with blockchain data.\n * Retrieves current head block information and sets up reference block data.\n * @private\n * @param expiration Transaction expiration in milliseconds\n */\n private createTransaction = async (expiration: number) => {\n const reference = await getTransactionReference()\n const expirationIso = new Date(Date.now() + expiration).toISOString().slice(0, -5)\n this.maximumBlockSize = reference.maximum_block_size\n this.transaction = {\n expiration: expirationIso,\n extensions: [],\n operations: [],\n ref_block_num: reference.ref_block_num,\n ref_block_prefix: reference.ref_block_prefix,\n signatures: []\n }\n }\n}\n"]}
1
+ {"version":3,"sources":["../../src/hive-tx/Transaction.ts"],"names":["chainId","hexToBytes","config","BLOCK_SIZE_RESERVE","MIN_BLOCK_SIZE_LIMIT","MAX_BLOCK_SIZE","MIN_TRANSACTION_SIZE_LIMIT","SIGNATURE_SIZE","TransactionTooLargeError","size","limit","__publicField","TAPOS_DEPTH","getTransactionReference","props","callRPC","refNum","refId","previous","bytes","Transaction","_Transaction","options","expiration","reference","expirationIso","operationName","operationBody","keys","digest","txId","key","signature","checkStatus","callRPCBroadcast","e","RPCError","maxPollAttempts","sleep","status","i","transactionData","bytesToHex","sha256","extraSignatures","signatures","countBytes","n","voted","buffer","ByteBuffer","temp","Serializer","cause"],"mappings":"qWAiBA,IAAMA,CAAAA,CAAUC,WAAWC,CAAAA,CAAO,QAAQ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,CACzC,CASA,YAAA,CAAajB,EAAoC,CAC/C,GAAI,CAAC,IAAA,CAAK,WAAA,CACR,MAAM,IAAI,KAAA,CAAM,mDAAmD,CAAA,CAErE,GAAI,OAAOA,CAAAA,EAAc,QAAA,CACvB,MAAM,IAAI,KAAA,CAAM,0BAA0B,CAAA,CAE5C,GAAIA,CAAAA,CAAU,MAAA,GAAW,IACvB,MAAM,IAAI,MAAM,uCAAuC,CAAA,CAEzD,YAAK,WAAA,CAAY,UAAA,CAAW,KAAKA,CAAS,CAAA,CACnC,KAAK,WACd,CAGA,MAAM,WAAA,EAA0C,CAC9C,OAAK,IAAA,CAAK,OACR,IAAA,CAAK,IAAA,CAAO,KAAK,MAAA,EAAO,CAAE,MAErBjB,CAAAA,CAAQ,yCAAA,CAA2C,CACxD,cAAA,CAAgB,IAAA,CAAK,KACrB,UAAA,CAAY,IAAA,CAAK,aAAa,UAChC,CAAC,CACH,CAqBF","file":"chunk-WE6EIHC6.js","sourcesContent":["import { bytesToHex, hexToBytes } from '@noble/hashes/utils.js'\nimport { PrivateKey } from './helpers/PrivateKey'\nimport {\n OperationName,\n OperationBody,\n TransactionType,\n TransactionStatus,\n BroadcastResult\n} from './types'\nimport { ByteBuffer } from './helpers/ByteBuffer'\nimport { Serializer } from './helpers/serializer'\nimport { sha256 } from '@noble/hashes/sha2.js'\nimport { config } from './config'\nimport { callRPC, callRPCBroadcast, RPCError } from './helpers/call'\nimport { DigestData } from './types'\nimport { sleep } from './helpers/sleep'\n\nconst chainId = hexToBytes(config.chain_id)\n\n/** hived rejects a signed transaction larger than `maximum_block_size - 256` (database.cpp). */\nconst BLOCK_SIZE_RESERVE = 256\n\n/**\n * Consensus bounds on the witness-voted maximum_block_size\n * (HIVE_MIN_BLOCK_SIZE_LIMIT and HIVE_MAX_BLOCK_SIZE in hived's config.hpp).\n */\nconst MIN_BLOCK_SIZE_LIMIT = 64 * 1024\nconst MAX_BLOCK_SIZE = 2 * 1024 * 1024\n\n/**\n * Size every transaction may have whatever witnesses vote. Only a larger one\n * needs the live maximum_block_size to be judged.\n */\nexport const MIN_TRANSACTION_SIZE_LIMIT = MIN_BLOCK_SIZE_LIMIT - BLOCK_SIZE_RESERVE\n\n/** Serialized bytes one signature adds (compact secp256k1 signature). */\nconst SIGNATURE_SIZE = 65\n\n/** Thrown before signing when a transaction can never be accepted by the chain. */\nexport class TransactionTooLargeError extends Error {\n size: number\n limit: number\n constructor(size: number, limit: number) {\n super(`Transaction too large: ${size} bytes. Hive allows up to ${limit} bytes.`)\n this.name = 'TransactionTooLargeError'\n this.size = size\n this.limit = limit\n }\n}\n\n/**\n * How many blocks behind head a transaction references (TaPoS). The node a\n * broadcast lands on is often not the one that reported the head, and one a\n * block or two behind rejects a reference to a block it has not seen with\n * \"transaction tapos exception\". Three back is a block every live node has.\n */\nconst TAPOS_DEPTH = 3\n\nexport interface TransactionReference {\n ref_block_num: number\n ref_block_prefix: number\n /** The witness-voted block size from the same properties, see Transaction.maximumBlockSize. */\n maximum_block_size?: number\n}\n\n/**\n * The block reference (ref_block_num / ref_block_prefix) for a new transaction:\n * a block TAPOS_DEPTH behind head, whose id comes from the header of the block\n * after it (`previous`). If that header is missing or does not name the\n * expected block, it falls back to the head block, as before.\n */\nexport const getTransactionReference = async (): Promise<TransactionReference> => {\n const props = await callRPC('condenser_api.get_dynamic_global_properties', [])\n let refNum: number = props.head_block_number\n let refId: string = props.head_block_id\n try {\n // Short budget: a slow answer here only delays the broadcast it is for.\n const header = await callRPC('condenser_api.get_block_header', [refNum - TAPOS_DEPTH + 1], 3000, 1)\n const previous = header?.previous\n // A block id starts with its block number, big-endian.\n if (\n typeof previous === 'string' &&\n /^[0-9a-f]{40}$/.test(previous) &&\n parseInt(previous.slice(0, 8), 16) === refNum - TAPOS_DEPTH\n ) {\n refNum -= TAPOS_DEPTH\n refId = previous\n }\n } catch {\n // Keep the head block; the transaction is only more likely to hit a lagging node.\n }\n const bytes = hexToBytes(refId)\n return {\n ref_block_num: refNum & 0xffff,\n ref_block_prefix: Number(new Uint32Array(bytes.buffer, bytes.byteOffset + 4, 1)[0]),\n maximum_block_size: props.maximum_block_size\n }\n}\n\ninterface TransactionOptions {\n transaction?: TransactionType | Transaction\n /**\n * Transaction expiration in milliseconds (ms) - max 86400000 (24 hours)\n * @default 60_000\n */\n expiration?: number\n}\n\nexport class Transaction {\n transaction?: TransactionType\n\n expiration: number = 60_000\n\n /**\n * The chain's witness-voted maximum_block_size, which sets the largest\n * transaction hived accepts. Recorded from the dynamic global properties\n * fetched when the transaction is created; set it yourself for a\n * transaction built elsewhere, or only the protocol ceiling is enforced.\n */\n maximumBlockSize?: number\n\n private txId?: string\n\n constructor(options?: TransactionOptions) {\n if (options?.transaction) {\n if (options.transaction instanceof Transaction) {\n this.transaction = options.transaction.transaction\n this.expiration = options.transaction.expiration\n this.maximumBlockSize = options.transaction.maximumBlockSize\n } else {\n this.transaction = options.transaction\n }\n // A transaction built externally (e.g. from a hive-uri signing request)\n // may omit the `signatures` array. sign(), addSignature() and broadcast()\n // all assume it exists, so normalize it here to avoid\n // \"Cannot read property 'push' of undefined\" on sign.\n if (this.transaction && !Array.isArray(this.transaction.signatures)) {\n this.transaction.signatures = []\n }\n this.txId = this.digest().txId\n }\n if (options?.expiration) {\n this.expiration = options.expiration\n }\n }\n\n /**\n * Adds an operation to the transaction. If no transaction exists, creates one first.\n * @template O Operation name type for type safety\n * @param operationName The name/type of the operation to add (e.g., 'transfer', 'vote', 'comment')\n * @param operationBody The operation data/body for the specified operation type\n * @returns Promise that resolves when the operation is added\n * @throws Error if transaction creation fails or global properties cannot be retrieved\n */\n async addOperation<O extends OperationName>(\n operationName: O,\n operationBody: OperationBody<O>\n ): Promise<void> {\n if (!this.transaction) {\n await this.createTransaction(this.expiration)\n }\n this.transaction!.operations.push([operationName, operationBody])\n }\n\n /**\n * Signs the transaction with the provided key(s), supporting both single and multi-signature transactions.\n * For multi-signature, you can sign with all keys at once or sign individually by calling this method multiple times.\n * @param keys Single PrivateKey or array of PrivateKeys to sign the transaction with\n * @returns The signed transaction\n * @throws Error if no transaction exists to sign\n */\n sign(keys: PrivateKey | PrivateKey[]): TransactionType {\n if (!this.transaction) {\n throw new Error('First create a transaction by .addOperation()')\n }\n if (this.transaction) {\n const { digest, txId } = this.digest()\n if (!Array.isArray(keys)) {\n keys = [keys]\n }\n this.assertSize(keys.length)\n for (const key of keys) {\n const signature = key.sign(digest)\n this.transaction.signatures.push(signature.customToString())\n }\n this.txId = txId\n return this.transaction\n } else {\n throw new Error('No transaction to sign')\n }\n }\n\n /**\n * Broadcasts the signed transaction to the Hive network.\n * Automatically handles retries and duplicate transaction detection.\n * @param checkStatus By default (false) the transaction is not guaranteed to be included in a block.\n * For example the transaction can expire while waiting in mempool.\n * If you pass true here, the function will wait for the transaction to be either included or dropped\n * before returning a result.\n * @returns Promise resolving to broadcast result\n * @throws Error if no transaction exists or transaction is not signed or transaction got rejected\n */\n async broadcast(checkStatus = false): Promise<BroadcastResult> {\n if (!this.transaction) {\n throw new Error(\n 'Attempted to broadcast an empty transaction. Add operations by .addOperation()'\n )\n }\n if (this.transaction.signatures.length === 0) {\n throw new Error(\n 'Attempted to broadcast a transaction with no signatures. Sign using .sign(keys)'\n )\n }\n try {\n // A node that timed out may have taken the transaction; the next one then\n // answers \"Duplicate transaction\", which is ignored below, so failing over\n // on a timeout is safe here, as long as the next attempt can finish (one\n // broadcast timeout plus 5 s of margin) before the transaction expires.\n await callRPCBroadcast('condenser_api.broadcast_transaction', [this.transaction], undefined, undefined, {\n failoverOnTimeoutUntil:\n Date.parse(this.transaction.expiration + 'Z') - config.broadcastTimeout - 5_000\n })\n } catch (e) {\n if (e instanceof RPCError && e.message.includes('Duplicate transaction check failed')) {\n // ignore duplicate transaction error as this can happen when we retry the broadcast\n } else {\n throw e\n }\n }\n if (!this.txId) {\n this.txId = this.digest().txId\n }\n if (!checkStatus) {\n return { tx_id: this.txId, status: 'unknown' }\n }\n // Poll until the transaction reaches a final state or max attempts exceeded.\n // With 60 attempts: delays grow from 1.3s to 19s, total wait ~10 minutes.\n const maxPollAttempts = 60\n await sleep(1000)\n let status = await this.checkStatus()\n let i = 1\n while (\n status?.status !== 'within_irreversible_block' &&\n status?.status !== 'expired_irreversible' &&\n status?.status !== 'too_old' &&\n i < maxPollAttempts\n ) {\n await sleep(1000 + i * 300)\n status = await this.checkStatus()\n i++\n }\n return {\n tx_id: this.txId,\n status: (status?.status ?? 'unknown') as BroadcastResult['status']\n }\n }\n\n /**\n * Returns the transaction digest containing the transaction ID and hash.\n * The digest can be used to verify signatures and for transaction identification.\n * @returns DigestData containing transaction ID and hash\n * @throws Error if no transaction exists\n */\n digest(): DigestData {\n if (!this.transaction) {\n throw new Error('First create a transaction by .addOperation()')\n }\n const transactionData = this.serialize()\n const txId = bytesToHex(sha256(transactionData)).slice(0, 40)\n const digest = sha256(new Uint8Array([...chainId, ...transactionData]))\n return { digest, txId }\n }\n\n /**\n * Serialized size of the transaction once it carries its current signatures\n * plus `extraSignatures` more. This is the size hived checks against\n * `maximum_block_size - 256`.\n */\n size(extraSignatures = 0): number {\n const signatures = (this.transaction?.signatures.length ?? 0) + extraSignatures\n // The signature count is a varint: one byte per 7 bits.\n let countBytes = 1\n for (let n = signatures; n >= 128; n >>>= 7) countBytes++\n return this.serialize().length + countBytes + signatures * SIGNATURE_SIZE\n }\n\n /**\n * Throws TransactionTooLargeError when the transaction, signed with\n * `extraSignatures` more signatures, would exceed what hived accepts under\n * `maximumBlockSize`, or under the largest block size the protocol allows\n * when it is unknown. Such a transaction is rejected by every node, so it\n * must never be signed.\n */\n assertSize(extraSignatures = 0): void {\n const size = this.size(extraSignatures)\n // A value outside the consensus bounds cannot be the chain's; ignore it.\n const voted = Number(this.maximumBlockSize)\n const blockSize =\n voted >= MIN_BLOCK_SIZE_LIMIT && voted <= MAX_BLOCK_SIZE ? voted : MAX_BLOCK_SIZE\n const limit = blockSize - BLOCK_SIZE_RESERVE\n if (size > limit) {\n throw new TransactionTooLargeError(size, limit)\n }\n }\n\n private serialize(): Uint8Array {\n if (!this.transaction) {\n throw new Error('First create a transaction by .addOperation()')\n }\n const buffer = new ByteBuffer(ByteBuffer.DEFAULT_CAPACITY, ByteBuffer.LITTLE_ENDIAN)\n const temp = { ...this.transaction }\n try {\n Serializer.Transaction(buffer, temp)\n } catch (cause) {\n throw new Error('Unable to serialize transaction: ' + cause)\n }\n buffer.flip()\n return new Uint8Array(buffer.toBuffer())\n }\n\n /**\n * Adds a signature to an already created transaction. Useful when signing with external tools.\n * Multiple signatures can be added one at a time for multi-signature transactions.\n * @param signature The signature string in hex format (must be exactly 130 characters)\n * @returns The transaction with the added signature\n * @throws Error if no transaction exists or signature format is invalid\n */\n addSignature(signature: string): TransactionType {\n if (!this.transaction) {\n throw new Error('First create a transaction by .create(operations)')\n }\n if (typeof signature !== 'string') {\n throw new Error('Signature must be string')\n }\n if (signature.length !== 130) {\n throw new Error('Signature must be 130 characters long')\n }\n this.transaction.signatures.push(signature)\n return this.transaction\n }\n\n /** Get status of this transaction. Usually called internally after broadcasting. */\n async checkStatus(): Promise<TransactionStatus> {\n if (!this.txId) {\n this.txId = this.digest().txId\n }\n return callRPC('transaction_status_api.find_transaction', {\n transaction_id: this.txId,\n expiration: this.transaction?.expiration\n })\n }\n\n /**\n * Creates the transaction structure and initializes it with blockchain data.\n * Retrieves current head block information and sets up reference block data.\n * @private\n * @param expiration Transaction expiration in milliseconds\n */\n private createTransaction = async (expiration: number) => {\n const reference = await getTransactionReference()\n const expirationIso = new Date(Date.now() + expiration).toISOString().slice(0, -5)\n this.maximumBlockSize = reference.maximum_block_size\n this.transaction = {\n expiration: expirationIso,\n extensions: [],\n operations: [],\n ref_block_num: reference.ref_block_num,\n ref_block_prefix: reference.ref_block_prefix,\n signatures: []\n }\n }\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {e}from'./chunk-6PK5KYS5.js';var r=e.operations,_={transfers:[r.transfer,r.transfer_to_savings,r.transfer_from_savings,r.cancel_transfer_from_savings,r.recurrent_transfer,r.fill_recurrent_transfer,r.escrow_transfer,r.fill_recurrent_transfer],"market-orders":[r.fill_convert_request,r.fill_order,r.fill_collateralized_convert_request,r.limit_order_create2,r.limit_order_create,r.limit_order_cancel],interests:[r.interest],"stake-operations":[r.return_vesting_delegation,r.withdraw_vesting,r.transfer_to_vesting,r.set_withdraw_vesting_route,r.update_proposal_votes,r.fill_vesting_withdraw,r.account_witness_proxy,r.delegate_vesting_shares],rewards:[r.author_reward,r.curation_reward,r.producer_reward,r.claim_reward_balance,r.comment_benefactor_reward,r.liquidity_reward,r.proposal_pay],"":[]};export{_ as a};//# sourceMappingURL=chunk-CFHER3WM.js.map
2
- //# sourceMappingURL=chunk-CFHER3WM.js.map
1
+ import {e}from'./chunk-XX32ZFT4.js';var r=e.operations,_={transfers:[r.transfer,r.transfer_to_savings,r.transfer_from_savings,r.cancel_transfer_from_savings,r.recurrent_transfer,r.fill_recurrent_transfer,r.escrow_transfer,r.fill_recurrent_transfer],"market-orders":[r.fill_convert_request,r.fill_order,r.fill_collateralized_convert_request,r.limit_order_create2,r.limit_order_create,r.limit_order_cancel],interests:[r.interest],"stake-operations":[r.return_vesting_delegation,r.withdraw_vesting,r.transfer_to_vesting,r.set_withdraw_vesting_route,r.update_proposal_votes,r.fill_vesting_withdraw,r.account_witness_proxy,r.delegate_vesting_shares],rewards:[r.author_reward,r.curation_reward,r.producer_reward,r.claim_reward_balance,r.comment_benefactor_reward,r.liquidity_reward,r.proposal_pay],"":[]};export{_ as a};//# sourceMappingURL=chunk-WGKD2O73.js.map
2
+ //# sourceMappingURL=chunk-WGKD2O73.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/wallet/consts/hive-account-operation-groups.ts"],"names":["ops","utils_exports","HIVE_ACCOUNT_OPERATION_GROUPS"],"mappings":"oCAEA,IAAMA,EAAMC,CAAAA,CAAM,UAAA,CAELC,CAAAA,CAGT,CACF,UAAW,CACTF,CAAAA,CAAI,QAAA,CACJA,CAAAA,CAAI,oBACJA,CAAAA,CAAI,qBAAA,CACJA,EAAI,4BAAA,CACJA,CAAAA,CAAI,mBACJA,CAAAA,CAAI,uBAAA,CACJA,CAAAA,CAAI,eAAA,CACJA,EAAI,uBACN,CAAA,CACA,gBAAiB,CACfA,CAAAA,CAAI,qBACJA,CAAAA,CAAI,UAAA,CACJA,CAAAA,CAAI,mCAAA,CACJA,EAAI,mBAAA,CACJA,CAAAA,CAAI,mBACJA,CAAAA,CAAI,kBACN,EACA,SAAA,CAAW,CAACA,CAAAA,CAAI,QAAQ,EACxB,kBAAA,CAAoB,CAClBA,CAAAA,CAAI,yBAAA,CACJA,EAAI,gBAAA,CACJA,CAAAA,CAAI,mBAAA,CACJA,CAAAA,CAAI,2BACJA,CAAAA,CAAI,qBAAA,CACJA,EAAI,qBAAA,CACJA,CAAAA,CAAI,sBACJA,CAAAA,CAAI,uBACN,CAAA,CACA,OAAA,CAAS,CACPA,CAAAA,CAAI,aAAA,CACJA,EAAI,eAAA,CACJA,CAAAA,CAAI,gBACJA,CAAAA,CAAI,oBAAA,CACJA,CAAAA,CAAI,yBAAA,CACJA,EAAI,gBAAA,CACJA,CAAAA,CAAI,YACN,CAAA,CACA,EAAA,CAAI,EACN","file":"chunk-CFHER3WM.js","sourcesContent":["import { utils } from \"../../../hive-tx\";\nimport { HiveOperationGroup } from \"../types\";\nconst ops = utils.operations;\n\nexport const HIVE_ACCOUNT_OPERATION_GROUPS: Record<\n HiveOperationGroup,\n number[]\n> = {\n transfers: [\n ops.transfer,\n ops.transfer_to_savings,\n ops.transfer_from_savings,\n ops.cancel_transfer_from_savings,\n ops.recurrent_transfer,\n ops.fill_recurrent_transfer,\n ops.escrow_transfer,\n ops.fill_recurrent_transfer,\n ],\n \"market-orders\": [\n ops.fill_convert_request,\n ops.fill_order,\n ops.fill_collateralized_convert_request,\n ops.limit_order_create2,\n ops.limit_order_create,\n ops.limit_order_cancel,\n ],\n interests: [ops.interest],\n \"stake-operations\": [\n ops.return_vesting_delegation,\n ops.withdraw_vesting,\n ops.transfer_to_vesting,\n ops.set_withdraw_vesting_route,\n ops.update_proposal_votes,\n ops.fill_vesting_withdraw,\n ops.account_witness_proxy,\n ops.delegate_vesting_shares,\n ],\n rewards: [\n ops.author_reward,\n ops.curation_reward,\n ops.producer_reward,\n ops.claim_reward_balance,\n ops.comment_benefactor_reward,\n ops.liquidity_reward,\n ops.proposal_pay,\n ],\n \"\": [],\n};\n"]}
1
+ {"version":3,"sources":["../../src/modules/wallet/consts/hive-account-operation-groups.ts"],"names":["ops","utils_exports","HIVE_ACCOUNT_OPERATION_GROUPS"],"mappings":"oCAEA,IAAMA,EAAMC,CAAAA,CAAM,UAAA,CAELC,CAAAA,CAGT,CACF,UAAW,CACTF,CAAAA,CAAI,QAAA,CACJA,CAAAA,CAAI,oBACJA,CAAAA,CAAI,qBAAA,CACJA,EAAI,4BAAA,CACJA,CAAAA,CAAI,mBACJA,CAAAA,CAAI,uBAAA,CACJA,CAAAA,CAAI,eAAA,CACJA,EAAI,uBACN,CAAA,CACA,gBAAiB,CACfA,CAAAA,CAAI,qBACJA,CAAAA,CAAI,UAAA,CACJA,CAAAA,CAAI,mCAAA,CACJA,EAAI,mBAAA,CACJA,CAAAA,CAAI,mBACJA,CAAAA,CAAI,kBACN,EACA,SAAA,CAAW,CAACA,CAAAA,CAAI,QAAQ,EACxB,kBAAA,CAAoB,CAClBA,CAAAA,CAAI,yBAAA,CACJA,EAAI,gBAAA,CACJA,CAAAA,CAAI,mBAAA,CACJA,CAAAA,CAAI,2BACJA,CAAAA,CAAI,qBAAA,CACJA,EAAI,qBAAA,CACJA,CAAAA,CAAI,sBACJA,CAAAA,CAAI,uBACN,CAAA,CACA,OAAA,CAAS,CACPA,CAAAA,CAAI,aAAA,CACJA,EAAI,eAAA,CACJA,CAAAA,CAAI,gBACJA,CAAAA,CAAI,oBAAA,CACJA,CAAAA,CAAI,yBAAA,CACJA,EAAI,gBAAA,CACJA,CAAAA,CAAI,YACN,CAAA,CACA,EAAA,CAAI,EACN","file":"chunk-WGKD2O73.js","sourcesContent":["import { utils } from \"../../../hive-tx\";\nimport { HiveOperationGroup } from \"../types\";\nconst ops = utils.operations;\n\nexport const HIVE_ACCOUNT_OPERATION_GROUPS: Record<\n HiveOperationGroup,\n number[]\n> = {\n transfers: [\n ops.transfer,\n ops.transfer_to_savings,\n ops.transfer_from_savings,\n ops.cancel_transfer_from_savings,\n ops.recurrent_transfer,\n ops.fill_recurrent_transfer,\n ops.escrow_transfer,\n ops.fill_recurrent_transfer,\n ],\n \"market-orders\": [\n ops.fill_convert_request,\n ops.fill_order,\n ops.fill_collateralized_convert_request,\n ops.limit_order_create2,\n ops.limit_order_create,\n ops.limit_order_cancel,\n ],\n interests: [ops.interest],\n \"stake-operations\": [\n ops.return_vesting_delegation,\n ops.withdraw_vesting,\n ops.transfer_to_vesting,\n ops.set_withdraw_vesting_route,\n ops.update_proposal_votes,\n ops.fill_vesting_withdraw,\n ops.account_witness_proxy,\n ops.delegate_vesting_shares,\n ],\n rewards: [\n ops.author_reward,\n ops.curation_reward,\n ops.producer_reward,\n ops.claim_reward_balance,\n ops.comment_benefactor_reward,\n ops.liquidity_reward,\n ops.proposal_pay,\n ],\n \"\": [],\n};\n"]}
@@ -1,2 +1,2 @@
1
- import {b as b$1}from'./chunk-CNB64U7U.js';import {b}from'./chunk-J2HM6MWA.js';import {a}from'./chunk-WTHEQ3M5.js';function l(t,i,a$1){return b(["wallet","stake-engine-token"],t,o=>{let e=JSON.stringify({contractName:"tokens",contractAction:"stake",contractPayload:{symbol:o.symbol,to:o.to,quantity:o.quantity}});return [["custom_json",{id:"ssc-mainnet-hive",required_auths:[t],required_posting_auths:[],json:e}]]},async(o,e)=>{await b$1(i?.adapter,a$1,[a.accounts.full(t),a.accounts.full(e.to),["ecency-wallets","asset-info",t],["wallet","portfolio","v2",t]]);},i,"active",{broadcastMode:a$1})}export{l as a};//# sourceMappingURL=chunk-VOET5ABO.js.map
2
- //# sourceMappingURL=chunk-VOET5ABO.js.map
1
+ import {b as b$1}from'./chunk-CNB64U7U.js';import {b}from'./chunk-PFVWZI3W.js';import {a}from'./chunk-WTHEQ3M5.js';function l(t,i,a$1){return b(["wallet","stake-engine-token"],t,o=>{let e=JSON.stringify({contractName:"tokens",contractAction:"stake",contractPayload:{symbol:o.symbol,to:o.to,quantity:o.quantity}});return [["custom_json",{id:"ssc-mainnet-hive",required_auths:[t],required_posting_auths:[],json:e}]]},async(o,e)=>{await b$1(i?.adapter,a$1,[a.accounts.full(t),a.accounts.full(e.to),["ecency-wallets","asset-info",t],["wallet","portfolio","v2",t]]);},i,"active",{broadcastMode:a$1})}export{l as a};//# sourceMappingURL=chunk-WHH45AA3.js.map
2
+ //# sourceMappingURL=chunk-WHH45AA3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/wallet/mutations/use-stake-engine-token.ts"],"names":["useStakeEngineToken","username","auth","broadcastMode","useBroadcastMutation","payload","json","_result","variables","invalidateAfterBroadcast","QueryKeys"],"mappings":"mHAYO,SAASA,CAAAA,CAAoBC,EAA8BC,CAAAA,CAChEC,GAAAA,CACA,CACA,OAAOC,CAAAA,CACL,CAAC,QAAA,CAAU,oBAAoB,EAC/BH,CAAAA,CACCI,CAAAA,EAAY,CACX,IAAMC,CAAAA,CAAO,KAAK,SAAA,CAAU,CAC1B,YAAA,CAAc,QAAA,CACd,cAAA,CAAgB,OAAA,CAChB,gBAAiB,CACf,MAAA,CAAQD,EAAQ,MAAA,CAChB,EAAA,CAAIA,EAAQ,EAAA,CACZ,QAAA,CAAUA,CAAAA,CAAQ,QACpB,CACF,CAAC,EACD,OAAO,CAAC,CAAC,aAAA,CAAe,CACtB,GAAI,kBAAA,CACJ,cAAA,CAAgB,CAACJ,CAAS,CAAA,CAC1B,sBAAA,CAAwB,EAAC,CACzB,IAAA,CAAAK,CACF,CAAC,CAAc,CACjB,CAAA,CACA,MAAOC,EAASC,CAAAA,GAAc,CAC5B,MAAMC,GAAAA,CAAyBP,CAAAA,EAAM,QAASC,GAAAA,CAAe,CAC3DO,EAAU,QAAA,CAAS,IAAA,CAAKT,CAAQ,CAAA,CAChCS,CAAAA,CAAU,QAAA,CAAS,KAAKF,CAAAA,CAAU,EAAE,EACpC,CAAC,gBAAA,CAAkB,aAAcP,CAAQ,CAAA,CACzC,CAAC,QAAA,CAAU,WAAA,CAAa,IAAA,CAAMA,CAAQ,CACxC,CAAC,EACH,CAAA,CACAC,CAAAA,CACA,SACA,CAAE,aAAA,CAAAC,GAAc,CAClB,CACF","file":"chunk-VOET5ABO.js","sourcesContent":["import { useBroadcastMutation, invalidateAfterBroadcast } from \"@/modules/core/mutations\";\nimport type { BroadcastMode } from \"@/modules/core/mutations\";\nimport { QueryKeys } from \"@/modules/core\";\nimport type { AuthContextV2 } from \"@/modules/core/types\";\nimport type { Operation } from \"../../../hive-tx\";\n\nexport interface StakeEngineTokenPayload {\n to: string;\n symbol: string;\n quantity: string;\n}\n\nexport function useStakeEngineToken(username: string | undefined, auth?: AuthContextV2,\n broadcastMode?: BroadcastMode\n) {\n return useBroadcastMutation<StakeEngineTokenPayload>(\n [\"wallet\", \"stake-engine-token\"],\n username,\n (payload) => {\n const json = JSON.stringify({\n contractName: \"tokens\",\n contractAction: \"stake\",\n contractPayload: {\n symbol: payload.symbol,\n to: payload.to,\n quantity: payload.quantity,\n }\n });\n return [[\"custom_json\", {\n id: \"ssc-mainnet-hive\",\n required_auths: [username!],\n required_posting_auths: [],\n json,\n }] as Operation];\n },\n async (_result, variables) => {\n await invalidateAfterBroadcast(auth?.adapter, broadcastMode, [\n QueryKeys.accounts.full(username),\n QueryKeys.accounts.full(variables.to),\n [\"ecency-wallets\", \"asset-info\", username],\n [\"wallet\", \"portfolio\", \"v2\", username]\n ]);\n },\n auth,\n 'active',\n { broadcastMode }\n );\n}\n"]}
1
+ {"version":3,"sources":["../../src/modules/wallet/mutations/use-stake-engine-token.ts"],"names":["useStakeEngineToken","username","auth","broadcastMode","useBroadcastMutation","payload","json","_result","variables","invalidateAfterBroadcast","QueryKeys"],"mappings":"mHAYO,SAASA,CAAAA,CAAoBC,EAA8BC,CAAAA,CAChEC,GAAAA,CACA,CACA,OAAOC,CAAAA,CACL,CAAC,QAAA,CAAU,oBAAoB,EAC/BH,CAAAA,CACCI,CAAAA,EAAY,CACX,IAAMC,CAAAA,CAAO,KAAK,SAAA,CAAU,CAC1B,YAAA,CAAc,QAAA,CACd,cAAA,CAAgB,OAAA,CAChB,gBAAiB,CACf,MAAA,CAAQD,EAAQ,MAAA,CAChB,EAAA,CAAIA,EAAQ,EAAA,CACZ,QAAA,CAAUA,CAAAA,CAAQ,QACpB,CACF,CAAC,EACD,OAAO,CAAC,CAAC,aAAA,CAAe,CACtB,GAAI,kBAAA,CACJ,cAAA,CAAgB,CAACJ,CAAS,CAAA,CAC1B,sBAAA,CAAwB,EAAC,CACzB,IAAA,CAAAK,CACF,CAAC,CAAc,CACjB,CAAA,CACA,MAAOC,EAASC,CAAAA,GAAc,CAC5B,MAAMC,GAAAA,CAAyBP,CAAAA,EAAM,QAASC,GAAAA,CAAe,CAC3DO,EAAU,QAAA,CAAS,IAAA,CAAKT,CAAQ,CAAA,CAChCS,CAAAA,CAAU,QAAA,CAAS,KAAKF,CAAAA,CAAU,EAAE,EACpC,CAAC,gBAAA,CAAkB,aAAcP,CAAQ,CAAA,CACzC,CAAC,QAAA,CAAU,WAAA,CAAa,IAAA,CAAMA,CAAQ,CACxC,CAAC,EACH,CAAA,CACAC,CAAAA,CACA,SACA,CAAE,aAAA,CAAAC,GAAc,CAClB,CACF","file":"chunk-WHH45AA3.js","sourcesContent":["import { useBroadcastMutation, invalidateAfterBroadcast } from \"@/modules/core/mutations\";\nimport type { BroadcastMode } from \"@/modules/core/mutations\";\nimport { QueryKeys } from \"@/modules/core\";\nimport type { AuthContextV2 } from \"@/modules/core/types\";\nimport type { Operation } from \"../../../hive-tx\";\n\nexport interface StakeEngineTokenPayload {\n to: string;\n symbol: string;\n quantity: string;\n}\n\nexport function useStakeEngineToken(username: string | undefined, auth?: AuthContextV2,\n broadcastMode?: BroadcastMode\n) {\n return useBroadcastMutation<StakeEngineTokenPayload>(\n [\"wallet\", \"stake-engine-token\"],\n username,\n (payload) => {\n const json = JSON.stringify({\n contractName: \"tokens\",\n contractAction: \"stake\",\n contractPayload: {\n symbol: payload.symbol,\n to: payload.to,\n quantity: payload.quantity,\n }\n });\n return [[\"custom_json\", {\n id: \"ssc-mainnet-hive\",\n required_auths: [username!],\n required_posting_auths: [],\n json,\n }] as Operation];\n },\n async (_result, variables) => {\n await invalidateAfterBroadcast(auth?.adapter, broadcastMode, [\n QueryKeys.accounts.full(username),\n QueryKeys.accounts.full(variables.to),\n [\"ecency-wallets\", \"asset-info\", username],\n [\"wallet\", \"portfolio\", \"v2\", username]\n ]);\n },\n auth,\n 'active',\n { broadcastMode }\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {c,b}from'./chunk-32QJ72HH.js';import {a}from'./chunk-WTHEQ3M5.js';import {e}from'./chunk-6PK5KYS5.js';import {l}from'./chunk-RAWKN3XW.js';import {infiniteQueryOptions}from'@tanstack/react-query';var r=e.operations,x={transfers:[r.transfer,r.transfer_to_savings,r.transfer_from_savings,r.cancel_transfer_from_savings,r.fill_transfer_from_savings,r.recurrent_transfer,r.fill_recurrent_transfer,r.escrow_transfer],"market-orders":[r.fill_convert_request,r.fill_order,r.fill_collateralized_convert_request,r.limit_order_create2,r.limit_order_create,r.limit_order_cancel],interests:[r.interest],"stake-operations":[r.return_vesting_delegation,r.withdraw_vesting,r.transfer_to_vesting,r.set_withdraw_vesting_route,r.update_proposal_votes,r.fill_vesting_withdraw,r.account_witness_proxy,r.delegate_vesting_shares],rewards:[r.author_reward,r.curation_reward,r.producer_reward,r.claim_reward_balance,r.comment_benefactor_reward,r.liquidity_reward,r.proposal_pay]},O=Array.from(new Set(Object.values(x).flat()));function h(e){return e.block*1e7+e.trx_in_block*100+e.op_pos}function R(e){return e.replace(/_operation$/,"")}function k(e){return typeof e=="object"&&e!==null&&"nai"in e&&"amount"in e&&"precision"in e}function P(e){if(!k(e))return e;let n=c(e),o=b[e.nai]??"UNKNOWN";return `${n.amount.toFixed(e.precision)} ${o}`}function v(e){let n={};for(let[o,p]of Object.entries(e))n[o]=P(p);return n}function I(e,n=20,o=""){let p=o?x[o]:O;return infiniteQueryOptions({queryKey:a.accounts.transactions(e??"",o,n),initialPageParam:null,queryFn:async({pageParam:i,signal:s})=>{if(!e)return {entries:[],currentPage:0};let _=async t=>{let a={"account-name":e,"operation-types":p.join(","),"page-size":n};return t!==null&&(a.page=t),await l("hafah","/accounts/{account-name}/operations",a,void 0,void 0,s)},l$1=t=>t.operations_result.map(a=>{let T=R(a.op.type);return {...v(a.op.value),num:h(a),type:T,timestamp:a.timestamp,trx_id:a.trx_id}}),u=await _(i),c=l$1(u),f=i??u.total_pages;if(i===null&&c.length<n&&u.total_pages>1)try{let t=await _(u.total_pages-1);c=[...c,...l$1(t)],f=u.total_pages-1;}catch(t){if(s?.aborted)throw t}return {entries:c,currentPage:f}},getNextPageParam:i=>{let s=i.currentPage-1;return s>=1?s:void 0}})}export{x as a,O as b,I as c};//# sourceMappingURL=chunk-EPPY5SE6.js.map
2
- //# sourceMappingURL=chunk-EPPY5SE6.js.map
1
+ import {c,b}from'./chunk-32QJ72HH.js';import {a}from'./chunk-WTHEQ3M5.js';import {e}from'./chunk-XX32ZFT4.js';import {l}from'./chunk-RAWKN3XW.js';import {infiniteQueryOptions}from'@tanstack/react-query';var r=e.operations,x={transfers:[r.transfer,r.transfer_to_savings,r.transfer_from_savings,r.cancel_transfer_from_savings,r.fill_transfer_from_savings,r.recurrent_transfer,r.fill_recurrent_transfer,r.escrow_transfer],"market-orders":[r.fill_convert_request,r.fill_order,r.fill_collateralized_convert_request,r.limit_order_create2,r.limit_order_create,r.limit_order_cancel],interests:[r.interest],"stake-operations":[r.return_vesting_delegation,r.withdraw_vesting,r.transfer_to_vesting,r.set_withdraw_vesting_route,r.update_proposal_votes,r.fill_vesting_withdraw,r.account_witness_proxy,r.delegate_vesting_shares],rewards:[r.author_reward,r.curation_reward,r.producer_reward,r.claim_reward_balance,r.comment_benefactor_reward,r.liquidity_reward,r.proposal_pay]},O=Array.from(new Set(Object.values(x).flat()));function h(e){return e.block*1e7+e.trx_in_block*100+e.op_pos}function R(e){return e.replace(/_operation$/,"")}function k(e){return typeof e=="object"&&e!==null&&"nai"in e&&"amount"in e&&"precision"in e}function P(e){if(!k(e))return e;let n=c(e),o=b[e.nai]??"UNKNOWN";return `${n.amount.toFixed(e.precision)} ${o}`}function v(e){let n={};for(let[o,p]of Object.entries(e))n[o]=P(p);return n}function I(e,n=20,o=""){let p=o?x[o]:O;return infiniteQueryOptions({queryKey:a.accounts.transactions(e??"",o,n),initialPageParam:null,queryFn:async({pageParam:i,signal:s})=>{if(!e)return {entries:[],currentPage:0};let _=async t=>{let a={"account-name":e,"operation-types":p.join(","),"page-size":n};return t!==null&&(a.page=t),await l("hafah","/accounts/{account-name}/operations",a,void 0,void 0,s)},l$1=t=>t.operations_result.map(a=>{let T=R(a.op.type);return {...v(a.op.value),num:h(a),type:T,timestamp:a.timestamp,trx_id:a.trx_id}}),u=await _(i),c=l$1(u),f=i??u.total_pages;if(i===null&&c.length<n&&u.total_pages>1)try{let t=await _(u.total_pages-1);c=[...c,...l$1(t)],f=u.total_pages-1;}catch(t){if(s?.aborted)throw t}return {entries:c,currentPage:f}},getNextPageParam:i=>{let s=i.currentPage-1;return s>=1?s:void 0}})}export{x as a,O as b,I as c};//# sourceMappingURL=chunk-WLHXAS5P.js.map
2
+ //# sourceMappingURL=chunk-WLHXAS5P.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/accounts/queries/get-transactions-infinite-query-options.ts"],"names":["ops","utils_exports","ACCOUNT_OPERATION_GROUPS","ALL_ACCOUNT_OPERATIONS","deriveNum","entry","normalizeOpType","restType","isNaiAsset","v","naiToString","parsed","parseAsset","symbol","NaiMap","normalizeOpValue","value","result","k","getTransactionsInfiniteQueryOptions","username","limit","group","operationTypes","infiniteQueryOptions","QueryKeys","pageParam","signal","fetchPage","page","params","callREST","toEntries","response","type","entries","currentPage","chained","e","lastPage","nextPage"],"mappings":"2MAOA,IAAMA,EAAMC,CAAAA,CAAM,UAAA,CAELC,EAA6D,CACxE,SAAA,CAAW,CACTF,CAAAA,CAAI,QAAA,CACJA,EAAI,mBAAA,CACJA,CAAAA,CAAI,sBACJA,CAAAA,CAAI,4BAAA,CAIJA,CAAAA,CAAI,0BAAA,CACJA,CAAAA,CAAI,kBAAA,CACJA,EAAI,uBAAA,CACJA,CAAAA,CAAI,eACN,CAAA,CACA,eAAA,CAAiB,CACfA,CAAAA,CAAI,oBAAA,CACJA,EAAI,UAAA,CACJA,CAAAA,CAAI,oCACJA,CAAAA,CAAI,mBAAA,CACJA,EAAI,kBAAA,CACJA,CAAAA,CAAI,kBACN,CAAA,CACA,SAAA,CAAW,CAACA,CAAAA,CAAI,QAAQ,CAAA,CACxB,mBAAoB,CAClBA,CAAAA,CAAI,0BACJA,CAAAA,CAAI,gBAAA,CACJA,EAAI,mBAAA,CACJA,CAAAA,CAAI,2BACJA,CAAAA,CAAI,qBAAA,CACJA,EAAI,qBAAA,CACJA,CAAAA,CAAI,sBACJA,CAAAA,CAAI,uBACN,EACA,OAAA,CAAS,CACPA,CAAAA,CAAI,aAAA,CACJA,CAAAA,CAAI,eAAA,CACJA,EAAI,eAAA,CACJA,CAAAA,CAAI,qBACJA,CAAAA,CAAI,yBAAA,CACJA,EAAI,gBAAA,CACJA,CAAAA,CAAI,YACN,CACF,CAAA,CAOaG,EAAyB,KAAA,CAAM,IAAA,CAC1C,IAAI,GAAA,CAAI,MAAA,CAAO,OAAOD,CAAwB,CAAA,CAAE,IAAA,EAAM,CACxD,EA2CA,SAASE,CAAAA,CAAUC,CAAAA,CAA+B,CAChD,OAAOA,CAAAA,CAAM,MAAQ,GAAA,CAAaA,CAAAA,CAAM,aAAe,GAAA,CAAMA,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X,CAAAA,EAAQ,OAAA,CACV,MAAMW,CAIV,CAGF,OAAO,CAAE,QAAAH,CAAAA,CAAS,WAAA,CAAAC,CAAY,CAChC,CAAA,CAEA,gBAAA,CAAmBG,CAAAA,EAAa,CAC9B,IAAMC,EAAWD,CAAAA,CAAS,WAAA,CAAc,EACxC,OAAOC,CAAAA,EAAY,EAAIA,CAAAA,CAAW,MACpC,CACF,CAAC,CACH","file":"chunk-EPPY5SE6.js","sourcesContent":["import { InfiniteData, infiniteQueryOptions } from \"@tanstack/react-query\";\nimport { utils } from \"../../../hive-tx\";\nimport { QueryKeys } from \"@/modules/core\";\nimport { Transaction, OperationGroup } from \"../types/transaction\";\nimport { callREST } from \"@/modules/core/hive-tx\";\nimport { parseAsset, NaiMap } from \"@/modules/core/utils\";\n\nconst ops = utils.operations;\n\nexport const ACCOUNT_OPERATION_GROUPS: Record<OperationGroup, number[]> = {\n transfers: [\n ops.transfer,\n ops.transfer_to_savings,\n ops.transfer_from_savings,\n ops.cancel_transfer_from_savings,\n // The virtual op emitted when a savings withdrawal completes. It used to be a\n // second copy of fill_recurrent_transfer, so a completed savings withdrawal was\n // never returned by the transfers group nor by ALL_ACCOUNT_OPERATIONS.\n ops.fill_transfer_from_savings,\n ops.recurrent_transfer,\n ops.fill_recurrent_transfer,\n ops.escrow_transfer,\n ],\n \"market-orders\": [\n ops.fill_convert_request,\n ops.fill_order,\n ops.fill_collateralized_convert_request,\n ops.limit_order_create2,\n ops.limit_order_create,\n ops.limit_order_cancel,\n ],\n interests: [ops.interest],\n \"stake-operations\": [\n ops.return_vesting_delegation,\n ops.withdraw_vesting,\n ops.transfer_to_vesting,\n ops.set_withdraw_vesting_route,\n ops.update_proposal_votes,\n ops.fill_vesting_withdraw,\n ops.account_witness_proxy,\n ops.delegate_vesting_shares,\n ],\n rewards: [\n ops.author_reward,\n ops.curation_reward,\n ops.producer_reward,\n ops.claim_reward_balance,\n ops.comment_benefactor_reward,\n ops.liquidity_reward,\n ops.proposal_pay,\n ],\n};\n\n/**\n * Every operation any group asks for, de-duplicated. Groups overlap (an op can be\n * meaningful to more than one), and the raw concatenation used to repeat ids in the\n * `operation-types` query string sent to hafah.\n */\nexport const ALL_ACCOUNT_OPERATIONS = Array.from(\n new Set(Object.values(ACCOUNT_OPERATION_GROUPS).flat())\n);\n\ninterface TxPageRaw {\n entries: Transaction[];\n currentPage: number;\n}\n\n/**\n * Cursor for transaction pagination.\n * null = first request (returns newest page, API omits page param).\n * number = specific page to fetch (decrementing for older data).\n */\ntype TxCursor = number | null;\n\ninterface HafahOperation {\n op: {\n type: string;\n value: Record<string, unknown>;\n };\n block: number;\n trx_id: string;\n op_pos: number;\n op_type_id: number;\n timestamp: string;\n virtual_op: boolean;\n operation_id: string;\n trx_in_block: number;\n}\n\ninterface HafahResponse {\n total_operations: number;\n total_pages: number;\n operations_result: HafahOperation[];\n}\n\n/**\n * Derive a safe, unique, and chronologically ordered `num` from REST fields.\n *\n * Layout: block * 10_000_000 + trx_in_block * 100 + op_pos\n * - trx_in_block: up to 99_999 (Hive max block size ~65K txs)\n * - op_pos: up to 99 (operations within a single transaction)\n * - Max value: 105_000_000 * 10_000_000 = 1.05e15, within MAX_SAFE_INTEGER (9.007e15)\n */\nfunction deriveNum(entry: HafahOperation): number {\n return entry.block * 10_000_000 + entry.trx_in_block * 100 + entry.op_pos;\n}\n\n/**\n * Strip the `_operation` suffix from the REST API type name\n * to match the Transaction type discriminants (e.g. \"transfer\").\n */\nfunction normalizeOpType(restType: string): string {\n return restType.replace(/_operation$/, \"\");\n}\n\n/**\n * Check if a value is a NAI asset object (e.g. { nai: \"@@000000021\", amount: \"1000\", precision: 3 }).\n */\nfunction isNaiAsset(v: unknown): v is { nai: string; amount: string; precision: number } {\n return typeof v === \"object\" && v !== null && \"nai\" in v && \"amount\" in v && \"precision\" in v;\n}\n\n/**\n * Convert a NAI asset object to a human-readable string like \"1.000 HIVE\".\n * Returns the value unchanged if it's not a NAI object.\n */\nfunction naiToString(v: unknown): unknown {\n if (!isNaiAsset(v)) return v;\n const parsed = parseAsset(v);\n const symbol = NaiMap[v.nai as keyof typeof NaiMap] ?? \"UNKNOWN\";\n return `${parsed.amount.toFixed(v.precision)} ${symbol}`;\n}\n\n/**\n * Convert all NAI asset objects in an operation's value to human-readable strings\n * so downstream renderers that expect \"1.000 HIVE\" don't crash with object values.\n */\nfunction normalizeOpValue(value: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value)) {\n result[k] = naiToString(v);\n }\n return result;\n}\n\n/**\n * Get account transaction history with pagination and filtering.\n * Uses the hafah-api REST endpoint for server-side op-type filtering\n * and real pagination metadata.\n *\n * @param username - Account name to get transactions for\n * @param limit - Number of transactions per page\n * @param group - Filter by operation group (transfers, market-orders, etc.)\n */\nexport function getTransactionsInfiniteQueryOptions(\n username?: string,\n limit = 20,\n group: OperationGroup | \"\" = \"\"\n) {\n const operationTypes = group\n ? ACCOUNT_OPERATION_GROUPS[group]\n : ALL_ACCOUNT_OPERATIONS;\n\n return infiniteQueryOptions<\n TxPageRaw,\n Error,\n InfiniteData<TxPageRaw, TxCursor>,\n (string | number)[],\n TxCursor\n >({\n queryKey: QueryKeys.accounts.transactions(username ?? \"\", group, limit),\n initialPageParam: null as TxCursor,\n\n queryFn: async ({ pageParam, signal }: { pageParam: TxCursor; signal?: AbortSignal }) => {\n if (!username) {\n return { entries: [], currentPage: 0 };\n }\n\n const fetchPage = async (page: TxCursor) => {\n const params: Record<string, string | number> = {\n \"account-name\": username,\n \"operation-types\": operationTypes.join(\",\"),\n \"page-size\": limit,\n };\n\n // First call: omit page to get newest data\n // Subsequent calls: pass specific page number (decrementing)\n if (page !== null) {\n params.page = page;\n }\n\n return (await callREST(\n \"hafah\",\n \"/accounts/{account-name}/operations\",\n params,\n undefined,\n undefined,\n signal\n )) as HafahResponse;\n };\n\n const toEntries = (response: HafahResponse) =>\n response.operations_result.map((entry) => {\n const type = normalizeOpType(entry.op.type);\n const value = normalizeOpValue(entry.op.value);\n return {\n ...value,\n num: deriveNum(entry),\n type,\n timestamp: entry.timestamp,\n trx_id: entry.trx_id,\n } as Transaction;\n });\n\n const response = await fetchPage(pageParam);\n let entries = toEntries(response);\n let currentPage = pageParam ?? response.total_pages;\n\n // hafah pages oldest-first, so the newest page (what an omitted `page`\n // returns) is the remainder bucket: total_operations mod page-size rows,\n // anywhere from 1 to page-size. Requesting page=total_pages explicitly\n // returns the same short bucket, so the only way to a full-size first\n // screen is chaining the next older page in.\n if (pageParam === null && entries.length < limit && response.total_pages > 1) {\n try {\n const chained = await fetchPage(response.total_pages - 1);\n entries = [...entries, ...toEntries(chained)];\n currentPage = response.total_pages - 1;\n } catch (e) {\n // Caller cancellation is not a node failure: rethrow so the query\n // settles as cancelled instead of resolving with a partial page.\n if (signal?.aborted) {\n throw e;\n }\n // Keep the short remainder page; the cursor stays at total_pages so\n // the page that failed here is fetchNextPage's next target, not lost.\n }\n }\n\n return { entries, currentPage };\n },\n\n getNextPageParam: (lastPage) => {\n const nextPage = lastPage.currentPage - 1;\n return nextPage >= 1 ? nextPage : undefined;\n },\n });\n}\n"]}
1
+ {"version":3,"sources":["../../src/modules/accounts/queries/get-transactions-infinite-query-options.ts"],"names":["ops","utils_exports","ACCOUNT_OPERATION_GROUPS","ALL_ACCOUNT_OPERATIONS","deriveNum","entry","normalizeOpType","restType","isNaiAsset","v","naiToString","parsed","parseAsset","symbol","NaiMap","normalizeOpValue","value","result","k","getTransactionsInfiniteQueryOptions","username","limit","group","operationTypes","infiniteQueryOptions","QueryKeys","pageParam","signal","fetchPage","page","params","callREST","toEntries","response","type","entries","currentPage","chained","e","lastPage","nextPage"],"mappings":"2MAOA,IAAMA,EAAMC,CAAAA,CAAM,UAAA,CAELC,EAA6D,CACxE,SAAA,CAAW,CACTF,CAAAA,CAAI,QAAA,CACJA,EAAI,mBAAA,CACJA,CAAAA,CAAI,sBACJA,CAAAA,CAAI,4BAAA,CAIJA,CAAAA,CAAI,0BA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react-query\";\nimport { utils } from \"../../../hive-tx\";\nimport { QueryKeys } from \"@/modules/core\";\nimport { Transaction, OperationGroup } from \"../types/transaction\";\nimport { callREST } from \"@/modules/core/hive-tx\";\nimport { parseAsset, NaiMap } from \"@/modules/core/utils\";\n\nconst ops = utils.operations;\n\nexport const ACCOUNT_OPERATION_GROUPS: Record<OperationGroup, number[]> = {\n transfers: [\n ops.transfer,\n ops.transfer_to_savings,\n ops.transfer_from_savings,\n ops.cancel_transfer_from_savings,\n // The virtual op emitted when a savings withdrawal completes. It used to be a\n // second copy of fill_recurrent_transfer, so a completed savings withdrawal was\n // never returned by the transfers group nor by ALL_ACCOUNT_OPERATIONS.\n ops.fill_transfer_from_savings,\n ops.recurrent_transfer,\n ops.fill_recurrent_transfer,\n ops.escrow_transfer,\n ],\n \"market-orders\": [\n ops.fill_convert_request,\n ops.fill_order,\n ops.fill_collateralized_convert_request,\n ops.limit_order_create2,\n ops.limit_order_create,\n ops.limit_order_cancel,\n ],\n interests: [ops.interest],\n \"stake-operations\": [\n ops.return_vesting_delegation,\n ops.withdraw_vesting,\n ops.transfer_to_vesting,\n ops.set_withdraw_vesting_route,\n ops.update_proposal_votes,\n ops.fill_vesting_withdraw,\n ops.account_witness_proxy,\n ops.delegate_vesting_shares,\n ],\n rewards: [\n ops.author_reward,\n ops.curation_reward,\n ops.producer_reward,\n ops.claim_reward_balance,\n ops.comment_benefactor_reward,\n ops.liquidity_reward,\n ops.proposal_pay,\n ],\n};\n\n/**\n * Every operation any group asks for, de-duplicated. Groups overlap (an op can be\n * meaningful to more than one), and the raw concatenation used to repeat ids in the\n * `operation-types` query string sent to hafah.\n */\nexport const ALL_ACCOUNT_OPERATIONS = Array.from(\n new Set(Object.values(ACCOUNT_OPERATION_GROUPS).flat())\n);\n\ninterface TxPageRaw {\n entries: Transaction[];\n currentPage: number;\n}\n\n/**\n * Cursor for transaction pagination.\n * null = first request (returns newest page, API omits page param).\n * number = specific page to fetch (decrementing for older data).\n */\ntype TxCursor = number | null;\n\ninterface HafahOperation {\n op: {\n type: string;\n value: Record<string, unknown>;\n };\n block: number;\n trx_id: string;\n op_pos: number;\n op_type_id: number;\n timestamp: string;\n virtual_op: boolean;\n operation_id: string;\n trx_in_block: number;\n}\n\ninterface HafahResponse {\n total_operations: number;\n total_pages: number;\n operations_result: HafahOperation[];\n}\n\n/**\n * Derive a safe, unique, and chronologically ordered `num` from REST fields.\n *\n * Layout: block * 10_000_000 + trx_in_block * 100 + op_pos\n * - trx_in_block: up to 99_999 (Hive max block size ~65K txs)\n * - op_pos: up to 99 (operations within a single transaction)\n * - Max value: 105_000_000 * 10_000_000 = 1.05e15, within MAX_SAFE_INTEGER (9.007e15)\n */\nfunction deriveNum(entry: HafahOperation): number {\n return entry.block * 10_000_000 + entry.trx_in_block * 100 + entry.op_pos;\n}\n\n/**\n * Strip the `_operation` suffix from the REST API type name\n * to match the Transaction type discriminants (e.g. \"transfer\").\n */\nfunction normalizeOpType(restType: string): string {\n return restType.replace(/_operation$/, \"\");\n}\n\n/**\n * Check if a value is a NAI asset object (e.g. { nai: \"@@000000021\", amount: \"1000\", precision: 3 }).\n */\nfunction isNaiAsset(v: unknown): v is { nai: string; amount: string; precision: number } {\n return typeof v === \"object\" && v !== null && \"nai\" in v && \"amount\" in v && \"precision\" in v;\n}\n\n/**\n * Convert a NAI asset object to a human-readable string like \"1.000 HIVE\".\n * Returns the value unchanged if it's not a NAI object.\n */\nfunction naiToString(v: unknown): unknown {\n if (!isNaiAsset(v)) return v;\n const parsed = parseAsset(v);\n const symbol = NaiMap[v.nai as keyof typeof NaiMap] ?? \"UNKNOWN\";\n return `${parsed.amount.toFixed(v.precision)} ${symbol}`;\n}\n\n/**\n * Convert all NAI asset objects in an operation's value to human-readable strings\n * so downstream renderers that expect \"1.000 HIVE\" don't crash with object values.\n */\nfunction normalizeOpValue(value: Record<string, unknown>): Record<string, unknown> {\n const result: Record<string, unknown> = {};\n for (const [k, v] of Object.entries(value)) {\n result[k] = naiToString(v);\n }\n return result;\n}\n\n/**\n * Get account transaction history with pagination and filtering.\n * Uses the hafah-api REST endpoint for server-side op-type filtering\n * and real pagination metadata.\n *\n * @param username - Account name to get transactions for\n * @param limit - Number of transactions per page\n * @param group - Filter by operation group (transfers, market-orders, etc.)\n */\nexport function getTransactionsInfiniteQueryOptions(\n username?: string,\n limit = 20,\n group: OperationGroup | \"\" = \"\"\n) {\n const operationTypes = group\n ? ACCOUNT_OPERATION_GROUPS[group]\n : ALL_ACCOUNT_OPERATIONS;\n\n return infiniteQueryOptions<\n TxPageRaw,\n Error,\n InfiniteData<TxPageRaw, TxCursor>,\n (string | number)[],\n TxCursor\n >({\n queryKey: QueryKeys.accounts.transactions(username ?? \"\", group, limit),\n initialPageParam: null as TxCursor,\n\n queryFn: async ({ pageParam, signal }: { pageParam: TxCursor; signal?: AbortSignal }) => {\n if (!username) {\n return { entries: [], currentPage: 0 };\n }\n\n const fetchPage = async (page: TxCursor) => {\n const params: Record<string, string | number> = {\n \"account-name\": username,\n \"operation-types\": operationTypes.join(\",\"),\n \"page-size\": limit,\n };\n\n // First call: omit page to get newest data\n // Subsequent calls: pass specific page number (decrementing)\n if (page !== null) {\n params.page = page;\n }\n\n return (await callREST(\n \"hafah\",\n \"/accounts/{account-name}/operations\",\n params,\n undefined,\n undefined,\n signal\n )) as HafahResponse;\n };\n\n const toEntries = (response: HafahResponse) =>\n response.operations_result.map((entry) => {\n const type = normalizeOpType(entry.op.type);\n const value = normalizeOpValue(entry.op.value);\n return {\n ...value,\n num: deriveNum(entry),\n type,\n timestamp: entry.timestamp,\n trx_id: entry.trx_id,\n } as Transaction;\n });\n\n const response = await fetchPage(pageParam);\n let entries = toEntries(response);\n let currentPage = pageParam ?? response.total_pages;\n\n // hafah pages oldest-first, so the newest page (what an omitted `page`\n // returns) is the remainder bucket: total_operations mod page-size rows,\n // anywhere from 1 to page-size. Requesting page=total_pages explicitly\n // returns the same short bucket, so the only way to a full-size first\n // screen is chaining the next older page in.\n if (pageParam === null && entries.length < limit && response.total_pages > 1) {\n try {\n const chained = await fetchPage(response.total_pages - 1);\n entries = [...entries, ...toEntries(chained)];\n currentPage = response.total_pages - 1;\n } catch (e) {\n // Caller cancellation is not a node failure: rethrow so the query\n // settles as cancelled instead of resolving with a partial page.\n if (signal?.aborted) {\n throw e;\n }\n // Keep the short remainder page; the cursor stays at total_pages so\n // the page that failed here is fetchNextPage's next target, not lost.\n }\n }\n\n return { entries, currentPage };\n },\n\n getNextPageParam: (lastPage) => {\n const nextPage = lastPage.currentPage - 1;\n return nextPage >= 1 ? nextPage : undefined;\n },\n });\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {e,d}from'./chunk-4COFIDSX.js';import {b as b$1}from'./chunk-CNB64U7U.js';import {b}from'./chunk-J2HM6MWA.js';import {a}from'./chunk-WTHEQ3M5.js';function f(t){if(!t||typeof t!="object")return null;let o=t,r=typeof o.tx_id=="string"?o.tx_id:typeof o.id=="string"?o.id:null;return r&&/^[0-9a-f]{40}$/.test(r)?r:null}function l(t,o,r){return b(a.curation.recommend(),t,n=>[n.withdraw?e(t,n.author,n.permlink):d(t,n.author,n.permlink,n.reason)],async(n,i)=>{await b$1(o?.adapter,r,[a.curation.post(i.author,i.permlink),[...a.curation._recommendationsPrefix]]);},o,"posting",{broadcastMode:r})}export{f as a,l as b};//# sourceMappingURL=chunk-6JEMIQQJ.js.map
2
- //# sourceMappingURL=chunk-6JEMIQQJ.js.map
1
+ import {e,d}from'./chunk-4COFIDSX.js';import {b as b$1}from'./chunk-CNB64U7U.js';import {b}from'./chunk-PFVWZI3W.js';import {a}from'./chunk-WTHEQ3M5.js';function f(t){if(!t||typeof t!="object")return null;let o=t,r=typeof o.tx_id=="string"?o.tx_id:typeof o.id=="string"?o.id:null;return r&&/^[0-9a-f]{40}$/.test(r)?r:null}function l(t,o,r){return b(a.curation.recommend(),t,n=>[n.withdraw?e(t,n.author,n.permlink):d(t,n.author,n.permlink,n.reason)],async(n,i)=>{await b$1(o?.adapter,r,[a.curation.post(i.author,i.permlink),[...a.curation._recommendationsPrefix]]);},o,"posting",{broadcastMode:r})}export{f as a,l as b};//# sourceMappingURL=chunk-XBAS5ZUQ.js.map
2
+ //# sourceMappingURL=chunk-XBAS5ZUQ.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/curation/mutations/use-curation-recommend.ts"],"names":["normalizeBroadcastTrxId","result","r","id","useCurationRecommend","username","auth","broadcastMode","useBroadcastMutation","QueryKeys","payload","buildCurationUnrecommendOp","buildCurationRecommendOp","_result","variables","invalidateAfterBroadcast"],"mappings":"yJAyBO,SAASA,CAAAA,CAAwBC,EAAgC,CACtE,GAAI,CAACA,CAAAA,EAAU,OAAOA,CAAAA,EAAW,QAAA,CAAU,OAAO,IAAA,CAClD,IAAMC,CAAAA,CAAID,CAAAA,CACJE,CAAAA,CAAK,OAAOD,CAAAA,CAAE,KAAA,EAAU,SAAWA,CAAAA,CAAE,KAAA,CAAQ,OAAOA,CAAAA,CAAE,EAAA,EAAO,QAAA,CAAWA,EAAE,EAAA,CAAK,IAAA,CACrF,OAAOC,CAAAA,EAAM,gBAAA,CAAiB,KAAKA,CAAE,CAAA,CAAIA,CAAAA,CAAK,IAChD,CAQO,SAASC,EACdC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACA,CACA,OAAOC,CAAAA,CACLC,EAAU,QAAA,CAAS,SAAA,EAAU,CAC7BJ,CAAAA,CACCK,CAAAA,EAAY,CACXA,EAAQ,QAAA,CACJC,CAAAA,CAA2BN,EAAWK,CAAAA,CAAQ,MAAA,CAAQA,EAAQ,QAAQ,CAAA,CACtEE,CAAAA,CAAyBP,CAAAA,CAAWK,CAAAA,CAAQ,MAAA,CAAQA,EAAQ,QAAA,CAAUA,CAAAA,CAAQ,MAAM,CAC1F,CAAA,CACA,MAAOG,EAASC,CAAAA,GAAc,CAC5B,MAAMC,GAAAA,CAAyBT,CAAAA,EAAM,OAAA,CAASC,EAAe,CAC3DE,CAAAA,CAAU,SAAS,IAAA,CAAKK,CAAAA,CAAU,OAAQA,CAAAA,CAAU,QAAQ,CAAA,CAC5D,CAAC,GAAGL,CAAAA,CAAU,SAAS,sBAAsB,CAC/C,CAAC,EACH,CAAA,CACAH,CAAAA,CACA,UACA,CAAE,aAAA,CAAAC,CAAc,CAClB,CACF","file":"chunk-6JEMIQQJ.js","sourcesContent":["import { useBroadcastMutation, invalidateAfterBroadcast } from \"@/modules/core/mutations\";\nimport type { BroadcastMode } from \"@/modules/core/mutations\";\nimport { QueryKeys } from \"@/modules/core\";\nimport type { AuthContextV2 } from \"@/modules/core/types\";\nimport {\n buildCurationRecommendOp,\n buildCurationUnrecommendOp,\n} from \"@/modules/operations/builders\";\nimport type { CurationReason } from \"../types\";\n\nexport interface CurationRecommendPayload {\n author: string;\n permlink: string;\n /** Defaults to \"quality\" on recommend; ignored on withdraw. */\n reason?: CurationReason;\n /** Broadcast the `unrecommend` op instead. */\n withdraw?: boolean;\n}\n\n/**\n * The broadcast result is not uniform across auth paths: the key path returns\n * `{tx_id, status}`, the HiveSigner token and Keychain extension paths return\n * `{id, block_num, ...}`; the redirect flows never resolve at all. This\n * gives the one shape the desk needs (a 40 hex char id) or null.\n */\nexport function normalizeBroadcastTrxId(result: unknown): string | null {\n if (!result || typeof result !== \"object\") return null;\n const r = result as { tx_id?: unknown; id?: unknown };\n const id = typeof r.tx_id === \"string\" ? r.tx_id : typeof r.id === \"string\" ? r.id : null;\n return id && /^[0-9a-f]{40}$/.test(id) ? id : null;\n}\n\n/**\n * Recommend a post to the curators (or withdraw a recommendation) with one\n * `custom_json` under posting authority. The desk indexes the op from the\n * chain; nothing is written to a desk route here. Platform wrappers send the\n * optional meta ping after success.\n */\nexport function useCurationRecommend(\n username: string | undefined,\n auth?: AuthContextV2,\n broadcastMode?: BroadcastMode\n) {\n return useBroadcastMutation<CurationRecommendPayload>(\n QueryKeys.curation.recommend(),\n username,\n (payload) => [\n payload.withdraw\n ? buildCurationUnrecommendOp(username!, payload.author, payload.permlink)\n : buildCurationRecommendOp(username!, payload.author, payload.permlink, payload.reason),\n ],\n async (_result, variables) => {\n await invalidateAfterBroadcast(auth?.adapter, broadcastMode, [\n QueryKeys.curation.post(variables.author, variables.permlink),\n [...QueryKeys.curation._recommendationsPrefix],\n ]);\n },\n auth,\n \"posting\",\n { broadcastMode }\n );\n}\n"]}
1
+ {"version":3,"sources":["../../src/modules/curation/mutations/use-curation-recommend.ts"],"names":["normalizeBroadcastTrxId","result","r","id","useCurationRecommend","username","auth","broadcastMode","useBroadcastMutation","QueryKeys","payload","buildCurationUnrecommendOp","buildCurationRecommendOp","_result","variables","invalidateAfterBroadcast"],"mappings":"yJAyBO,SAASA,CAAAA,CAAwBC,EAAgC,CACtE,GAAI,CAACA,CAAAA,EAAU,OAAOA,CAAAA,EAAW,QAAA,CAAU,OAAO,IAAA,CAClD,IAAMC,CAAAA,CAAID,CAAAA,CACJE,CAAAA,CAAK,OAAOD,CAAAA,CAAE,KAAA,EAAU,SAAWA,CAAAA,CAAE,KAAA,CAAQ,OAAOA,CAAAA,CAAE,EAAA,EAAO,QAAA,CAAWA,EAAE,EAAA,CAAK,IAAA,CACrF,OAAOC,CAAAA,EAAM,gBAAA,CAAiB,KAAKA,CAAE,CAAA,CAAIA,CAAAA,CAAK,IAChD,CAQO,SAASC,EACdC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACA,CACA,OAAOC,CAAAA,CACLC,EAAU,QAAA,CAAS,SAAA,EAAU,CAC7BJ,CAAAA,CACCK,CAAAA,EAAY,CACXA,EAAQ,QAAA,CACJC,CAAAA,CAA2BN,EAAWK,CAAAA,CAAQ,MAAA,CAAQA,EAAQ,QAAQ,CAAA,CACtEE,CAAAA,CAAyBP,CAAAA,CAAWK,CAAAA,CAAQ,MAAA,CAAQA,EAAQ,QAAA,CAAUA,CAAAA,CAAQ,MAAM,CAC1F,CAAA,CACA,MAAOG,EAASC,CAAAA,GAAc,CAC5B,MAAMC,GAAAA,CAAyBT,CAAAA,EAAM,OAAA,CAASC,EAAe,CAC3DE,CAAAA,CAAU,SAAS,IAAA,CAAKK,CAAAA,CAAU,OAAQA,CAAAA,CAAU,QAAQ,CAAA,CAC5D,CAAC,GAAGL,CAAAA,CAAU,SAAS,sBAAsB,CAC/C,CAAC,EACH,CAAA,CACAH,CAAAA,CACA,UACA,CAAE,aAAA,CAAAC,CAAc,CAClB,CACF","file":"chunk-XBAS5ZUQ.js","sourcesContent":["import { useBroadcastMutation, invalidateAfterBroadcast } from \"@/modules/core/mutations\";\nimport type { BroadcastMode } from \"@/modules/core/mutations\";\nimport { QueryKeys } from \"@/modules/core\";\nimport type { AuthContextV2 } from \"@/modules/core/types\";\nimport {\n buildCurationRecommendOp,\n buildCurationUnrecommendOp,\n} from \"@/modules/operations/builders\";\nimport type { CurationReason } from \"../types\";\n\nexport interface CurationRecommendPayload {\n author: string;\n permlink: string;\n /** Defaults to \"quality\" on recommend; ignored on withdraw. */\n reason?: CurationReason;\n /** Broadcast the `unrecommend` op instead. */\n withdraw?: boolean;\n}\n\n/**\n * The broadcast result is not uniform across auth paths: the key path returns\n * `{tx_id, status}`, the HiveSigner token and Keychain extension paths return\n * `{id, block_num, ...}`; the redirect flows never resolve at all. This\n * gives the one shape the desk needs (a 40 hex char id) or null.\n */\nexport function normalizeBroadcastTrxId(result: unknown): string | null {\n if (!result || typeof result !== \"object\") return null;\n const r = result as { tx_id?: unknown; id?: unknown };\n const id = typeof r.tx_id === \"string\" ? r.tx_id : typeof r.id === \"string\" ? r.id : null;\n return id && /^[0-9a-f]{40}$/.test(id) ? id : null;\n}\n\n/**\n * Recommend a post to the curators (or withdraw a recommendation) with one\n * `custom_json` under posting authority. The desk indexes the op from the\n * chain; nothing is written to a desk route here. Platform wrappers send the\n * optional meta ping after success.\n */\nexport function useCurationRecommend(\n username: string | undefined,\n auth?: AuthContextV2,\n broadcastMode?: BroadcastMode\n) {\n return useBroadcastMutation<CurationRecommendPayload>(\n QueryKeys.curation.recommend(),\n username,\n (payload) => [\n payload.withdraw\n ? buildCurationUnrecommendOp(username!, payload.author, payload.permlink)\n : buildCurationRecommendOp(username!, payload.author, payload.permlink, payload.reason),\n ],\n async (_result, variables) => {\n await invalidateAfterBroadcast(auth?.adapter, broadcastMode, [\n QueryKeys.curation.post(variables.author, variables.permlink),\n [...QueryKeys.curation._recommendationsPrefix],\n ]);\n },\n auth,\n \"posting\",\n { broadcastMode }\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {a,b,e}from'./chunk-Q2ACQBL2.js';import {c}from'./chunk-32QJ72HH.js';import {infiniteQueryOptions}from'@tanstack/react-query';function O(t,s=20,a$1=[]){let{filterKey:c$1}=a(a$1),l=b(a$1);return infiniteQueryOptions({...e(t,s,a$1),queryKey:["assets","hbd","transactions",t,s,c$1],select:({pages:u,pageParams:_})=>({pageParams:_,pages:u.map(p=>p.filter(e=>{switch(e.type){case "author_reward":case "comment_benefactor_reward":return c(e.hbd_payout).amount>0;case "claim_reward_balance":return c(e.reward_hbd).amount>0;case "transfer":case "transfer_to_savings":case "transfer_to_vesting":case "recurrent_transfer":return c(e.amount).symbol==="HBD";case "transfer_from_savings":case "fill_transfer_from_savings":return c(e.amount).symbol==="HBD";case "fill_recurrent_transfer":let d=c(e.amount);return ["HBD"].includes(d.symbol);case "cancel_transfer_from_savings":case "fill_order":case "limit_order_create":case "limit_order_cancel":case "fill_convert_request":case "fill_collateralized_convert_request":case "proposal_pay":case "interest":return true;case "limit_order_create2":return true;default:return l.has(e.type)}}))})})}export{O as a};//# sourceMappingURL=chunk-QAXITR2P.js.map
2
- //# sourceMappingURL=chunk-QAXITR2P.js.map
1
+ import {a,b,e}from'./chunk-WCIDGHGX.js';import {c}from'./chunk-32QJ72HH.js';import {infiniteQueryOptions}from'@tanstack/react-query';function O(t,s=20,a$1=[]){let{filterKey:c$1}=a(a$1),l=b(a$1);return infiniteQueryOptions({...e(t,s,a$1),queryKey:["assets","hbd","transactions",t,s,c$1],select:({pages:u,pageParams:_})=>({pageParams:_,pages:u.map(p=>p.filter(e=>{switch(e.type){case "author_reward":case "comment_benefactor_reward":return c(e.hbd_payout).amount>0;case "claim_reward_balance":return c(e.reward_hbd).amount>0;case "transfer":case "transfer_to_savings":case "transfer_to_vesting":case "recurrent_transfer":return c(e.amount).symbol==="HBD";case "transfer_from_savings":case "fill_transfer_from_savings":return c(e.amount).symbol==="HBD";case "fill_recurrent_transfer":let d=c(e.amount);return ["HBD"].includes(d.symbol);case "cancel_transfer_from_savings":case "fill_order":case "limit_order_create":case "limit_order_cancel":case "fill_convert_request":case "fill_collateralized_convert_request":case "proposal_pay":case "interest":return true;case "limit_order_create2":return true;default:return l.has(e.type)}}))})})}export{O as a};//# sourceMappingURL=chunk-XQLIW5VC.js.map
2
+ //# sourceMappingURL=chunk-XQLIW5VC.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/wallet/queries/get-hbd-asset-transactions-query-options.ts"],"names":["getHbdAssetTransactionsQueryOptions","username","limit","filters","filterKey","resolveHiveOperationFilters","requestedOperations","collectRequestedOperations","infiniteQueryOptions","getHiveAssetTransactionsQueryOptions","pages","pageParams","page","item","parseAsset","asset"],"mappings":"qIAeO,SAASA,CAAAA,CACdC,EACAC,CAAAA,CAAQ,EAAA,CACRC,GAAAA,CAA+B,GAC/B,CACA,GAAM,CAAE,SAAA,CAAAC,GAAU,CAAA,CAAIC,CAAAA,CAA4BF,GAAO,CAAA,CACnDG,EAAsBC,CAAAA,CAA2BJ,GAAO,CAAA,CAE9D,OAAOK,qBAAwC,CAC7C,GAAGC,CAAAA,CAAqCR,CAAAA,CAAUC,EAAOC,GAAO,CAAA,CAChE,SAAU,CAAC,QAAA,CAAU,MAAO,cAAA,CAAgBF,CAAAA,CAAUC,CAAAA,CAAOE,GAAS,EACtE,MAAA,CAAQ,CAAC,CAAE,KAAA,CAAAM,EAAO,UAAA,CAAAC,CAAW,CAAA,IAAO,CAClC,WAAAA,CAAAA,CACA,KAAA,CAAOD,EAAM,GAAA,CAAKE,CAAAA,EAChBA,EAAK,MAAA,CAAQC,CAAAA,EAAS,CACpB,OAAQA,EAAK,IAAA,EACX,KAAK,eAAA,CACL,KAAK,2BAAA,CAIH,OAHkBC,CAAAA,CACfD,CAAAA,CAAsB,UACzB,CAAA,CACiB,MAAA,CAAS,EAE5B,KAAK,sBAAA,CAIH,OAHkBC,CAAAA,CACfD,CAAAA,CAA4B,UAC/B,CAAA,CACiB,OAAS,CAAA,CAE5B,KAAK,UAAA,CACL,KAAK,sBACL,KAAK,qBAAA,CACL,KAAK,oBAAA,CACH,OAAOC,CAAAA,CAAWD,CAAAA,CAAK,MAAM,CAAA,CAAE,SAAW,KAAA,CAE5C,KAAK,uBAAA,CAIL,KAAK,6BACH,OAAOC,CAAAA,CAAYD,CAAAA,CAAa,MAAM,EAAE,MAAA,GAAW,KAAA,CAErD,KAAK,yBAAA,CACH,IAAME,CAAAA,CAAQD,CAAAA,CAAWD,EAAK,MAAM,CAAA,CACpC,OAAO,CAAC,KAAK,CAAA,CAAE,QAAA,CAASE,EAAM,MAAM,CAAA,CAEtC,KAAK,8BAAA,CACL,KAAK,YAAA,CACL,KAAK,oBAAA,CACL,KAAK,qBACL,KAAK,sBAAA,CACL,KAAK,qCAAA,CACL,KAAK,eACL,KAAK,UAAA,CACH,OAAO,KAAA,CAET,KAAK,qBAAA,CACH,OAAO,KAAA,CACT,QAIE,OAAOT,CAAAA,CAAoB,GAAA,CAAIO,CAAAA,CAAK,IAAI,CAC5C,CACF,CAAC,CACH,CACF,CAAA,CACF,CAAC,CACH","file":"chunk-QAXITR2P.js","sourcesContent":["import { infiniteQueryOptions } from \"@tanstack/react-query\";\nimport { parseAsset } from \"@/modules/core/utils\";\nimport type {\n AuthorReward,\n ClaimRewardBalance,\n HiveOperationFilter,\n HiveOperationName,\n} from \"../types\";\nimport type { HiveTransaction } from \"../types\";\nimport {\n collectRequestedOperations,\n getHiveAssetTransactionsQueryOptions,\n resolveHiveOperationFilters,\n} from \"./get-hive-asset-transactions-query-options\";\n\nexport function getHbdAssetTransactionsQueryOptions(\n username: string | undefined,\n limit = 20,\n filters: HiveOperationFilter = []\n) {\n const { filterKey } = resolveHiveOperationFilters(filters);\n const requestedOperations = collectRequestedOperations(filters);\n\n return infiniteQueryOptions<HiveTransaction[]>({\n ...getHiveAssetTransactionsQueryOptions(username, limit, filters),\n queryKey: [\"assets\", \"hbd\", \"transactions\", username, limit, filterKey],\n select: ({ pages, pageParams }) => ({\n pageParams,\n pages: pages.map((page) =>\n page.filter((item) => {\n switch (item.type) {\n case \"author_reward\":\n case \"comment_benefactor_reward\":\n const hbdPayout = parseAsset(\n (item as AuthorReward).hbd_payout\n );\n return hbdPayout.amount > 0;\n\n case \"claim_reward_balance\":\n const rewardHbd = parseAsset(\n (item as ClaimRewardBalance).reward_hbd\n );\n return rewardHbd.amount > 0;\n\n case \"transfer\":\n case \"transfer_to_savings\":\n case \"transfer_to_vesting\":\n case \"recurrent_transfer\":\n return parseAsset(item.amount).symbol === \"HBD\";\n\n case \"transfer_from_savings\" as HiveOperationName:\n // The completed withdrawal carries the same asset as the request that\n // opened it, so it needs the same guard. Without a case of its own it\n // falls to the default below, which has no symbol check.\n case \"fill_transfer_from_savings\" as HiveOperationName:\n return parseAsset((item as any).amount).symbol === \"HBD\";\n\n case \"fill_recurrent_transfer\":\n const asset = parseAsset(item.amount);\n return [\"HBD\"].includes(asset.symbol);\n\n case \"cancel_transfer_from_savings\":\n case \"fill_order\":\n case \"limit_order_create\":\n case \"limit_order_cancel\":\n case \"fill_convert_request\":\n case \"fill_collateralized_convert_request\":\n case \"proposal_pay\":\n case \"interest\":\n return true;\n\n case \"limit_order_create2\" as HiveOperationName:\n return true;\n default:\n // See the HIVE options: keep an operation the caller named explicitly,\n // otherwise the filter UI offers operations this switch throws away.\n // Unfiltered requests still fall through to `false`.\n return requestedOperations.has(item.type);\n }\n })\n ),\n }),\n });\n}\n"]}
1
+ {"version":3,"sources":["../../src/modules/wallet/queries/get-hbd-asset-transactions-query-options.ts"],"names":["getHbdAssetTransactionsQueryOptions","username","limit","filters","filterKey","resolveHiveOperationFilters","requestedOperations","collectRequestedOperations","infiniteQueryOptions","getHiveAssetTransactionsQueryOptions","pages","pageParams","page","item","parseAsset","asset"],"mappings":"qIAeO,SAASA,CAAAA,CACdC,EACAC,CAAAA,CAAQ,EAAA,CACRC,GAAAA,CAA+B,GAC/B,CACA,GAAM,CAAE,SAAA,CAAAC,GAAU,CAAA,CAAIC,CAAAA,CAA4BF,GAAO,CAAA,CACnDG,EAAsBC,CAAAA,CAA2BJ,GAAO,CAAA,CAE9D,OAAOK,qBAAwC,CAC7C,GAAGC,CAAAA,CAAqCR,CAAAA,CAAUC,EAAOC,GAAO,CAAA,CAChE,SAAU,CAAC,QAAA,CAAU,MAAO,cAAA,CAAgBF,CAAAA,CAAUC,CAAAA,CAAOE,GAAS,EACtE,MAAA,CAAQ,CAAC,CAAE,KAAA,CAAAM,EAAO,UAAA,CAAAC,CAAW,CAAA,IAAO,CAClC,WAAAA,CAAAA,CACA,KAAA,CAAOD,EAAM,GAAA,CAAKE,CAAAA,EAChBA,EAAK,MAAA,CAAQC,CAAAA,EAAS,CACpB,OAAQA,EAAK,IAAA,EACX,KAAK,eAAA,CACL,KAAK,2BAAA,CAIH,OAHkBC,CAAAA,CACfD,CAAAA,CAAsB,UACzB,CAAA,CACiB,MAAA,CAAS,EAE5B,KAAK,sBAAA,CAIH,OAHkBC,CAAAA,CACfD,CAAAA,CAA4B,UAC/B,CAAA,CACiB,OAAS,CAAA,CAE5B,KAAK,UAAA,CACL,KAAK,sBACL,KAAK,qBAAA,CACL,KAAK,oBAAA,CACH,OAAOC,CAAAA,CAAWD,CAAAA,CAAK,MAAM,CAAA,CAAE,SAAW,KAAA,CAE5C,KAAK,uBAAA,CAIL,KAAK,6BACH,OAAOC,CAAAA,CAAYD,CAAAA,CAAa,MAAM,EAAE,MAAA,GAAW,KAAA,CAErD,KAAK,yBAAA,CACH,IAAME,CAAAA,CAAQD,CAAAA,CAAWD,EAAK,MAAM,CAAA,CACpC,OAAO,CAAC,KAAK,CAAA,CAAE,QAAA,CAASE,EAAM,MAAM,CAAA,CAEtC,KAAK,8BAAA,CACL,KAAK,YAAA,CACL,KAAK,oBAAA,CACL,KAAK,qBACL,KAAK,sBAAA,CACL,KAAK,qCAAA,CACL,KAAK,eACL,KAAK,UAAA,CACH,OAAO,KAAA,CAET,KAAK,qBAAA,CACH,OAAO,KAAA,CACT,QAIE,OAAOT,CAAAA,CAAoB,GAAA,CAAIO,CAAAA,CAAK,IAAI,CAC5C,CACF,CAAC,CACH,CACF,CAAA,CACF,CAAC,CACH","file":"chunk-XQLIW5VC.js","sourcesContent":["import { infiniteQueryOptions } from \"@tanstack/react-query\";\nimport { parseAsset } from \"@/modules/core/utils\";\nimport type {\n AuthorReward,\n ClaimRewardBalance,\n HiveOperationFilter,\n HiveOperationName,\n} from \"../types\";\nimport type { HiveTransaction } from \"../types\";\nimport {\n collectRequestedOperations,\n getHiveAssetTransactionsQueryOptions,\n resolveHiveOperationFilters,\n} from \"./get-hive-asset-transactions-query-options\";\n\nexport function getHbdAssetTransactionsQueryOptions(\n username: string | undefined,\n limit = 20,\n filters: HiveOperationFilter = []\n) {\n const { filterKey } = resolveHiveOperationFilters(filters);\n const requestedOperations = collectRequestedOperations(filters);\n\n return infiniteQueryOptions<HiveTransaction[]>({\n ...getHiveAssetTransactionsQueryOptions(username, limit, filters),\n queryKey: [\"assets\", \"hbd\", \"transactions\", username, limit, filterKey],\n select: ({ pages, pageParams }) => ({\n pageParams,\n pages: pages.map((page) =>\n page.filter((item) => {\n switch (item.type) {\n case \"author_reward\":\n case \"comment_benefactor_reward\":\n const hbdPayout = parseAsset(\n (item as AuthorReward).hbd_payout\n );\n return hbdPayout.amount > 0;\n\n case \"claim_reward_balance\":\n const rewardHbd = parseAsset(\n (item as ClaimRewardBalance).reward_hbd\n );\n return rewardHbd.amount > 0;\n\n case \"transfer\":\n case \"transfer_to_savings\":\n case \"transfer_to_vesting\":\n case \"recurrent_transfer\":\n return parseAsset(item.amount).symbol === \"HBD\";\n\n case \"transfer_from_savings\" as HiveOperationName:\n // The completed withdrawal carries the same asset as the request that\n // opened it, so it needs the same guard. Without a case of its own it\n // falls to the default below, which has no symbol check.\n case \"fill_transfer_from_savings\" as HiveOperationName:\n return parseAsset((item as any).amount).symbol === \"HBD\";\n\n case \"fill_recurrent_transfer\":\n const asset = parseAsset(item.amount);\n return [\"HBD\"].includes(asset.symbol);\n\n case \"cancel_transfer_from_savings\":\n case \"fill_order\":\n case \"limit_order_create\":\n case \"limit_order_cancel\":\n case \"fill_convert_request\":\n case \"fill_collateralized_convert_request\":\n case \"proposal_pay\":\n case \"interest\":\n return true;\n\n case \"limit_order_create2\" as HiveOperationName:\n return true;\n default:\n // See the HIVE options: keep an operation the caller named explicitly,\n // otherwise the filter UI offers operations this switch throws away.\n // Unfiltered requests still fall through to `false`.\n return requestedOperations.has(item.type);\n }\n })\n ),\n }),\n });\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {d,c}from'./chunk-QYY3VHLJ.js';import {b as b$1}from'./chunk-CNB64U7U.js';import {b}from'./chunk-J2HM6MWA.js';import {a}from'./chunk-WTHEQ3M5.js';function A(t,c$1,o){return b(["accounts","create"],t,e=>[e.useClaimed?d(t,e.newAccountName,e.keys):c(t,e.newAccountName,e.keys,e.fee)],async()=>{await b$1(c$1?.adapter,o,[a.accounts.full(t)]);},c$1,"active",{broadcastMode:o})}export{A as a};//# sourceMappingURL=chunk-AU2I7Q6Y.js.map
2
- //# sourceMappingURL=chunk-AU2I7Q6Y.js.map
1
+ import {d,c}from'./chunk-QYY3VHLJ.js';import {b as b$1}from'./chunk-CNB64U7U.js';import {b}from'./chunk-PFVWZI3W.js';import {a}from'./chunk-WTHEQ3M5.js';function A(t,c$1,o){return b(["accounts","create"],t,e=>[e.useClaimed?d(t,e.newAccountName,e.keys):c(t,e.newAccountName,e.keys,e.fee)],async()=>{await b$1(c$1?.adapter,o,[a.accounts.full(t)]);},c$1,"active",{broadcastMode:o})}export{A as a};//# sourceMappingURL=chunk-XVW7ZC72.js.map
2
+ //# sourceMappingURL=chunk-XVW7ZC72.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/accounts/mutations/use-create-account.ts"],"names":["useCreateAccount","username","auth","broadcastMode","useBroadcastMutation","payload","buildCreateClaimedAccountOp","buildAccountCreateOp","invalidateAfterBroadcast","QueryKeys"],"mappings":"yJAaO,SAASA,CAAAA,CACdC,CAAAA,CACAC,GAAAA,CACAC,CAAAA,CACA,CACA,OAAOC,CAAAA,CACL,CAAC,UAAA,CAAY,QAAQ,CAAA,CACrBH,CAAAA,CACCI,GAAY,CACXA,CAAAA,CAAQ,UAAA,CACJC,CAAAA,CAA4BL,CAAAA,CAAWI,CAAAA,CAAQ,cAAA,CAAgBA,CAAAA,CAAQ,IAAI,CAAA,CAC3EE,CAAAA,CAAqBN,CAAAA,CAAWI,CAAAA,CAAQ,cAAA,CAAgBA,EAAQ,IAAA,CAAMA,CAAAA,CAAQ,GAAG,CACvF,CAAA,CACA,SAAY,CACV,MAAMG,GAAAA,CAAyBN,GAAAA,EAAM,OAAA,CAASC,CAAAA,CAAe,CAC3DM,CAAAA,CAAU,SAAS,IAAA,CAAKR,CAAQ,CAClC,CAAC,EACH,CAAA,CACAC,GAAAA,CACA,QAAA,CACA,CAAE,aAAA,CAAAC,CAAc,CAClB,CACF","file":"chunk-AU2I7Q6Y.js","sourcesContent":["import { useBroadcastMutation, invalidateAfterBroadcast, QueryKeys } from \"@/modules/core\";\nimport type { BroadcastMode } from \"@/modules/core\";\nimport { buildAccountCreateOp, buildCreateClaimedAccountOp, type AccountKeys } from \"@/modules/operations/builders\";\nimport type { AuthContextV2 } from \"@/modules/core/types\";\n\nexport interface CreateAccountPayload {\n newAccountName: string;\n keys: AccountKeys;\n fee: string;\n /** If true, uses a claimed account token instead of paying the fee */\n useClaimed?: boolean;\n}\n\nexport function useCreateAccount(\n username: string | undefined,\n auth?: AuthContextV2,\n broadcastMode?: BroadcastMode\n) {\n return useBroadcastMutation<CreateAccountPayload>(\n [\"accounts\", \"create\"],\n username,\n (payload) => [\n payload.useClaimed\n ? buildCreateClaimedAccountOp(username!, payload.newAccountName, payload.keys)\n : buildAccountCreateOp(username!, payload.newAccountName, payload.keys, payload.fee)\n ],\n async () => {\n await invalidateAfterBroadcast(auth?.adapter, broadcastMode, [\n QueryKeys.accounts.full(username),\n ]);\n },\n auth,\n 'active',\n { broadcastMode }\n );\n}\n"]}
1
+ {"version":3,"sources":["../../src/modules/accounts/mutations/use-create-account.ts"],"names":["useCreateAccount","username","auth","broadcastMode","useBroadcastMutation","payload","buildCreateClaimedAccountOp","buildAccountCreateOp","invalidateAfterBroadcast","QueryKeys"],"mappings":"yJAaO,SAASA,CAAAA,CACdC,CAAAA,CACAC,GAAAA,CACAC,CAAAA,CACA,CACA,OAAOC,CAAAA,CACL,CAAC,UAAA,CAAY,QAAQ,CAAA,CACrBH,CAAAA,CACCI,GAAY,CACXA,CAAAA,CAAQ,UAAA,CACJC,CAAAA,CAA4BL,CAAAA,CAAWI,CAAAA,CAAQ,cAAA,CAAgBA,CAAAA,CAAQ,IAAI,CAAA,CAC3EE,CAAAA,CAAqBN,CAAAA,CAAWI,CAAAA,CAAQ,cAAA,CAAgBA,EAAQ,IAAA,CAAMA,CAAAA,CAAQ,GAAG,CACvF,CAAA,CACA,SAAY,CACV,MAAMG,GAAAA,CAAyBN,GAAAA,EAAM,OAAA,CAASC,CAAAA,CAAe,CAC3DM,CAAAA,CAAU,SAAS,IAAA,CAAKR,CAAQ,CAClC,CAAC,EACH,CAAA,CACAC,GAAAA,CACA,QAAA,CACA,CAAE,aAAA,CAAAC,CAAc,CAClB,CACF","file":"chunk-XVW7ZC72.js","sourcesContent":["import { useBroadcastMutation, invalidateAfterBroadcast, QueryKeys } from \"@/modules/core\";\nimport type { BroadcastMode } from \"@/modules/core\";\nimport { buildAccountCreateOp, buildCreateClaimedAccountOp, type AccountKeys } from \"@/modules/operations/builders\";\nimport type { AuthContextV2 } from \"@/modules/core/types\";\n\nexport interface CreateAccountPayload {\n newAccountName: string;\n keys: AccountKeys;\n fee: string;\n /** If true, uses a claimed account token instead of paying the fee */\n useClaimed?: boolean;\n}\n\nexport function useCreateAccount(\n username: string | undefined,\n auth?: AuthContextV2,\n broadcastMode?: BroadcastMode\n) {\n return useBroadcastMutation<CreateAccountPayload>(\n [\"accounts\", \"create\"],\n username,\n (payload) => [\n payload.useClaimed\n ? buildCreateClaimedAccountOp(username!, payload.newAccountName, payload.keys)\n : buildAccountCreateOp(username!, payload.newAccountName, payload.keys, payload.fee)\n ],\n async () => {\n await invalidateAfterBroadcast(auth?.adapter, broadcastMode, [\n QueryKeys.accounts.full(username),\n ]);\n },\n auth,\n 'active',\n { broadcastMode }\n );\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {a as a$1}from'./chunk-W6TVTSY5.js';import {a as a$2}from'./chunk-KT7GFFA7.js';import {a}from'./chunk-OS3FCYZY.js';import {bytesToHex}from'@noble/hashes/utils.js';var b={};a(b,{buildWitnessSetProperties:()=>f,makeBitMaskFilter:()=>p,operations:()=>d,validateUsername:()=>u});var u=r=>{let e="Account name should ";if(!r)return e+"not be empty.";let t=r.length;if(t<3)return e+"be longer.";if(t>16)return e+"be shorter.";/\./.test(r)&&(e="Each account segment should ");let s=r.split("."),n=s.length;for(let _=0;_<n;_++){let i=s[_];if(!/^[a-z]/.test(i))return e+"start with a lowercase letter.";if(!/^[a-z0-9-]*$/.test(i))return e+"have only lowercase letters, digits, or dashes.";if(!/[a-z0-9]$/.test(i))return e+"end with a lowercase letter or digit.";if(i.length<3)return e+"be longer."}return null},d={vote:0,comment:1,transfer:2,transfer_to_vesting:3,withdraw_vesting:4,limit_order_create:5,limit_order_cancel:6,feed_publish:7,convert:8,account_create:9,account_update:10,witness_update:11,account_witness_vote:12,account_witness_proxy:13,pow:14,custom:15,report_over_production:16,delete_comment:17,custom_json:18,comment_options:19,set_withdraw_vesting_route:20,limit_order_create2:21,claim_account:22,create_claimed_account:23,request_account_recovery:24,recover_account:25,change_recovery_account:26,escrow_transfer:27,escrow_dispute:28,escrow_release:29,pow2:30,escrow_approve:31,transfer_to_savings:32,transfer_from_savings:33,cancel_transfer_from_savings:34,custom_binary:35,decline_voting_rights:36,reset_account:37,set_reset_account:38,claim_reward_balance:39,delegate_vesting_shares:40,account_create_with_delegation:41,witness_set_properties:42,account_update2:43,create_proposal:44,update_proposal_votes:45,remove_proposal:46,update_proposal:47,collateralized_convert:48,recurrent_transfer:49,fill_convert_request:50,author_reward:51,curation_reward:52,comment_reward:53,liquidity_reward:54,interest:55,fill_vesting_withdraw:56,fill_order:57,shutdown_witness:58,fill_transfer_from_savings:59,hardfork:60,comment_payout_update:61,return_vesting_delegation:62,comment_benefactor_reward:63,producer_reward:64,clear_null_account_balance:65,proposal_pay:66,sps_fund:67,hardfork_hive:68,hardfork_hive_restore:69,delayed_voting:70,consolidate_treasury_balance:71,effective_comment_vote:72,ineffective_delete_comment:73,sps_convert:74,expired_account_notification:75,changed_recovery_account:76,transfer_to_vesting_completed:77,pow_reward:78,vesting_shares_split:79,account_created:80,fill_collateralized_convert_request:81,system_warning:82,fill_recurrent_transfer:83,failed_recurrent_transfer:84,limit_order_cancelled:85,producer_missed:86,proposal_fee:87,collateralized_convert_immediate_conversion:88,escrow_approved:89,escrow_rejected:90,proxy_cleared:91,declined_voting_rights:92},p=r=>r.reduce(g,[BigInt(0),BigInt(0)]).map(e=>e!==BigInt(0)?e.toString():null),g=([r,e],t)=>t<64?[r|BigInt(1)<<BigInt(t),e]:[r,e|BigInt(1)<<BigInt(t-64)],f=(r,e)=>{let t={extensions:[],owner:r,props:[]};for(let s of Object.keys(e)){if(e[s]===void 0)continue;let n;switch(s){case "key":case "new_signing_key":n=a$1.PublicKey;break;case "account_subsidy_budget":case "account_subsidy_decay":case "maximum_block_size":n=a$1.UInt32;break;case "hbd_interest_rate":n=a$1.UInt16;break;case "url":n=a$1.String;break;case "hbd_exchange_rate":n=a$1.Price;break;case "account_creation_fee":n=a$1.Asset;break;default:throw new Error(`Unknown witness prop: ${s}`)}t.props.push([s,m(n,e[s])]);}return t.props.sort((s,n)=>s[0].localeCompare(n[0])),["witness_set_properties",t]},m=(r,e)=>{let t=new a$2(a$2.DEFAULT_CAPACITY,a$2.LITTLE_ENDIAN);return r(t,e),t.flip(),bytesToHex(new Uint8Array(t.toBuffer()))};export{u as a,d as b,p as c,f as d,b as e};//# sourceMappingURL=chunk-6PK5KYS5.js.map
2
- //# sourceMappingURL=chunk-6PK5KYS5.js.map
1
+ import {a as a$1}from'./chunk-FJXZ5DK2.js';import {a as a$2}from'./chunk-KT7GFFA7.js';import {a}from'./chunk-OS3FCYZY.js';import {bytesToHex}from'@noble/hashes/utils.js';var b={};a(b,{buildWitnessSetProperties:()=>f,makeBitMaskFilter:()=>p,operations:()=>d,validateUsername:()=>u});var u=r=>{let e="Account name should ";if(!r)return e+"not be empty.";let t=r.length;if(t<3)return e+"be longer.";if(t>16)return e+"be shorter.";/\./.test(r)&&(e="Each account segment should ");let s=r.split("."),n=s.length;for(let _=0;_<n;_++){let i=s[_];if(!/^[a-z]/.test(i))return e+"start with a lowercase letter.";if(!/^[a-z0-9-]*$/.test(i))return e+"have only lowercase letters, digits, or dashes.";if(!/[a-z0-9]$/.test(i))return e+"end with a lowercase letter or digit.";if(i.length<3)return e+"be longer."}return null},d={vote:0,comment:1,transfer:2,transfer_to_vesting:3,withdraw_vesting:4,limit_order_create:5,limit_order_cancel:6,feed_publish:7,convert:8,account_create:9,account_update:10,witness_update:11,account_witness_vote:12,account_witness_proxy:13,pow:14,custom:15,report_over_production:16,delete_comment:17,custom_json:18,comment_options:19,set_withdraw_vesting_route:20,limit_order_create2:21,claim_account:22,create_claimed_account:23,request_account_recovery:24,recover_account:25,change_recovery_account:26,escrow_transfer:27,escrow_dispute:28,escrow_release:29,pow2:30,escrow_approve:31,transfer_to_savings:32,transfer_from_savings:33,cancel_transfer_from_savings:34,custom_binary:35,decline_voting_rights:36,reset_account:37,set_reset_account:38,claim_reward_balance:39,delegate_vesting_shares:40,account_create_with_delegation:41,witness_set_properties:42,account_update2:43,create_proposal:44,update_proposal_votes:45,remove_proposal:46,update_proposal:47,collateralized_convert:48,recurrent_transfer:49,fill_convert_request:50,author_reward:51,curation_reward:52,comment_reward:53,liquidity_reward:54,interest:55,fill_vesting_withdraw:56,fill_order:57,shutdown_witness:58,fill_transfer_from_savings:59,hardfork:60,comment_payout_update:61,return_vesting_delegation:62,comment_benefactor_reward:63,producer_reward:64,clear_null_account_balance:65,proposal_pay:66,sps_fund:67,hardfork_hive:68,hardfork_hive_restore:69,delayed_voting:70,consolidate_treasury_balance:71,effective_comment_vote:72,ineffective_delete_comment:73,sps_convert:74,expired_account_notification:75,changed_recovery_account:76,transfer_to_vesting_completed:77,pow_reward:78,vesting_shares_split:79,account_created:80,fill_collateralized_convert_request:81,system_warning:82,fill_recurrent_transfer:83,failed_recurrent_transfer:84,limit_order_cancelled:85,producer_missed:86,proposal_fee:87,collateralized_convert_immediate_conversion:88,escrow_approved:89,escrow_rejected:90,proxy_cleared:91,declined_voting_rights:92},p=r=>r.reduce(g,[BigInt(0),BigInt(0)]).map(e=>e!==BigInt(0)?e.toString():null),g=([r,e],t)=>t<64?[r|BigInt(1)<<BigInt(t),e]:[r,e|BigInt(1)<<BigInt(t-64)],f=(r,e)=>{let t={extensions:[],owner:r,props:[]};for(let s of Object.keys(e)){if(e[s]===void 0)continue;let n;switch(s){case "key":case "new_signing_key":n=a$1.PublicKey;break;case "account_subsidy_budget":case "account_subsidy_decay":case "maximum_block_size":n=a$1.UInt32;break;case "hbd_interest_rate":n=a$1.UInt16;break;case "url":n=a$1.String;break;case "hbd_exchange_rate":n=a$1.Price;break;case "account_creation_fee":n=a$1.Asset;break;default:throw new Error(`Unknown witness prop: ${s}`)}t.props.push([s,m(n,e[s])]);}return t.props.sort((s,n)=>s[0].localeCompare(n[0])),["witness_set_properties",t]},m=(r,e)=>{let t=new a$2(a$2.DEFAULT_CAPACITY,a$2.LITTLE_ENDIAN);return r(t,e),t.flip(),bytesToHex(new Uint8Array(t.toBuffer()))};export{u as a,d as b,p as c,f as d,b as e};//# sourceMappingURL=chunk-XX32ZFT4.js.map
2
+ //# sourceMappingURL=chunk-XX32ZFT4.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/hive-tx/helpers/utils.ts"],"names":["utils_exports","__export","buildWitnessSetProperties","makeBitMaskFilter","operations","validateUsername","username","suffix","length","ref","len","i","label","allowedOperations","reduceFunction","value","low","high","allowedOperation","owner","props","data","key","type","Serializer","serialize","a","b","serializer","buffer","ByteBuffer","bytesToHex"],"mappings":"0KAAA,IAAAA,CAAAA,CAAA,GAAAC,CAAAA,CAAAD,CAAAA,CAAA,CAAA,yBAAA,CAAA,IAAAE,CAAAA,CAAA,iBAAA,CAAA,IAAAC,CAAAA,CAAA,UAAA,CAAA,IAAAC,CAAAA,CAAA,gBAAA,CAAA,IAAAC,CAAAA,CAAAA,CAAAA,CAkBO,IAAMA,CAAAA,CAAoBC,CAAAA,EAAoC,CACnE,IAAIC,CAAAA,CAAS,sBAAA,CACb,GAAI,CAACD,CAAAA,CACH,OAAOC,CAAAA,CAAS,eAAA,CAElB,IAAMC,CAAAA,CAASF,CAAAA,CAAS,MAAA,CACxB,GAAIE,CAAAA,CAAS,CAAA,CACX,OAAOD,CAAAA,CAAS,YAAA,CAElB,GAAIC,CAAAA,CAAS,EAAA,CACX,OAAOD,CAAAA,CAAS,aAAA,CAEd,IAAA,CAAK,IAAA,CAAKD,CAAQ,CAAA,GACpBC,CAAAA,CAAS,8BAAA,CAAA,CAEX,IAAME,CAAAA,CAAMH,CAAAA,CAAS,KAAA,CAAM,GAAG,CAAA,CACxBI,CAAAA,CAAMD,CAAAA,CAAI,MAAA,CAChB,IAAA,IAASE,CAAAA,CAAI,CAAA,CAAGA,CAAAA,CAAID,CAAAA,CAAKC,CAAAA,EAAAA,CAA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5KYS5.js","sourcesContent":["import { Serializer } from './serializer'\nimport { ByteBuffer } from './ByteBuffer'\nimport { PublicKey } from './PublicKey'\nimport { bytesToHex } from '@noble/hashes/utils.js'\n\nexport interface WitnessProps {\n account_creation_fee?: string\n account_subsidy_budget?: number\n account_subsidy_decay?: number\n key: PublicKey | string\n maximum_block_size?: number\n new_signing_key?: PublicKey | string | null\n hbd_exchange_rate?: { base: string; quote: string }\n hbd_interest_rate?: number\n url?: string\n}\n\n/** Return null for a valid username */\nexport const validateUsername = (username: string): null | string => {\n let suffix = 'Account name should '\n if (!username) {\n return suffix + 'not be empty.'\n }\n const length = username.length\n if (length < 3) {\n return suffix + 'be longer.'\n }\n if (length > 16) {\n return suffix + 'be shorter.'\n }\n if (/\\./.test(username)) {\n suffix = 'Each account segment should '\n }\n const ref = username.split('.')\n const len = ref.length\n for (let i = 0; i < len; i++) {\n const label = ref[i]\n if (!/^[a-z]/.test(label)) {\n return suffix + 'start with a lowercase letter.'\n }\n if (!/^[a-z0-9-]*$/.test(label)) {\n return suffix + 'have only lowercase letters, digits, or dashes.'\n }\n if (!/[a-z0-9]$/.test(label)) {\n return suffix + 'end with a lowercase letter or digit.'\n }\n if (label.length < 3) {\n return suffix + 'be longer.'\n }\n }\n return null\n}\n\nexport const operations = {\n vote: 0,\n comment: 1,\n transfer: 2,\n transfer_to_vesting: 3,\n withdraw_vesting: 4,\n limit_order_create: 5,\n limit_order_cancel: 6,\n feed_publish: 7,\n convert: 8,\n account_create: 9,\n account_update: 10,\n witness_update: 11,\n account_witness_vote: 12,\n account_witness_proxy: 13,\n pow: 14,\n custom: 15,\n report_over_production: 16,\n delete_comment: 17,\n custom_json: 18,\n comment_options: 19,\n set_withdraw_vesting_route: 20,\n limit_order_create2: 21,\n claim_account: 22,\n create_claimed_account: 23,\n request_account_recovery: 24,\n recover_account: 25,\n change_recovery_account: 26,\n escrow_transfer: 27,\n escrow_dispute: 28,\n escrow_release: 29,\n pow2: 30,\n escrow_approve: 31,\n transfer_to_savings: 32,\n transfer_from_savings: 33,\n cancel_transfer_from_savings: 34,\n custom_binary: 35,\n decline_voting_rights: 36,\n reset_account: 37,\n set_reset_account: 38,\n claim_reward_balance: 39,\n delegate_vesting_shares: 40,\n account_create_with_delegation: 41,\n witness_set_properties: 42,\n account_update2: 43,\n create_proposal: 44,\n update_proposal_votes: 45,\n remove_proposal: 46,\n update_proposal: 47,\n collateralized_convert: 48,\n recurrent_transfer: 49,\n // virtual ops\n fill_convert_request: 50,\n author_reward: 51,\n curation_reward: 52,\n comment_reward: 53,\n liquidity_reward: 54,\n interest: 55,\n fill_vesting_withdraw: 56,\n fill_order: 57,\n shutdown_witness: 58,\n fill_transfer_from_savings: 59,\n hardfork: 60,\n comment_payout_update: 61,\n return_vesting_delegation: 62,\n comment_benefactor_reward: 63,\n producer_reward: 64,\n clear_null_account_balance: 65,\n proposal_pay: 66,\n sps_fund: 67,\n hardfork_hive: 68,\n hardfork_hive_restore: 69,\n delayed_voting: 70,\n consolidate_treasury_balance: 71,\n effective_comment_vote: 72,\n ineffective_delete_comment: 73,\n sps_convert: 74,\n expired_account_notification: 75,\n changed_recovery_account: 76,\n transfer_to_vesting_completed: 77,\n pow_reward: 78,\n vesting_shares_split: 79,\n account_created: 80,\n fill_collateralized_convert_request: 81,\n system_warning: 82,\n fill_recurrent_transfer: 83,\n failed_recurrent_transfer: 84,\n limit_order_cancelled: 85,\n producer_missed: 86,\n proposal_fee: 87,\n collateralized_convert_immediate_conversion: 88,\n escrow_approved: 89,\n escrow_rejected: 90,\n proxy_cleared: 91,\n declined_voting_rights: 92\n}\n\n/**\n * Make bitmask filter to be used with get_account_history call\n */\nexport const makeBitMaskFilter = (allowedOperations: number[]): [string | null, string | null] => {\n return allowedOperations\n .reduce(reduceFunction, [BigInt(0), BigInt(0)])\n .map((value: bigint) => (value !== BigInt(0) ? value.toString() : null)) as [string | null, string | null]\n}\nconst reduceFunction = (\n [low, high]: [bigint, bigint],\n allowedOperation: number\n): [bigint, bigint] => {\n if (allowedOperation < 64) {\n return [low | (BigInt(1) << BigInt(allowedOperation)), high]\n } else {\n return [low, high | (BigInt(1) << BigInt(allowedOperation - 64))]\n }\n}\n\nexport const buildWitnessSetProperties = (\n owner: string,\n props: WitnessProps\n): ['witness_set_properties', { extensions: never[]; owner: string; props: any }] => {\n const data = {\n extensions: [],\n owner,\n props: <any>[]\n }\n for (const key of Object.keys(props)) {\n if ((props as any)[key] === undefined) continue\n let type\n switch (key) {\n case 'key':\n case 'new_signing_key':\n type = Serializer.PublicKey\n break\n case 'account_subsidy_budget':\n case 'account_subsidy_decay':\n case 'maximum_block_size':\n type = Serializer.UInt32\n break\n case 'hbd_interest_rate':\n type = Serializer.UInt16\n break\n case 'url':\n type = Serializer.String\n break\n case 'hbd_exchange_rate':\n type = Serializer.Price\n break\n case 'account_creation_fee':\n type = Serializer.Asset\n break\n default:\n throw new Error(`Unknown witness prop: ${key}`)\n }\n data.props.push([key, serialize(type, props[key])])\n }\n data.props.sort((a: any, b: any) => a[0].localeCompare(b[0]))\n return ['witness_set_properties', data]\n}\n\nconst serialize = (serializer: any, data: any) => {\n const buffer = new ByteBuffer(ByteBuffer.DEFAULT_CAPACITY, ByteBuffer.LITTLE_ENDIAN)\n serializer(buffer, data)\n buffer.flip()\n // `props` values must be hex\n return bytesToHex(new Uint8Array(buffer.toBuffer()))\n}\n"]}
1
+ {"version":3,"sources":["../../src/hive-tx/helpers/utils.ts"],"names":["utils_exports","__export","buildWitnessSetProperties","makeBitMaskFilter","operations","validateUsername","username","suffix","length","ref","len","i","label","allowedOperations","reduceFunction","value","low","high","allowedOperation","owner","props","data","key","type","Serializer","serialize","a","b","serializer","buffer","ByteBuffer","bytesToHex"],"mappings":"0KAAA,IAAAA,CAAAA,CAAA,GAAAC,CAAAA,CAAAD,CAAAA,CAAA,CAAA,yBAAA,CAAA,IAAAE,CAAAA,CAAA,iBAAA,CAAA,IAAAC,CAAAA,CAAA,UAAA,CAAA,IAAAC,CAAAA,CAAA,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KG,CAAAA,CAAUF,CAAAA,CAAMH,CAAAA,CAAME,CAAG,CAAC,CAAC,CAAC,EACpD,CACA,OAAAD,CAAAA,CAAK,KAAA,CAAM,IAAA,CAAK,CAACK,CAAAA,CAAQC,CAAAA,GAAWD,CAAAA,CAAE,CAAC,CAAA,CAAE,aAAA,CAAcC,CAAAA,CAAE,CAAC,CAAC,CAAC,CAAA,CACrD,CAAC,wBAAA,CAA0BN,CAAI,CACxC,CAAA,CAEMI,CAAAA,CAAY,CAACG,CAAAA,CAAiBP,CAAAA,GAAc,CAChD,IAAMQ,CAAAA,CAAS,IAAIC,GAAAA,CAAWA,GAAAA,CAAW,gBAAA,CAAkBA,GAAAA,CAAW,aAAa,CAAA,CACnF,OAAAF,CAAAA,CAAWC,CAAAA,CAAQR,CAAI,CAAA,CACvBQ,CAAAA,CAAO,IAAA,EAAK,CAELE,UAAAA,CAAW,IAAI,UAAA,CAAWF,CAAAA,CAAO,QAAA,EAAU,CAAC,CACrD","file":"chunk-XX32ZFT4.js","sourcesContent":["import { Serializer } from './serializer'\nimport { ByteBuffer } from './ByteBuffer'\nimport { PublicKey } from './PublicKey'\nimport { bytesToHex } from '@noble/hashes/utils.js'\n\nexport interface WitnessProps {\n account_creation_fee?: string\n account_subsidy_budget?: number\n account_subsidy_decay?: number\n key: PublicKey | string\n maximum_block_size?: number\n new_signing_key?: PublicKey | string | null\n hbd_exchange_rate?: { base: string; quote: string }\n hbd_interest_rate?: number\n url?: string\n}\n\n/** Return null for a valid username */\nexport const validateUsername = (username: string): null | string => {\n let suffix = 'Account name should '\n if (!username) {\n return suffix + 'not be empty.'\n }\n const length = username.length\n if (length < 3) {\n return suffix + 'be longer.'\n }\n if (length > 16) {\n return suffix + 'be shorter.'\n }\n if (/\\./.test(username)) {\n suffix = 'Each account segment should '\n }\n const ref = username.split('.')\n const len = ref.length\n for (let i = 0; i < len; i++) {\n const label = ref[i]\n if (!/^[a-z]/.test(label)) {\n return suffix + 'start with a lowercase letter.'\n }\n if (!/^[a-z0-9-]*$/.test(label)) {\n return suffix + 'have only lowercase letters, digits, or dashes.'\n }\n if (!/[a-z0-9]$/.test(label)) {\n return suffix + 'end with a lowercase letter or digit.'\n }\n if (label.length < 3) {\n return suffix + 'be longer.'\n }\n }\n return null\n}\n\nexport const operations = {\n vote: 0,\n comment: 1,\n transfer: 2,\n transfer_to_vesting: 3,\n withdraw_vesting: 4,\n limit_order_create: 5,\n limit_order_cancel: 6,\n feed_publish: 7,\n convert: 8,\n account_create: 9,\n account_update: 10,\n witness_update: 11,\n account_witness_vote: 12,\n account_witness_proxy: 13,\n pow: 14,\n custom: 15,\n report_over_production: 16,\n delete_comment: 17,\n custom_json: 18,\n comment_options: 19,\n set_withdraw_vesting_route: 20,\n limit_order_create2: 21,\n claim_account: 22,\n create_claimed_account: 23,\n request_account_recovery: 24,\n recover_account: 25,\n change_recovery_account: 26,\n escrow_transfer: 27,\n escrow_dispute: 28,\n escrow_release: 29,\n pow2: 30,\n escrow_approve: 31,\n transfer_to_savings: 32,\n transfer_from_savings: 33,\n cancel_transfer_from_savings: 34,\n custom_binary: 35,\n decline_voting_rights: 36,\n reset_account: 37,\n set_reset_account: 38,\n claim_reward_balance: 39,\n delegate_vesting_shares: 40,\n account_create_with_delegation: 41,\n witness_set_properties: 42,\n account_update2: 43,\n create_proposal: 44,\n update_proposal_votes: 45,\n remove_proposal: 46,\n update_proposal: 47,\n collateralized_convert: 48,\n recurrent_transfer: 49,\n // virtual ops\n fill_convert_request: 50,\n author_reward: 51,\n curation_reward: 52,\n comment_reward: 53,\n liquidity_reward: 54,\n interest: 55,\n fill_vesting_withdraw: 56,\n fill_order: 57,\n shutdown_witness: 58,\n fill_transfer_from_savings: 59,\n hardfork: 60,\n comment_payout_update: 61,\n return_vesting_delegation: 62,\n comment_benefactor_reward: 63,\n producer_reward: 64,\n clear_null_account_balance: 65,\n proposal_pay: 66,\n sps_fund: 67,\n hardfork_hive: 68,\n hardfork_hive_restore: 69,\n delayed_voting: 70,\n consolidate_treasury_balance: 71,\n effective_comment_vote: 72,\n ineffective_delete_comment: 73,\n sps_convert: 74,\n expired_account_notification: 75,\n changed_recovery_account: 76,\n transfer_to_vesting_completed: 77,\n pow_reward: 78,\n vesting_shares_split: 79,\n account_created: 80,\n fill_collateralized_convert_request: 81,\n system_warning: 82,\n fill_recurrent_transfer: 83,\n failed_recurrent_transfer: 84,\n limit_order_cancelled: 85,\n producer_missed: 86,\n proposal_fee: 87,\n collateralized_convert_immediate_conversion: 88,\n escrow_approved: 89,\n escrow_rejected: 90,\n proxy_cleared: 91,\n declined_voting_rights: 92\n}\n\n/**\n * Make bitmask filter to be used with get_account_history call\n */\nexport const makeBitMaskFilter = (allowedOperations: number[]): [string | null, string | null] => {\n return allowedOperations\n .reduce(reduceFunction, [BigInt(0), BigInt(0)])\n .map((value: bigint) => (value !== BigInt(0) ? value.toString() : null)) as [string | null, string | null]\n}\nconst reduceFunction = (\n [low, high]: [bigint, bigint],\n allowedOperation: number\n): [bigint, bigint] => {\n if (allowedOperation < 64) {\n return [low | (BigInt(1) << BigInt(allowedOperation)), high]\n } else {\n return [low, high | (BigInt(1) << BigInt(allowedOperation - 64))]\n }\n}\n\nexport const buildWitnessSetProperties = (\n owner: string,\n props: WitnessProps\n): ['witness_set_properties', { extensions: never[]; owner: string; props: any }] => {\n const data = {\n extensions: [],\n owner,\n props: <any>[]\n }\n for (const key of Object.keys(props)) {\n if ((props as any)[key] === undefined) continue\n let type\n switch (key) {\n case 'key':\n case 'new_signing_key':\n type = Serializer.PublicKey\n break\n case 'account_subsidy_budget':\n case 'account_subsidy_decay':\n case 'maximum_block_size':\n type = Serializer.UInt32\n break\n case 'hbd_interest_rate':\n type = Serializer.UInt16\n break\n case 'url':\n type = Serializer.String\n break\n case 'hbd_exchange_rate':\n type = Serializer.Price\n break\n case 'account_creation_fee':\n type = Serializer.Asset\n break\n default:\n throw new Error(`Unknown witness prop: ${key}`)\n }\n data.props.push([key, serialize(type, props[key])])\n }\n data.props.sort((a: any, b: any) => a[0].localeCompare(b[0]))\n return ['witness_set_properties', data]\n}\n\nconst serialize = (serializer: any, data: any) => {\n const buffer = new ByteBuffer(ByteBuffer.DEFAULT_CAPACITY, ByteBuffer.LITTLE_ENDIAN)\n serializer(buffer, data)\n buffer.flip()\n // `props` values must be hex\n return bytesToHex(new Uint8Array(buffer.toBuffer()))\n}\n"]}
@@ -1,2 +1,2 @@
1
- import {d,e}from'./chunk-DX3UNW47.js';import {a}from'./chunk-KMM5LEOT.js';import {c,b}from'./chunk-UNI2VKFW.js';import {f}from'./chunk-XEB43J5Q.js';var C={ready:false,currentMana:0,maxMana:0,avgCost:0,cost:0,transactionBytes:0,estimatedCost:0,willLikelyFail:false,deficit:0,remaining:0};function V({rcAccount:t,rcStats:e,rcParams:r,operation:a,payload:n,fallback:l="minimal",buffer:u=1.2}){if(!t||!e?.ops)return C;let{current_mana:o,max_mana:m}=f(t),i=P(a,n,l,r,e);if(!i)return {...C,currentMana:o,maxMana:m};let{cost:c,transactionBytes:k}=i,f$1=Number.isFinite(u)&&u>0?u:1.2,s=c*f$1,p=o<s;return {ready:true,currentMana:o,maxMana:m,avgCost:c,cost:c,transactionBytes:k,estimatedCost:s,willLikelyFail:p,deficit:p?Math.ceil(s-o):0,remaining:Math.floor(o/c)}}function P(t,e$1,r,a$1,n){let l=v(n,t);if(!(t==="comment_operation"||t==="vote_operation")||!e$1&&r==="average")return l;if(!a$1?.resource_params||!a$1.size_info||!n.pool||!n.share)return null;let o={pool:n.pool,regen:n.regen,share:n.share};if(t==="vote_operation"){let f=e$1?.kind==="vote"?e$1.op:M,s=d(f),p=e({transactionBytes:s},a$1.size_info);return {cost:a(p,a$1,o).cost,transactionBytes:s}}let m=e$1?.kind==="comment"?e$1.op:L,i=e$1?.kind==="comment"?e$1.options:void 0,c$1=c({op:m,options:i}),k=b({transactionBytes:c$1,permlinkLength:m.permlink.length,beneficiaries:i?.beneficiaries?.length??0,hasCommentOptions:!!i},a$1.size_info);return {cost:a(k,a$1,o).cost,transactionBytes:c$1}}function v(t,e){let r=t.ops[e]?.avg_cost;return typeof r=="number"&&r>0?{cost:r,transactionBytes:0}:null}var L={author:"aaaaaaaaaa",permlink:"aaaaaaaaaaaaaaaaaaaa",parent_author:"",parent_permlink:"hive-100000",title:"",body:"",json_metadata:"{}"},M={voter:"aaaaaaaaaa",author:"aaaaaaaaaa",permlink:"aaaaaaaaaaaaaaaaaaaa"};export{V as a};//# sourceMappingURL=chunk-VPRG4WZA.js.map
2
- //# sourceMappingURL=chunk-VPRG4WZA.js.map
1
+ import {d,e}from'./chunk-DX3UNW47.js';import {a}from'./chunk-KMM5LEOT.js';import {c,b}from'./chunk-UNI2VKFW.js';import {f}from'./chunk-OQA55EE6.js';var C={ready:false,currentMana:0,maxMana:0,avgCost:0,cost:0,transactionBytes:0,estimatedCost:0,willLikelyFail:false,deficit:0,remaining:0};function V({rcAccount:t,rcStats:e,rcParams:r,operation:a,payload:n,fallback:l="minimal",buffer:u=1.2}){if(!t||!e?.ops)return C;let{current_mana:o,max_mana:m}=f(t),i=P(a,n,l,r,e);if(!i)return {...C,currentMana:o,maxMana:m};let{cost:c,transactionBytes:k}=i,f$1=Number.isFinite(u)&&u>0?u:1.2,s=c*f$1,p=o<s;return {ready:true,currentMana:o,maxMana:m,avgCost:c,cost:c,transactionBytes:k,estimatedCost:s,willLikelyFail:p,deficit:p?Math.ceil(s-o):0,remaining:Math.floor(o/c)}}function P(t,e$1,r,a$1,n){let l=v(n,t);if(!(t==="comment_operation"||t==="vote_operation")||!e$1&&r==="average")return l;if(!a$1?.resource_params||!a$1.size_info||!n.pool||!n.share)return null;let o={pool:n.pool,regen:n.regen,share:n.share};if(t==="vote_operation"){let f=e$1?.kind==="vote"?e$1.op:M,s=d(f),p=e({transactionBytes:s},a$1.size_info);return {cost:a(p,a$1,o).cost,transactionBytes:s}}let m=e$1?.kind==="comment"?e$1.op:L,i=e$1?.kind==="comment"?e$1.options:void 0,c$1=c({op:m,options:i}),k=b({transactionBytes:c$1,permlinkLength:m.permlink.length,beneficiaries:i?.beneficiaries?.length??0,hasCommentOptions:!!i},a$1.size_info);return {cost:a(k,a$1,o).cost,transactionBytes:c$1}}function v(t,e){let r=t.ops[e]?.avg_cost;return typeof r=="number"&&r>0?{cost:r,transactionBytes:0}:null}var L={author:"aaaaaaaaaa",permlink:"aaaaaaaaaaaaaaaaaaaa",parent_author:"",parent_permlink:"hive-100000",title:"",body:"",json_metadata:"{}"},M={voter:"aaaaaaaaaa",author:"aaaaaaaaaa",permlink:"aaaaaaaaaaaaaaaaaaaa"};export{V as a};//# sourceMappingURL=chunk-XZIXDSRW.js.map
2
+ //# sourceMappingURL=chunk-XZIXDSRW.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/resource-credits/utils/estimate-rc-precheck.ts"],"names":["EMPTY","estimateRcPrecheck","rcAccount","rcStats","rcParams","operation","payload","fallback","buffer","currentMana","maxMana","calculateRCMana","priced","priceOperation","cost","transactionBytes","safeBuffer","estimatedCost","willLikelyFail","average","averageCost","stats","op","MINIMAL_VOTE","estimateVoteTransactionBytes","usage","countVoteResourceUsage","priceRcUsage","MINIMAL_COMMENT","options","estimateCommentTransactionBytes","countCommentResourceUsage"],"mappings":"oJA+FA,IAAMA,EAA0B,CAC9B,KAAA,CAAO,KAAA,CACP,WAAA,CAAa,EACb,OAAA,CAAS,CAAA,CACT,OAAA,CAAS,CAAA,CACT,KAAM,CAAA,CACN,gBAAA,CAAkB,EAClB,aAAA,CAAe,CAAA,CACf,eAAgB,KAAA,CAChB,OAAA,CAAS,CAAA,CACT,SAAA,CAAW,CACb,CAAA,CAiBO,SAASC,EAAmB,CACjC,SAAA,CAAAC,EACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,OAAA,CAAAC,EACA,QAAA,CAAAC,CAAAA,CAAW,UACX,MAAA,CAAAC,CAAAA,CAAS,GACX,CAAA,CAAsC,CACpC,GAAI,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AAA,CAAAN,GAAiB,CAC7E,CAGA,SAASK,CAAAA,CACPjB,CAAAA,CACAE,EACmD,CACnD,IAAMS,EAAOX,CAAAA,CAAQ,GAAA,CAAIE,CAAS,CAAA,EAAG,SACrC,OAAO,OAAOS,GAAS,QAAA,EAAYA,CAAAA,CAAO,EAAI,CAAE,IAAA,CAAAA,CAAAA,CAAM,gBAAA,CAAkB,CAAE,CAAA,CAAI,IAChF,CAGA,IAAMc,CAAAA,CAA+B,CACnC,MAAA,CAAQ,YAAA,CACR,QAAA,CAAU,sBAAA,CACV,cAAe,EAAA,CACf,eAAA,CAAiB,cACjB,KAAA,CAAO,EAAA,CACP,KAAM,EAAA,CACN,aAAA,CAAe,IACjB,CAAA,CAEML,EAAyB,CAC7B,KAAA,CAAO,aACP,MAAA,CAAQ,YAAA,CACR,SAAU,sBACZ,CAAA","file":"chunk-VPRG4WZA.js","sourcesContent":["import { calculateRCMana } from \"@/modules/core/hive-tx\";\nimport type { RCAccount } from \"@/modules/core/hive-tx\";\nimport type { RcStats } from \"../types/stats\";\nimport type { RcResourceParams } from \"../types/resource-params\";\nimport { priceRcUsage } from \"./price-rc-usage\";\nimport {\n countVoteResourceUsage,\n estimateVoteTransactionBytes,\n type VoteLike\n} from \"./count-operation-usage\";\nimport {\n countCommentResourceUsage,\n estimateCommentTransactionBytes,\n type CommentLike,\n type CommentOptionsLike\n} from \"./estimate-comment-rc-cost\";\n\n/**\n * Operations the RC pre-check can estimate. Mirrors the keys exposed by\n * `rc_api.get_rc_stats` (see {@link RcStats}[\"ops\"]).\n */\nexport type RcPrecheckOperation = keyof RcStats[\"ops\"];\n\n/** The operation about to be broadcast, when the caller has it. */\nexport type RcPrecheckPayload =\n | { kind: \"comment\"; op: CommentLike; options?: CommentOptionsLike }\n | { kind: \"vote\"; op: VoteLike };\n\nexport interface RcPrecheckInput {\n /** From `getAccountRcQueryOptions(username)` -> rcAccounts[0]. */\n rcAccount: RCAccount | null | undefined;\n /** From `getRcStatsQueryOptions()`. */\n rcStats: RcStats | null | undefined;\n /** The operation the user is about to broadcast. */\n operation: RcPrecheckOperation;\n /**\n * From `getRcResourceParamsQueryOptions()`. Required for an exact estimate;\n * without it the result is not ready rather than silently approximate.\n */\n rcParams?: RcResourceParams | null;\n /**\n * The actual operation about to be broadcast. Supplying it is what makes the\n * estimate exact, because cost is dominated by the serialized transaction\n * size. Without it a minimal operation of that type is priced instead, which\n * is a lower bound: it can miss a marginal case but never invents one.\n */\n payload?: RcPrecheckPayload;\n /**\n * What to price when no payload is supplied.\n *\n * - `\"minimal\"` (default) prices the smallest operation of that type. It is\n * a lower bound, so a pre-submit warning is never invented for an\n * operation that would have succeeded.\n * - `\"average\"` prices the network average the chain publishes. Right for\n * \"how many of these can I afford\" displays, where there is no specific\n * operation in hand and the smallest conceivable one would flatter the\n * count.\n */\n fallback?: \"minimal\" | \"average\";\n /**\n * Safety multiplier applied to the operation cost when deciding\n * whether the broadcast will \"likely fail\". Actual on-chain cost varies with\n * network load, so we keep headroom. Defaults to 1.2.\n */\n buffer?: number;\n}\n\nexport interface RcPrecheckResult {\n /** Both inputs were available, so the estimate is meaningful. */\n ready: boolean;\n /** Current RC mana of the account. */\n currentMana: number;\n /** Maximum RC mana of the account. */\n maxMana: number;\n /**\n * RC cost of the operation itself.\n *\n * Named `avgCost` for backwards compatibility; it is no longer an average.\n * @deprecated prefer `cost`.\n */\n avgCost: number;\n /** RC cost of the operation, computed the way the chain computes it. */\n cost: number;\n /** Serialized transaction size, the dominant term for a comment. */\n transactionBytes: number;\n /** Average cost padded by `buffer`. */\n estimatedCost: number;\n /** `currentMana` is below the padded estimate -> broadcast likely fails. */\n willLikelyFail: boolean;\n /** RC shortfall vs the padded estimate (0 when not failing). */\n deficit: number;\n /** Roughly how many such operations the account can still afford. */\n remaining: number;\n}\n\nconst EMPTY: RcPrecheckResult = {\n ready: false,\n currentMana: 0,\n maxMana: 0,\n avgCost: 0,\n cost: 0,\n transactionBytes: 0,\n estimatedCost: 0,\n willLikelyFail: false,\n deficit: 0,\n remaining: 0,\n};\n\n/**\n * Pure, client-side estimate of whether an account has enough Resource Credits\n * to broadcast an operation, used to warn the user BEFORE they submit instead\n * of failing afterwards with the chain's \"Please wait to transact\" error.\n *\n * Costs are computed the way the chain computes them, from the actual\n * operation, not from the network-wide average. The average is dominated by\n * short replies and badly misleads on posts: it once told an account holding\n * 21.3B RC that it could afford 17 posts, and the next post it tried needed\n * 23.3B.\n *\n * Still a hint, never a hard gate: the buffer covers pool drift between the\n * estimate and the broadcast, and the publish/comment/vote action must stay\n * non-blocking.\n */\nexport function estimateRcPrecheck({\n rcAccount,\n rcStats,\n rcParams,\n operation,\n payload,\n fallback = \"minimal\",\n buffer = 1.2,\n}: RcPrecheckInput): RcPrecheckResult {\n if (!rcAccount || !rcStats?.ops) {\n return EMPTY;\n }\n\n const { current_mana: currentMana, max_mana: maxMana } = calculateRCMana(rcAccount);\n\n const priced = priceOperation(operation, payload, fallback, rcParams, rcStats);\n if (!priced) {\n // Nothing to price against: reporting \"ready\" here would be a silent\n // all-clear, which is the one answer a pre-check must never invent.\n return { ...EMPTY, currentMana, maxMana };\n }\n\n const { cost, transactionBytes } = priced;\n const safeBuffer = Number.isFinite(buffer) && buffer > 0 ? buffer : 1.2;\n const estimatedCost = cost * safeBuffer;\n const willLikelyFail = currentMana < estimatedCost;\n\n return {\n ready: true,\n currentMana,\n maxMana,\n avgCost: cost,\n cost,\n transactionBytes,\n estimatedCost,\n willLikelyFail,\n deficit: willLikelyFail ? Math.ceil(estimatedCost - currentMana) : 0,\n remaining: Math.floor(currentMana / cost),\n };\n}\n\n/**\n * Prices whichever operation the caller is about to broadcast.\n *\n * Comments and votes are the two operations whose cost swings with what the\n * user wrote, so they are priced from the payload, and pricing them needs the\n * curve parameters. Every other operation the type advertises (transfer,\n * custom_json, ...) is fixed-shape and takes the network average the chain\n * publishes, which needs nothing else.\n *\n * When no payload is supplied a minimal operation is priced. That is\n * deliberately a lower bound: it can miss a marginal case, but it never warns\n * about one that would have succeeded.\n *\n * Returns null when the answer would have to be invented, so the caller\n * reports \"not ready\" rather than a zero-cost all-clear.\n */\nfunction priceOperation(\n operation: RcPrecheckOperation,\n payload: RcPrecheckPayload | undefined,\n fallback: \"minimal\" | \"average\",\n rcParams: RcResourceParams | null | undefined,\n rcStats: RcStats\n): { cost: number; transactionBytes: number } | null {\n const average = averageCost(rcStats, operation);\n const pricedFromPayload =\n operation === \"comment_operation\" || operation === \"vote_operation\";\n\n // The average is a number the node already returned. It needs no curve\n // parameters, so a caller pricing a transfer must not be blocked waiting on\n // them, which is how every operation outside these two is priced.\n if (!pricedFromPayload || (!payload && fallback === \"average\")) {\n return average;\n }\n\n // Asked to price a real comment or vote without the inputs to do it. The\n // honest answer is \"not ready\": falling back to the average here is exactly\n // what told an account holding 21.3B RC it could afford 17 more posts.\n if (!rcParams?.resource_params || !rcParams.size_info || !rcStats.pool || !rcStats.share) {\n return null;\n }\n\n const stats = { pool: rcStats.pool, regen: rcStats.regen, share: rcStats.share };\n\n if (operation === \"vote_operation\") {\n const op: VoteLike = payload?.kind === \"vote\" ? payload.op : MINIMAL_VOTE;\n const transactionBytes = estimateVoteTransactionBytes(op);\n const usage = countVoteResourceUsage({ transactionBytes }, rcParams.size_info);\n return { cost: priceRcUsage(usage, rcParams, stats).cost, transactionBytes };\n }\n\n const op: CommentLike = payload?.kind === \"comment\" ? payload.op : MINIMAL_COMMENT;\n const options = payload?.kind === \"comment\" ? payload.options : undefined;\n const transactionBytes = estimateCommentTransactionBytes({ op, options });\n const usage = countCommentResourceUsage(\n {\n transactionBytes,\n permlinkLength: op.permlink.length,\n beneficiaries: options?.beneficiaries?.length ?? 0,\n hasCommentOptions: !!options\n },\n rcParams.size_info\n );\n return { cost: priceRcUsage(usage, rcParams, stats).cost, transactionBytes };\n}\n\n/** The network average the chain publishes for an operation, when it has one. */\nfunction averageCost(\n rcStats: RcStats,\n operation: RcPrecheckOperation\n): { cost: number; transactionBytes: number } | null {\n const cost = rcStats.ops[operation]?.avg_cost;\n return typeof cost === \"number\" && cost > 0 ? { cost, transactionBytes: 0 } : null;\n}\n\n/** Smallest realistic operations, used only when the caller has no payload yet. */\nconst MINIMAL_COMMENT: CommentLike = {\n author: \"aaaaaaaaaa\",\n permlink: \"aaaaaaaaaaaaaaaaaaaa\",\n parent_author: \"\",\n parent_permlink: \"hive-100000\",\n title: \"\",\n body: \"\",\n json_metadata: \"{}\"\n};\n\nconst MINIMAL_VOTE: VoteLike = {\n voter: \"aaaaaaaaaa\",\n author: \"aaaaaaaaaa\",\n permlink: \"aaaaaaaaaaaaaaaaaaaa\"\n};\n"]}
1
+ {"version":3,"sources":["../../src/modules/resource-credits/utils/estimate-rc-precheck.ts"],"names":["EMPTY","estimateRcPrecheck","rcAccount","rcStats","rcParams","operation","payload","fallback","buffer","currentMana","maxMana","calculateRCMana","priced","priceOperation","cost","transactionBytes","safeBuffer","estimatedCost","willLikelyFail","average","averageCost","stats","op","MINIMAL_VOTE","estimateVoteTransactionBytes","usage","countVoteResourceUsage","priceRcUsage","MINIMAL_COMMENT","options","estimateCommentTransactionBytes","countCommentResourceUsage"],"mappings":"oJA+FA,IAAMA,EAA0B,CAC9B,KAAA,CAAO,KAAA,CACP,WAAA,CAAa,EACb,OAAA,CAAS,CAAA,CACT,OAAA,CAAS,CAAA,CACT,KAAM,CAAA,CACN,gBAAA,CAAkB,EAClB,aAAA,CAAe,CAAA,CACf,eAAgB,KAAA,CAChB,OAAA,CAAS,CAAA,CACT,SAAA,CAAW,CACb,CAAA,CAiBO,SAASC,EAAmB,CACjC,SAAA,CAAAC,EACA,OAAA,CAAAC,CAAAA,CACA,QAAA,CAAAC,CAAAA,CACA,UAAAC,CAAAA,CACA,OAAA,CAAAC,EACA,QAAA,CAAAC,CAAAA,CAAW,UACX,MAAA,CAAAC,CAAAA,CAAS,GACX,CAAA,CAAsC,CACpC,GAAI,CAACN,CAAAA,EAAa,CAACC,GAAS,GAAA,CAC1B,OAAOH,CAAAA,CAGT,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,EACmD,CACnD,IAAMS,EAAOX,CAAAA,CAAQ,GAAA,CAAIE,CAAS,CAAA,EAAG,SACrC,OAAO,OAAOS,GAAS,QAAA,EAAYA,CAAAA,CAAO,EAAI,CAAE,IAAA,CAAAA,CAAAA,CAAM,gBAAA,CAAkB,CAAE,CAAA,CAAI,IAChF,CAGA,IAAMc,CAAAA,CAA+B,CACnC,MAAA,CAAQ,YAAA,CACR,QAAA,CAAU,sBAAA,CACV,cAAe,EAAA,CACf,eAAA,CAAiB,cACjB,KAAA,CAAO,EAAA,CACP,KAAM,EAAA,CACN,aAAA,CAAe,IACjB,CAAA,CAEML,EAAyB,CAC7B,KAAA,CAAO,aACP,MAAA,CAAQ,YAAA,CACR,SAAU,sBACZ,CAAA","file":"chunk-XZIXDSRW.js","sourcesContent":["import { calculateRCMana } from \"@/modules/core/hive-tx\";\nimport type { RCAccount } from \"@/modules/core/hive-tx\";\nimport type { RcStats } from \"../types/stats\";\nimport type { RcResourceParams } from \"../types/resource-params\";\nimport { priceRcUsage } from \"./price-rc-usage\";\nimport {\n countVoteResourceUsage,\n estimateVoteTransactionBytes,\n type VoteLike\n} from \"./count-operation-usage\";\nimport {\n countCommentResourceUsage,\n estimateCommentTransactionBytes,\n type CommentLike,\n type CommentOptionsLike\n} from \"./estimate-comment-rc-cost\";\n\n/**\n * Operations the RC pre-check can estimate. Mirrors the keys exposed by\n * `rc_api.get_rc_stats` (see {@link RcStats}[\"ops\"]).\n */\nexport type RcPrecheckOperation = keyof RcStats[\"ops\"];\n\n/** The operation about to be broadcast, when the caller has it. */\nexport type RcPrecheckPayload =\n | { kind: \"comment\"; op: CommentLike; options?: CommentOptionsLike }\n | { kind: \"vote\"; op: VoteLike };\n\nexport interface RcPrecheckInput {\n /** From `getAccountRcQueryOptions(username)` -> rcAccounts[0]. */\n rcAccount: RCAccount | null | undefined;\n /** From `getRcStatsQueryOptions()`. */\n rcStats: RcStats | null | undefined;\n /** The operation the user is about to broadcast. */\n operation: RcPrecheckOperation;\n /**\n * From `getRcResourceParamsQueryOptions()`. Required for an exact estimate;\n * without it the result is not ready rather than silently approximate.\n */\n rcParams?: RcResourceParams | null;\n /**\n * The actual operation about to be broadcast. Supplying it is what makes the\n * estimate exact, because cost is dominated by the serialized transaction\n * size. Without it a minimal operation of that type is priced instead, which\n * is a lower bound: it can miss a marginal case but never invents one.\n */\n payload?: RcPrecheckPayload;\n /**\n * What to price when no payload is supplied.\n *\n * - `\"minimal\"` (default) prices the smallest operation of that type. It is\n * a lower bound, so a pre-submit warning is never invented for an\n * operation that would have succeeded.\n * - `\"average\"` prices the network average the chain publishes. Right for\n * \"how many of these can I afford\" displays, where there is no specific\n * operation in hand and the smallest conceivable one would flatter the\n * count.\n */\n fallback?: \"minimal\" | \"average\";\n /**\n * Safety multiplier applied to the operation cost when deciding\n * whether the broadcast will \"likely fail\". Actual on-chain cost varies with\n * network load, so we keep headroom. Defaults to 1.2.\n */\n buffer?: number;\n}\n\nexport interface RcPrecheckResult {\n /** Both inputs were available, so the estimate is meaningful. */\n ready: boolean;\n /** Current RC mana of the account. */\n currentMana: number;\n /** Maximum RC mana of the account. */\n maxMana: number;\n /**\n * RC cost of the operation itself.\n *\n * Named `avgCost` for backwards compatibility; it is no longer an average.\n * @deprecated prefer `cost`.\n */\n avgCost: number;\n /** RC cost of the operation, computed the way the chain computes it. */\n cost: number;\n /** Serialized transaction size, the dominant term for a comment. */\n transactionBytes: number;\n /** Average cost padded by `buffer`. */\n estimatedCost: number;\n /** `currentMana` is below the padded estimate -> broadcast likely fails. */\n willLikelyFail: boolean;\n /** RC shortfall vs the padded estimate (0 when not failing). */\n deficit: number;\n /** Roughly how many such operations the account can still afford. */\n remaining: number;\n}\n\nconst EMPTY: RcPrecheckResult = {\n ready: false,\n currentMana: 0,\n maxMana: 0,\n avgCost: 0,\n cost: 0,\n transactionBytes: 0,\n estimatedCost: 0,\n willLikelyFail: false,\n deficit: 0,\n remaining: 0,\n};\n\n/**\n * Pure, client-side estimate of whether an account has enough Resource Credits\n * to broadcast an operation, used to warn the user BEFORE they submit instead\n * of failing afterwards with the chain's \"Please wait to transact\" error.\n *\n * Costs are computed the way the chain computes them, from the actual\n * operation, not from the network-wide average. The average is dominated by\n * short replies and badly misleads on posts: it once told an account holding\n * 21.3B RC that it could afford 17 posts, and the next post it tried needed\n * 23.3B.\n *\n * Still a hint, never a hard gate: the buffer covers pool drift between the\n * estimate and the broadcast, and the publish/comment/vote action must stay\n * non-blocking.\n */\nexport function estimateRcPrecheck({\n rcAccount,\n rcStats,\n rcParams,\n operation,\n payload,\n fallback = \"minimal\",\n buffer = 1.2,\n}: RcPrecheckInput): RcPrecheckResult {\n if (!rcAccount || !rcStats?.ops) {\n return EMPTY;\n }\n\n const { current_mana: currentMana, max_mana: maxMana } = calculateRCMana(rcAccount);\n\n const priced = priceOperation(operation, payload, fallback, rcParams, rcStats);\n if (!priced) {\n // Nothing to price against: reporting \"ready\" here would be a silent\n // all-clear, which is the one answer a pre-check must never invent.\n return { ...EMPTY, currentMana, maxMana };\n }\n\n const { cost, transactionBytes } = priced;\n const safeBuffer = Number.isFinite(buffer) && buffer > 0 ? buffer : 1.2;\n const estimatedCost = cost * safeBuffer;\n const willLikelyFail = currentMana < estimatedCost;\n\n return {\n ready: true,\n currentMana,\n maxMana,\n avgCost: cost,\n cost,\n transactionBytes,\n estimatedCost,\n willLikelyFail,\n deficit: willLikelyFail ? Math.ceil(estimatedCost - currentMana) : 0,\n remaining: Math.floor(currentMana / cost),\n };\n}\n\n/**\n * Prices whichever operation the caller is about to broadcast.\n *\n * Comments and votes are the two operations whose cost swings with what the\n * user wrote, so they are priced from the payload, and pricing them needs the\n * curve parameters. Every other operation the type advertises (transfer,\n * custom_json, ...) is fixed-shape and takes the network average the chain\n * publishes, which needs nothing else.\n *\n * When no payload is supplied a minimal operation is priced. That is\n * deliberately a lower bound: it can miss a marginal case, but it never warns\n * about one that would have succeeded.\n *\n * Returns null when the answer would have to be invented, so the caller\n * reports \"not ready\" rather than a zero-cost all-clear.\n */\nfunction priceOperation(\n operation: RcPrecheckOperation,\n payload: RcPrecheckPayload | undefined,\n fallback: \"minimal\" | \"average\",\n rcParams: RcResourceParams | null | undefined,\n rcStats: RcStats\n): { cost: number; transactionBytes: number } | null {\n const average = averageCost(rcStats, operation);\n const pricedFromPayload =\n operation === \"comment_operation\" || operation === \"vote_operation\";\n\n // The average is a number the node already returned. It needs no curve\n // parameters, so a caller pricing a transfer must not be blocked waiting on\n // them, which is how every operation outside these two is priced.\n if (!pricedFromPayload || (!payload && fallback === \"average\")) {\n return average;\n }\n\n // Asked to price a real comment or vote without the inputs to do it. The\n // honest answer is \"not ready\": falling back to the average here is exactly\n // what told an account holding 21.3B RC it could afford 17 more posts.\n if (!rcParams?.resource_params || !rcParams.size_info || !rcStats.pool || !rcStats.share) {\n return null;\n }\n\n const stats = { pool: rcStats.pool, regen: rcStats.regen, share: rcStats.share };\n\n if (operation === \"vote_operation\") {\n const op: VoteLike = payload?.kind === \"vote\" ? payload.op : MINIMAL_VOTE;\n const transactionBytes = estimateVoteTransactionBytes(op);\n const usage = countVoteResourceUsage({ transactionBytes }, rcParams.size_info);\n return { cost: priceRcUsage(usage, rcParams, stats).cost, transactionBytes };\n }\n\n const op: CommentLike = payload?.kind === \"comment\" ? payload.op : MINIMAL_COMMENT;\n const options = payload?.kind === \"comment\" ? payload.options : undefined;\n const transactionBytes = estimateCommentTransactionBytes({ op, options });\n const usage = countCommentResourceUsage(\n {\n transactionBytes,\n permlinkLength: op.permlink.length,\n beneficiaries: options?.beneficiaries?.length ?? 0,\n hasCommentOptions: !!options\n },\n rcParams.size_info\n );\n return { cost: priceRcUsage(usage, rcParams, stats).cost, transactionBytes };\n}\n\n/** The network average the chain publishes for an operation, when it has one. */\nfunction averageCost(\n rcStats: RcStats,\n operation: RcPrecheckOperation\n): { cost: number; transactionBytes: number } | null {\n const cost = rcStats.ops[operation]?.avg_cost;\n return typeof cost === \"number\" && cost > 0 ? { cost, transactionBytes: 0 } : null;\n}\n\n/** Smallest realistic operations, used only when the caller has no payload yet. */\nconst MINIMAL_COMMENT: CommentLike = {\n author: \"aaaaaaaaaa\",\n permlink: \"aaaaaaaaaaaaaaaaaaaa\",\n parent_author: \"\",\n parent_permlink: \"hive-100000\",\n title: \"\",\n body: \"\",\n json_metadata: \"{}\"\n};\n\nconst MINIMAL_VOTE: VoteLike = {\n voter: \"aaaaaaaaaa\",\n author: \"aaaaaaaaaa\",\n permlink: \"aaaaaaaaaaaaaaaaaaaa\"\n};\n"]}
@@ -1,2 +1,2 @@
1
- import {k}from'./chunk-UKK6NLAT.js';import {b as b$1}from'./chunk-CNB64U7U.js';import {b}from'./chunk-J2HM6MWA.js';import {a}from'./chunk-WTHEQ3M5.js';function p(t,r,i){return b(["wallet","set-withdraw-vesting-route"],t,e=>[k(t,e.toAccount,e.percent,e.autoVest)],async(e,s)=>{await b$1(r?.adapter,i,[a.wallet.withdrawRoutes(t),a.accounts.full(t),a.accounts.full(s.toAccount)]);},r,"active",{broadcastMode:i})}export{p as a};//# sourceMappingURL=chunk-SI7S4VLE.js.map
2
- //# sourceMappingURL=chunk-SI7S4VLE.js.map
1
+ import {k}from'./chunk-UKK6NLAT.js';import {b as b$1}from'./chunk-CNB64U7U.js';import {b}from'./chunk-PFVWZI3W.js';import {a}from'./chunk-WTHEQ3M5.js';function p(t,r,i){return b(["wallet","set-withdraw-vesting-route"],t,e=>[k(t,e.toAccount,e.percent,e.autoVest)],async(e,s)=>{await b$1(r?.adapter,i,[a.wallet.withdrawRoutes(t),a.accounts.full(t),a.accounts.full(s.toAccount)]);},r,"active",{broadcastMode:i})}export{p as a};//# sourceMappingURL=chunk-Z2HIVTNL.js.map
2
+ //# sourceMappingURL=chunk-Z2HIVTNL.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/modules/wallet/mutations/use-set-withdraw-vesting-route.ts"],"names":["useSetWithdrawVestingRoute","username","auth","broadcastMode","useBroadcastMutation","payload","buildSetWithdrawVestingRouteOp","_result","variables","invalidateAfterBroadcast","QueryKeys"],"mappings":"uJAwEO,SAASA,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACA,CACA,OAAOC,CAAAA,CACL,CAAC,QAAA,CAAU,4BAA4B,CAAA,CACvCH,CAAAA,CACCI,CAAAA,EAAY,CACXC,CAAAA,CACEL,CAAAA,CACAI,CAAAA,CAAQ,SAAA,CACRA,CAAAA,CAAQ,OAAA,CACRA,CAAAA,CAAQ,QACV,CACF,CAAA,CACA,MAAOE,CAAAA,CAASC,CAAAA,GAAc,CAE5B,MAAMC,GAAAA,CAAyBP,CAAAA,EAAM,OAAA,CAASC,CAAAA,CAAe,CAC3DO,CAAAA,CAAU,MAAA,CAAO,cAAA,CAAeT,CAAS,CAAA,CACzCS,CAAAA,CAAU,QAAA,CAAS,IAAA,CAAKT,CAAQ,CAAA,CAChCS,CAAAA,CAAU,QAAA,CAAS,IAAA,CAAKF,CAAAA,CAAU,SAAS,CAC7C,CAAC,EACH,CAAA,CACAN,CAAAA,CACA,QAAA,CACA,CAAE,aAAA,CAAAC,CAAc,CAClB,CACF","file":"chunk-SI7S4VLE.js","sourcesContent":["import { useBroadcastMutation, invalidateAfterBroadcast } from \"@/modules/core/mutations\";\nimport type { BroadcastMode } from \"@/modules/core/mutations\";\nimport { QueryKeys } from \"@/modules/core\";\nimport type { AuthContextV2 } from \"@/modules/core/types\";\nimport { buildSetWithdrawVestingRouteOp } from \"@/modules/operations/builders\";\n\n/**\n * Payload for setting withdraw vesting route.\n */\nexport interface SetWithdrawVestingRoutePayload {\n /** Account receiving withdrawn vesting */\n toAccount: string;\n /** Percentage to route (0-10000, where 10000 = 100%). Already scaled. */\n percent: number;\n /** Auto convert to vesting (power up) */\n autoVest: boolean;\n}\n\n/**\n * React Query mutation hook for setting withdraw vesting route.\n *\n * This mutation broadcasts a set_withdraw_vesting_route operation to configure\n * where withdrawn VESTS (power down) are sent. **Requires ACTIVE authority**, not posting.\n *\n * @param username - The username setting withdraw route (required for broadcast)\n * @param auth - Authentication context with platform adapter and fallback configuration\n *\n * @returns React Query mutation result\n *\n * @remarks\n * **IMPORTANT: Active Authority Required**\n * - Withdraw route operations require ACTIVE key, not posting key\n * - Make sure your auth adapter provides getActiveKey() method\n * - Keychain/HiveAuth will prompt for Active authority\n *\n * **Withdraw Route Mechanics:**\n * - Routes a percentage of power down (withdraw_vesting) to another account\n * - Percent must be between 0-10000 (where 10000 = 100%)\n * - Multiple routes can be set, total cannot exceed 100%\n * - autoVest=true converts withdrawn VESTS to HP in destination account\n * - autoVest=false converts withdrawn VESTS to liquid HIVE\n *\n * **Post-Broadcast Actions:**\n * - Invalidates withdraw routes cache to show updated routes\n * - Invalidates account data for both accounts\n *\n * @example\n * ```typescript\n * const setRouteMutation = useSetWithdrawVestingRoute(username, {\n * adapter: {\n * ...myAdapter,\n * getActiveKey: async (username) => getActiveKeyFromStorage(username)\n * },\n * enableFallback: true,\n * fallbackChain: ['keychain', 'key', 'hivesigner']\n * });\n *\n * // Route 50% of power down to another account (auto vest)\n * setRouteMutation.mutate({\n * toAccount: 'alice',\n * percent: 5000, // 50% (already scaled)\n * autoVest: true\n * });\n *\n * // Route 100% of power down to another account (liquid HIVE)\n * setRouteMutation.mutate({\n * toAccount: 'bob',\n * percent: 10000, // 100% (already scaled)\n * autoVest: false\n * });\n * ```\n */\nexport function useSetWithdrawVestingRoute(\n username: string | undefined,\n auth?: AuthContextV2,\n broadcastMode?: BroadcastMode\n) {\n return useBroadcastMutation<SetWithdrawVestingRoutePayload>(\n [\"wallet\", \"set-withdraw-vesting-route\"],\n username,\n (payload) => [\n buildSetWithdrawVestingRouteOp(\n username!,\n payload.toAccount,\n payload.percent,\n payload.autoVest\n )\n ],\n async (_result, variables) => {\n // Cache invalidation\n await invalidateAfterBroadcast(auth?.adapter, broadcastMode, [\n QueryKeys.wallet.withdrawRoutes(username!),\n QueryKeys.accounts.full(username),\n QueryKeys.accounts.full(variables.toAccount)\n ]);\n },\n auth,\n 'active', // IMPORTANT: Active authority required\n { broadcastMode }\n );\n}\n"]}
1
+ {"version":3,"sources":["../../src/modules/wallet/mutations/use-set-withdraw-vesting-route.ts"],"names":["useSetWithdrawVestingRoute","username","auth","broadcastMode","useBroadcastMutation","payload","buildSetWithdrawVestingRouteOp","_result","variables","invalidateAfterBroadcast","QueryKeys"],"mappings":"uJAwEO,SAASA,CAAAA,CACdC,CAAAA,CACAC,CAAAA,CACAC,CAAAA,CACA,CACA,OAAOC,CAAAA,CACL,CAAC,QAAA,CAAU,4BAA4B,CAAA,CACvCH,CAAAA,CACCI,CAAAA,EAAY,CACXC,CAAAA,CACEL,CAAAA,CACAI,CAAAA,CAAQ,SAAA,CACRA,CAAAA,CAAQ,OAAA,CACRA,CAAAA,CAAQ,QACV,CACF,CAAA,CACA,MAAOE,CAAAA,CAASC,CAAAA,GAAc,CAE5B,MAAMC,GAAAA,CAAyBP,CAAAA,EAAM,OAAA,CAASC,CAAAA,CAAe,CAC3DO,CAAAA,CAAU,MAAA,CAAO,cAAA,CAAeT,CAAS,CAAA,CACzCS,CAAAA,CAAU,QAAA,CAAS,IAAA,CAAKT,CAAQ,CAAA,CAChCS,CAAAA,CAAU,QAAA,CAAS,IAAA,CAAKF,CAAAA,CAAU,SAAS,CAC7C,CAAC,EACH,CAAA,CACAN,CAAAA,CACA,QAAA,CACA,CAAE,aAAA,CAAAC,CAAc,CAClB,CACF","file":"chunk-Z2HIVTNL.js","sourcesContent":["import { useBroadcastMutation, invalidateAfterBroadcast } from \"@/modules/core/mutations\";\nimport type { BroadcastMode } from \"@/modules/core/mutations\";\nimport { QueryKeys } from \"@/modules/core\";\nimport type { AuthContextV2 } from \"@/modules/core/types\";\nimport { buildSetWithdrawVestingRouteOp } from \"@/modules/operations/builders\";\n\n/**\n * Payload for setting withdraw vesting route.\n */\nexport interface SetWithdrawVestingRoutePayload {\n /** Account receiving withdrawn vesting */\n toAccount: string;\n /** Percentage to route (0-10000, where 10000 = 100%). Already scaled. */\n percent: number;\n /** Auto convert to vesting (power up) */\n autoVest: boolean;\n}\n\n/**\n * React Query mutation hook for setting withdraw vesting route.\n *\n * This mutation broadcasts a set_withdraw_vesting_route operation to configure\n * where withdrawn VESTS (power down) are sent. **Requires ACTIVE authority**, not posting.\n *\n * @param username - The username setting withdraw route (required for broadcast)\n * @param auth - Authentication context with platform adapter and fallback configuration\n *\n * @returns React Query mutation result\n *\n * @remarks\n * **IMPORTANT: Active Authority Required**\n * - Withdraw route operations require ACTIVE key, not posting key\n * - Make sure your auth adapter provides getActiveKey() method\n * - Keychain/HiveAuth will prompt for Active authority\n *\n * **Withdraw Route Mechanics:**\n * - Routes a percentage of power down (withdraw_vesting) to another account\n * - Percent must be between 0-10000 (where 10000 = 100%)\n * - Multiple routes can be set, total cannot exceed 100%\n * - autoVest=true converts withdrawn VESTS to HP in destination account\n * - autoVest=false converts withdrawn VESTS to liquid HIVE\n *\n * **Post-Broadcast Actions:**\n * - Invalidates withdraw routes cache to show updated routes\n * - Invalidates account data for both accounts\n *\n * @example\n * ```typescript\n * const setRouteMutation = useSetWithdrawVestingRoute(username, {\n * adapter: {\n * ...myAdapter,\n * getActiveKey: async (username) => getActiveKeyFromStorage(username)\n * },\n * enableFallback: true,\n * fallbackChain: ['keychain', 'key', 'hivesigner']\n * });\n *\n * // Route 50% of power down to another account (auto vest)\n * setRouteMutation.mutate({\n * toAccount: 'alice',\n * percent: 5000, // 50% (already scaled)\n * autoVest: true\n * });\n *\n * // Route 100% of power down to another account (liquid HIVE)\n * setRouteMutation.mutate({\n * toAccount: 'bob',\n * percent: 10000, // 100% (already scaled)\n * autoVest: false\n * });\n * ```\n */\nexport function useSetWithdrawVestingRoute(\n username: string | undefined,\n auth?: AuthContextV2,\n broadcastMode?: BroadcastMode\n) {\n return useBroadcastMutation<SetWithdrawVestingRoutePayload>(\n [\"wallet\", \"set-withdraw-vesting-route\"],\n username,\n (payload) => [\n buildSetWithdrawVestingRouteOp(\n username!,\n payload.toAccount,\n payload.percent,\n payload.autoVest\n )\n ],\n async (_result, variables) => {\n // Cache invalidation\n await invalidateAfterBroadcast(auth?.adapter, broadcastMode, [\n QueryKeys.wallet.withdrawRoutes(username!),\n QueryKeys.accounts.full(username),\n QueryKeys.accounts.full(variables.toAccount)\n ]);\n },\n auth,\n 'active', // IMPORTANT: Active authority required\n { broadcastMode }\n );\n}\n"]}
@@ -0,0 +1,2 @@
1
+ import {e}from'./chunk-XX32ZFT4.js';var o=Object.keys(e.operations);export{o as a};//# sourceMappingURL=chunk-Z3FAL7TO.js.map
2
+ //# sourceMappingURL=chunk-Z3FAL7TO.js.map