@hashgraphonline/standards-sdk 0.1.143 → 0.1.144-feat-solana-register.canary.d5edcec.80

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 (475) hide show
  1. package/dist/cjs/hcs-10/base-client.d.ts.map +1 -1
  2. package/dist/cjs/hcs-10/sdk.d.ts +8 -0
  3. package/dist/cjs/hcs-10/sdk.d.ts.map +1 -1
  4. package/dist/cjs/hcs-11/client.d.ts +2 -2
  5. package/dist/cjs/hcs-11/client.d.ts.map +1 -1
  6. package/dist/cjs/hcs-11/person-builder.d.ts +1 -0
  7. package/dist/cjs/hcs-11/person-builder.d.ts.map +1 -1
  8. package/dist/cjs/hcs-11/types.d.ts +1 -0
  9. package/dist/cjs/hcs-11/types.d.ts.map +1 -1
  10. package/dist/cjs/hcs-12/rendering/resource-manager.d.ts.map +1 -1
  11. package/dist/cjs/hcs-12/validation/schemas.d.ts +8 -8
  12. package/dist/cjs/hcs-14/issuers/hiero.d.ts.map +1 -1
  13. package/dist/cjs/hcs-15/browser.d.ts +2 -0
  14. package/dist/cjs/hcs-15/browser.d.ts.map +1 -1
  15. package/dist/cjs/hcs-15/sdk.d.ts +7 -1
  16. package/dist/cjs/hcs-15/sdk.d.ts.map +1 -1
  17. package/dist/cjs/hcs-15/tx.d.ts +4 -0
  18. package/dist/cjs/hcs-15/tx.d.ts.map +1 -1
  19. package/dist/cjs/hcs-15/types.d.ts +16 -1
  20. package/dist/cjs/hcs-15/types.d.ts.map +1 -1
  21. package/dist/cjs/hcs-16/browser.d.ts +11 -2
  22. package/dist/cjs/hcs-16/browser.d.ts.map +1 -1
  23. package/dist/cjs/hcs-16/sdk.d.ts +62 -1
  24. package/dist/cjs/hcs-16/sdk.d.ts.map +1 -1
  25. package/dist/cjs/hcs-16/tx.d.ts +21 -3
  26. package/dist/cjs/hcs-16/tx.d.ts.map +1 -1
  27. package/dist/cjs/hcs-17/base-client.d.ts +1 -0
  28. package/dist/cjs/hcs-17/base-client.d.ts.map +1 -1
  29. package/dist/cjs/hcs-17/sdk.d.ts.map +1 -1
  30. package/dist/cjs/hcs-17/tx.d.ts +2 -0
  31. package/dist/cjs/hcs-17/tx.d.ts.map +1 -1
  32. package/dist/cjs/hcs-17/types.d.ts +4 -0
  33. package/dist/cjs/hcs-17/types.d.ts.map +1 -1
  34. package/dist/cjs/hcs-21/types.d.ts +75 -75
  35. package/dist/cjs/index.d.ts.map +1 -1
  36. package/dist/cjs/services/registry-broker/client/adapters.d.ts +20 -0
  37. package/dist/cjs/services/registry-broker/client/adapters.d.ts.map +1 -0
  38. package/dist/cjs/services/registry-broker/client/agents.d.ts +16 -0
  39. package/dist/cjs/services/registry-broker/client/agents.d.ts.map +1 -0
  40. package/dist/cjs/services/registry-broker/client/base-client.d.ts +70 -0
  41. package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -0
  42. package/dist/cjs/services/registry-broker/client/chat-history.d.ts +23 -0
  43. package/dist/cjs/services/registry-broker/client/chat-history.d.ts.map +1 -0
  44. package/dist/cjs/services/registry-broker/client/chat.d.ts +33 -0
  45. package/dist/cjs/services/registry-broker/client/chat.d.ts.map +1 -0
  46. package/dist/cjs/services/registry-broker/client/credits.d.ts +40 -0
  47. package/dist/cjs/services/registry-broker/client/credits.d.ts.map +1 -0
  48. package/dist/cjs/services/registry-broker/client/encrypted-chat-manager.d.ts +35 -0
  49. package/dist/cjs/services/registry-broker/client/encrypted-chat-manager.d.ts.map +1 -0
  50. package/dist/cjs/services/registry-broker/client/encryption.d.ts +33 -0
  51. package/dist/cjs/services/registry-broker/client/encryption.d.ts.map +1 -0
  52. package/dist/cjs/services/registry-broker/client/errors.d.ts +19 -0
  53. package/dist/cjs/services/registry-broker/client/errors.d.ts.map +1 -0
  54. package/dist/cjs/services/registry-broker/client/feedback.d.ts +2 -0
  55. package/dist/cjs/services/registry-broker/client/feedback.d.ts.map +1 -0
  56. package/dist/cjs/services/registry-broker/client/ledger-auth.d.ts +10 -0
  57. package/dist/cjs/services/registry-broker/client/ledger-auth.d.ts.map +1 -0
  58. package/dist/cjs/services/registry-broker/client/search.d.ts +19 -0
  59. package/dist/cjs/services/registry-broker/client/search.d.ts.map +1 -0
  60. package/dist/cjs/services/registry-broker/client/utils.d.ts +21 -0
  61. package/dist/cjs/services/registry-broker/client/utils.d.ts.map +1 -0
  62. package/dist/cjs/services/registry-broker/client.d.ts +2 -205
  63. package/dist/cjs/services/registry-broker/client.d.ts.map +1 -1
  64. package/dist/cjs/services/registry-broker/private-key-signer.d.ts +1 -0
  65. package/dist/cjs/services/registry-broker/private-key-signer.d.ts.map +1 -1
  66. package/dist/cjs/services/registry-broker/schemas.d.ts +2509 -816
  67. package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
  68. package/dist/cjs/services/registry-broker/types.d.ts +64 -2
  69. package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
  70. package/dist/cjs/standards-sdk.cjs +3 -3
  71. package/dist/cjs/standards-sdk.cjs.map +1 -1
  72. package/dist/cjs/utils/crypto-abstraction.d.ts.map +1 -1
  73. package/dist/cjs/utils/crypto-env.d.ts.map +1 -1
  74. package/dist/cjs/utils/dynamic-import.d.ts +5 -1
  75. package/dist/cjs/utils/dynamic-import.d.ts.map +1 -1
  76. package/dist/cjs/utils/hash-adapter.d.ts.map +1 -1
  77. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  78. package/dist/es/hcs-10/sdk.d.ts +8 -0
  79. package/dist/es/hcs-10/sdk.d.ts.map +1 -1
  80. package/dist/es/hcs-11/client.d.ts +2 -2
  81. package/dist/es/hcs-11/client.d.ts.map +1 -1
  82. package/dist/es/hcs-11/person-builder.d.ts +1 -0
  83. package/dist/es/hcs-11/person-builder.d.ts.map +1 -1
  84. package/dist/es/hcs-11/types.d.ts +1 -0
  85. package/dist/es/hcs-11/types.d.ts.map +1 -1
  86. package/dist/es/hcs-12/rendering/resource-manager.d.ts.map +1 -1
  87. package/dist/es/hcs-12/validation/schemas.d.ts +8 -8
  88. package/dist/es/hcs-14/issuers/hiero.d.ts.map +1 -1
  89. package/dist/es/hcs-15/browser.d.ts +2 -0
  90. package/dist/es/hcs-15/browser.d.ts.map +1 -1
  91. package/dist/es/hcs-15/sdk.d.ts +7 -1
  92. package/dist/es/hcs-15/sdk.d.ts.map +1 -1
  93. package/dist/es/hcs-15/tx.d.ts +4 -0
  94. package/dist/es/hcs-15/tx.d.ts.map +1 -1
  95. package/dist/es/hcs-15/types.d.ts +16 -1
  96. package/dist/es/hcs-15/types.d.ts.map +1 -1
  97. package/dist/es/hcs-16/browser.d.ts +11 -2
  98. package/dist/es/hcs-16/browser.d.ts.map +1 -1
  99. package/dist/es/hcs-16/sdk.d.ts +62 -1
  100. package/dist/es/hcs-16/sdk.d.ts.map +1 -1
  101. package/dist/es/hcs-16/tx.d.ts +21 -3
  102. package/dist/es/hcs-16/tx.d.ts.map +1 -1
  103. package/dist/es/hcs-17/base-client.d.ts +1 -0
  104. package/dist/es/hcs-17/base-client.d.ts.map +1 -1
  105. package/dist/es/hcs-17/sdk.d.ts.map +1 -1
  106. package/dist/es/hcs-17/tx.d.ts +2 -0
  107. package/dist/es/hcs-17/tx.d.ts.map +1 -1
  108. package/dist/es/hcs-17/types.d.ts +4 -0
  109. package/dist/es/hcs-17/types.d.ts.map +1 -1
  110. package/dist/es/hcs-21/types.d.ts +75 -75
  111. package/dist/es/index.d.ts.map +1 -1
  112. package/dist/es/services/registry-broker/client/adapters.d.ts +20 -0
  113. package/dist/es/services/registry-broker/client/adapters.d.ts.map +1 -0
  114. package/dist/es/services/registry-broker/client/agents.d.ts +16 -0
  115. package/dist/es/services/registry-broker/client/agents.d.ts.map +1 -0
  116. package/dist/es/services/registry-broker/client/base-client.d.ts +70 -0
  117. package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -0
  118. package/dist/es/services/registry-broker/client/chat-history.d.ts +23 -0
  119. package/dist/es/services/registry-broker/client/chat-history.d.ts.map +1 -0
  120. package/dist/es/services/registry-broker/client/chat.d.ts +33 -0
  121. package/dist/es/services/registry-broker/client/chat.d.ts.map +1 -0
  122. package/dist/es/services/registry-broker/client/credits.d.ts +40 -0
  123. package/dist/es/services/registry-broker/client/credits.d.ts.map +1 -0
  124. package/dist/es/services/registry-broker/client/encrypted-chat-manager.d.ts +35 -0
  125. package/dist/es/services/registry-broker/client/encrypted-chat-manager.d.ts.map +1 -0
  126. package/dist/es/services/registry-broker/client/encryption.d.ts +33 -0
  127. package/dist/es/services/registry-broker/client/encryption.d.ts.map +1 -0
  128. package/dist/es/services/registry-broker/client/errors.d.ts +19 -0
  129. package/dist/es/services/registry-broker/client/errors.d.ts.map +1 -0
  130. package/dist/es/services/registry-broker/client/feedback.d.ts +2 -0
  131. package/dist/es/services/registry-broker/client/feedback.d.ts.map +1 -0
  132. package/dist/es/services/registry-broker/client/ledger-auth.d.ts +10 -0
  133. package/dist/es/services/registry-broker/client/ledger-auth.d.ts.map +1 -0
  134. package/dist/es/services/registry-broker/client/search.d.ts +19 -0
  135. package/dist/es/services/registry-broker/client/search.d.ts.map +1 -0
  136. package/dist/es/services/registry-broker/client/utils.d.ts +21 -0
  137. package/dist/es/services/registry-broker/client/utils.d.ts.map +1 -0
  138. package/dist/es/services/registry-broker/client.d.ts +2 -205
  139. package/dist/es/services/registry-broker/client.d.ts.map +1 -1
  140. package/dist/es/services/registry-broker/private-key-signer.d.ts +1 -0
  141. package/dist/es/services/registry-broker/private-key-signer.d.ts.map +1 -1
  142. package/dist/es/services/registry-broker/schemas.d.ts +2509 -816
  143. package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
  144. package/dist/es/services/registry-broker/types.d.ts +64 -2
  145. package/dist/es/services/registry-broker/types.d.ts.map +1 -1
  146. package/dist/es/standards-sdk.es.js +148 -133
  147. package/dist/es/standards-sdk.es.js.map +1 -1
  148. package/dist/es/standards-sdk.es10.js +70 -90
  149. package/dist/es/standards-sdk.es10.js.map +1 -1
  150. package/dist/es/standards-sdk.es100.js +229 -26
  151. package/dist/es/standards-sdk.es100.js.map +1 -1
  152. package/dist/es/standards-sdk.es101.js +109 -228
  153. package/dist/es/standards-sdk.es101.js.map +1 -1
  154. package/dist/es/standards-sdk.es102.js +15 -94
  155. package/dist/es/standards-sdk.es102.js.map +1 -1
  156. package/dist/es/standards-sdk.es103.js +80 -30
  157. package/dist/es/standards-sdk.es103.js.map +1 -1
  158. package/dist/es/standards-sdk.es104.js +27 -80
  159. package/dist/es/standards-sdk.es104.js.map +1 -1
  160. package/dist/es/standards-sdk.es105.js +136 -25
  161. package/dist/es/standards-sdk.es105.js.map +1 -1
  162. package/dist/es/standards-sdk.es106.js +27 -140
  163. package/dist/es/standards-sdk.es106.js.map +1 -1
  164. package/dist/es/standards-sdk.es107.js +20 -27
  165. package/dist/es/standards-sdk.es107.js.map +1 -1
  166. package/dist/es/standards-sdk.es108.js +156 -18
  167. package/dist/es/standards-sdk.es108.js.map +1 -1
  168. package/dist/es/standards-sdk.es109.js +198 -148
  169. package/dist/es/standards-sdk.es109.js.map +1 -1
  170. package/dist/es/standards-sdk.es11.js +121 -45
  171. package/dist/es/standards-sdk.es11.js.map +1 -1
  172. package/dist/es/standards-sdk.es110.js +747 -160
  173. package/dist/es/standards-sdk.es110.js.map +1 -1
  174. package/dist/es/standards-sdk.es111.js +9 -786
  175. package/dist/es/standards-sdk.es111.js.map +1 -1
  176. package/dist/es/standards-sdk.es112.js +567 -13
  177. package/dist/es/standards-sdk.es112.js.map +1 -1
  178. package/dist/es/standards-sdk.es113.js +576 -541
  179. package/dist/es/standards-sdk.es113.js.map +1 -1
  180. package/dist/es/standards-sdk.es114.js +12 -601
  181. package/dist/es/standards-sdk.es114.js.map +1 -1
  182. package/dist/es/standards-sdk.es115.js +2 -13
  183. package/dist/es/standards-sdk.es115.js.map +1 -1
  184. package/dist/es/standards-sdk.es116.js +87 -2
  185. package/dist/es/standards-sdk.es116.js.map +1 -1
  186. package/dist/es/standards-sdk.es117.js +37 -80
  187. package/dist/es/standards-sdk.es117.js.map +1 -1
  188. package/dist/es/standards-sdk.es118.js +2 -39
  189. package/dist/es/standards-sdk.es118.js.map +1 -1
  190. package/dist/es/standards-sdk.es119.js +231 -2
  191. package/dist/es/standards-sdk.es119.js.map +1 -1
  192. package/dist/es/standards-sdk.es12.js +60 -159
  193. package/dist/es/standards-sdk.es12.js.map +1 -1
  194. package/dist/es/standards-sdk.es120.js +1110 -193
  195. package/dist/es/standards-sdk.es120.js.map +1 -1
  196. package/dist/es/standards-sdk.es121.js +225 -1059
  197. package/dist/es/standards-sdk.es121.js.map +1 -1
  198. package/dist/es/standards-sdk.es122.js +419 -303
  199. package/dist/es/standards-sdk.es122.js.map +1 -1
  200. package/dist/es/standards-sdk.es123.js +351 -418
  201. package/dist/es/standards-sdk.es123.js.map +1 -1
  202. package/dist/es/standards-sdk.es124.js +872 -347
  203. package/dist/es/standards-sdk.es124.js.map +1 -1
  204. package/dist/es/standards-sdk.es125.js +182 -854
  205. package/dist/es/standards-sdk.es125.js.map +1 -1
  206. package/dist/es/standards-sdk.es126.js +1512 -153
  207. package/dist/es/standards-sdk.es126.js.map +1 -1
  208. package/dist/es/standards-sdk.es127.js +157 -1547
  209. package/dist/es/standards-sdk.es127.js.map +1 -1
  210. package/dist/es/standards-sdk.es128.js +184 -2190
  211. package/dist/es/standards-sdk.es128.js.map +1 -1
  212. package/dist/es/standards-sdk.es129.js +100 -63
  213. package/dist/es/standards-sdk.es129.js.map +1 -1
  214. package/dist/es/standards-sdk.es13.js +200 -60
  215. package/dist/es/standards-sdk.es13.js.map +1 -1
  216. package/dist/es/standards-sdk.es130.js +112 -78
  217. package/dist/es/standards-sdk.es130.js.map +1 -1
  218. package/dist/es/standards-sdk.es131.js +232 -144
  219. package/dist/es/standards-sdk.es131.js.map +1 -1
  220. package/dist/es/standards-sdk.es132.js +181 -8
  221. package/dist/es/standards-sdk.es132.js.map +1 -1
  222. package/dist/es/standards-sdk.es133.js +118 -82
  223. package/dist/es/standards-sdk.es133.js.map +1 -1
  224. package/dist/es/standards-sdk.es134.js +322 -61
  225. package/dist/es/standards-sdk.es134.js.map +1 -1
  226. package/dist/es/standards-sdk.es135.js +464 -28
  227. package/dist/es/standards-sdk.es135.js.map +1 -1
  228. package/dist/es/standards-sdk.es136.js +14 -135
  229. package/dist/es/standards-sdk.es136.js.map +1 -1
  230. package/dist/es/standards-sdk.es137.js +78 -39
  231. package/dist/es/standards-sdk.es137.js.map +1 -1
  232. package/dist/es/standards-sdk.es138.js +85 -764
  233. package/dist/es/standards-sdk.es138.js.map +1 -1
  234. package/dist/es/standards-sdk.es139.js +135 -12250
  235. package/dist/es/standards-sdk.es139.js.map +1 -1
  236. package/dist/es/standards-sdk.es14.js +149 -178
  237. package/dist/es/standards-sdk.es14.js.map +1 -1
  238. package/dist/es/standards-sdk.es140.js +7 -56
  239. package/dist/es/standards-sdk.es140.js.map +1 -1
  240. package/dist/es/standards-sdk.es141.js +72 -68
  241. package/dist/es/standards-sdk.es141.js.map +1 -1
  242. package/dist/es/standards-sdk.es142.js +61 -13
  243. package/dist/es/standards-sdk.es142.js.map +1 -1
  244. package/dist/es/standards-sdk.es143.js +30 -172
  245. package/dist/es/standards-sdk.es143.js.map +1 -1
  246. package/dist/es/standards-sdk.es144.js +34 -322
  247. package/dist/es/standards-sdk.es144.js.map +1 -1
  248. package/dist/es/standards-sdk.es145.js +28 -346
  249. package/dist/es/standards-sdk.es145.js.map +1 -1
  250. package/dist/es/standards-sdk.es146.js +112 -427
  251. package/dist/es/standards-sdk.es146.js.map +1 -1
  252. package/dist/es/standards-sdk.es147.js +40 -329
  253. package/dist/es/standards-sdk.es147.js.map +1 -1
  254. package/dist/es/standards-sdk.es148.js +12279 -66
  255. package/dist/es/standards-sdk.es148.js.map +1 -1
  256. package/dist/es/standards-sdk.es149.js +961 -0
  257. package/dist/es/standards-sdk.es149.js.map +1 -0
  258. package/dist/es/standards-sdk.es15.js +152 -151
  259. package/dist/es/standards-sdk.es15.js.map +1 -1
  260. package/dist/es/standards-sdk.es150.js +20 -0
  261. package/dist/es/standards-sdk.es150.js.map +1 -0
  262. package/dist/es/standards-sdk.es151.js +59 -0
  263. package/dist/es/standards-sdk.es151.js.map +1 -0
  264. package/dist/es/standards-sdk.es152.js +87 -0
  265. package/dist/es/standards-sdk.es152.js.map +1 -0
  266. package/dist/es/standards-sdk.es153.js +175 -0
  267. package/dist/es/standards-sdk.es153.js.map +1 -0
  268. package/dist/es/standards-sdk.es154.js +325 -0
  269. package/dist/es/standards-sdk.es154.js.map +1 -0
  270. package/dist/es/standards-sdk.es155.js +349 -0
  271. package/dist/es/standards-sdk.es155.js.map +1 -0
  272. package/dist/es/standards-sdk.es156.js +456 -0
  273. package/dist/es/standards-sdk.es156.js.map +1 -0
  274. package/dist/es/standards-sdk.es157.js +334 -0
  275. package/dist/es/standards-sdk.es157.js.map +1 -0
  276. package/dist/es/standards-sdk.es158.js +79 -0
  277. package/dist/es/standards-sdk.es158.js.map +1 -0
  278. package/dist/es/standards-sdk.es159.js +242 -0
  279. package/dist/es/standards-sdk.es159.js.map +1 -0
  280. package/dist/es/standards-sdk.es16.js +917 -136
  281. package/dist/es/standards-sdk.es16.js.map +1 -1
  282. package/dist/es/standards-sdk.es160.js +247 -0
  283. package/dist/es/standards-sdk.es160.js.map +1 -0
  284. package/dist/es/standards-sdk.es17.js +23 -938
  285. package/dist/es/standards-sdk.es17.js.map +1 -1
  286. package/dist/es/standards-sdk.es18.js +2422 -24
  287. package/dist/es/standards-sdk.es18.js.map +1 -1
  288. package/dist/es/standards-sdk.es19.js +826 -2075
  289. package/dist/es/standards-sdk.es19.js.map +1 -1
  290. package/dist/es/standards-sdk.es2.js +654 -189
  291. package/dist/es/standards-sdk.es2.js.map +1 -1
  292. package/dist/es/standards-sdk.es20.js +205 -1086
  293. package/dist/es/standards-sdk.es20.js.map +1 -1
  294. package/dist/es/standards-sdk.es21.js +858 -221
  295. package/dist/es/standards-sdk.es21.js.map +1 -1
  296. package/dist/es/standards-sdk.es22.js +179 -903
  297. package/dist/es/standards-sdk.es22.js.map +1 -1
  298. package/dist/es/standards-sdk.es23.js +164 -179
  299. package/dist/es/standards-sdk.es23.js.map +1 -1
  300. package/dist/es/standards-sdk.es24.js +62 -118
  301. package/dist/es/standards-sdk.es24.js.map +1 -1
  302. package/dist/es/standards-sdk.es25.js +377 -52
  303. package/dist/es/standards-sdk.es25.js.map +1 -1
  304. package/dist/es/standards-sdk.es26.js +36 -394
  305. package/dist/es/standards-sdk.es26.js.map +1 -1
  306. package/dist/es/standards-sdk.es27.js +901 -50
  307. package/dist/es/standards-sdk.es27.js.map +1 -1
  308. package/dist/es/standards-sdk.es28.js +134 -897
  309. package/dist/es/standards-sdk.es28.js.map +1 -1
  310. package/dist/es/standards-sdk.es29.js +7 -134
  311. package/dist/es/standards-sdk.es29.js.map +1 -1
  312. package/dist/es/standards-sdk.es3.js +63 -680
  313. package/dist/es/standards-sdk.es3.js.map +1 -1
  314. package/dist/es/standards-sdk.es30.js +344 -7
  315. package/dist/es/standards-sdk.es30.js.map +1 -1
  316. package/dist/es/standards-sdk.es31.js +302 -287
  317. package/dist/es/standards-sdk.es31.js.map +1 -1
  318. package/dist/es/standards-sdk.es32.js +94 -322
  319. package/dist/es/standards-sdk.es32.js.map +1 -1
  320. package/dist/es/standards-sdk.es33.js +458 -101
  321. package/dist/es/standards-sdk.es33.js.map +1 -1
  322. package/dist/es/standards-sdk.es34.js +132 -451
  323. package/dist/es/standards-sdk.es34.js.map +1 -1
  324. package/dist/es/standards-sdk.es35.js +216 -130
  325. package/dist/es/standards-sdk.es35.js.map +1 -1
  326. package/dist/es/standards-sdk.es36.js +274 -191
  327. package/dist/es/standards-sdk.es36.js.map +1 -1
  328. package/dist/es/standards-sdk.es37.js +148 -87
  329. package/dist/es/standards-sdk.es37.js.map +1 -1
  330. package/dist/es/standards-sdk.es38.js +183 -320
  331. package/dist/es/standards-sdk.es38.js.map +1 -1
  332. package/dist/es/standards-sdk.es39.js +238 -161
  333. package/dist/es/standards-sdk.es39.js.map +1 -1
  334. package/dist/es/standards-sdk.es4.js +425 -63
  335. package/dist/es/standards-sdk.es4.js.map +1 -1
  336. package/dist/es/standards-sdk.es40.js +136 -254
  337. package/dist/es/standards-sdk.es40.js.map +1 -1
  338. package/dist/es/standards-sdk.es41.js +225 -176
  339. package/dist/es/standards-sdk.es41.js.map +1 -1
  340. package/dist/es/standards-sdk.es42.js +199 -261
  341. package/dist/es/standards-sdk.es42.js.map +1 -1
  342. package/dist/es/standards-sdk.es43.js +237 -199
  343. package/dist/es/standards-sdk.es43.js.map +1 -1
  344. package/dist/es/standards-sdk.es44.js +209 -201
  345. package/dist/es/standards-sdk.es44.js.map +1 -1
  346. package/dist/es/standards-sdk.es45.js +305 -201
  347. package/dist/es/standards-sdk.es45.js.map +1 -1
  348. package/dist/es/standards-sdk.es46.js +371 -261
  349. package/dist/es/standards-sdk.es46.js.map +1 -1
  350. package/dist/es/standards-sdk.es47.js +316 -371
  351. package/dist/es/standards-sdk.es47.js.map +1 -1
  352. package/dist/es/standards-sdk.es48.js +404 -336
  353. package/dist/es/standards-sdk.es48.js.map +1 -1
  354. package/dist/es/standards-sdk.es49.js +83 -449
  355. package/dist/es/standards-sdk.es49.js.map +1 -1
  356. package/dist/es/standards-sdk.es5.js +232 -354
  357. package/dist/es/standards-sdk.es5.js.map +1 -1
  358. package/dist/es/standards-sdk.es50.js +179 -89
  359. package/dist/es/standards-sdk.es50.js.map +1 -1
  360. package/dist/es/standards-sdk.es51.js +231 -165
  361. package/dist/es/standards-sdk.es51.js.map +1 -1
  362. package/dist/es/standards-sdk.es52.js +25 -262
  363. package/dist/es/standards-sdk.es52.js.map +1 -1
  364. package/dist/es/standards-sdk.es53.js +56 -26
  365. package/dist/es/standards-sdk.es53.js.map +1 -1
  366. package/dist/es/standards-sdk.es54.js +12 -57
  367. package/dist/es/standards-sdk.es54.js.map +1 -1
  368. package/dist/es/standards-sdk.es55.js +49 -12
  369. package/dist/es/standards-sdk.es55.js.map +1 -1
  370. package/dist/es/standards-sdk.es56.js +115 -43
  371. package/dist/es/standards-sdk.es56.js.map +1 -1
  372. package/dist/es/standards-sdk.es57.js +42 -115
  373. package/dist/es/standards-sdk.es57.js.map +1 -1
  374. package/dist/es/standards-sdk.es58.js +52 -43
  375. package/dist/es/standards-sdk.es58.js.map +1 -1
  376. package/dist/es/standards-sdk.es59.js +36 -50
  377. package/dist/es/standards-sdk.es59.js.map +1 -1
  378. package/dist/es/standards-sdk.es6.js +125 -246
  379. package/dist/es/standards-sdk.es6.js.map +1 -1
  380. package/dist/es/standards-sdk.es60.js +207 -39
  381. package/dist/es/standards-sdk.es60.js.map +1 -1
  382. package/dist/es/standards-sdk.es61.js +24 -195
  383. package/dist/es/standards-sdk.es61.js.map +1 -1
  384. package/dist/es/standards-sdk.es62.js +87 -25
  385. package/dist/es/standards-sdk.es62.js.map +1 -1
  386. package/dist/es/standards-sdk.es63.js +3 -51
  387. package/dist/es/standards-sdk.es63.js.map +1 -1
  388. package/dist/es/standards-sdk.es64.js +100 -3
  389. package/dist/es/standards-sdk.es64.js.map +1 -1
  390. package/dist/es/standards-sdk.es65.js +61 -62
  391. package/dist/es/standards-sdk.es65.js.map +1 -1
  392. package/dist/es/standards-sdk.es66.js +17 -98
  393. package/dist/es/standards-sdk.es66.js.map +1 -1
  394. package/dist/es/standards-sdk.es67.js +77 -19
  395. package/dist/es/standards-sdk.es67.js.map +1 -1
  396. package/dist/es/standards-sdk.es68.js +458 -77
  397. package/dist/es/standards-sdk.es68.js.map +1 -1
  398. package/dist/es/standards-sdk.es69.js +106 -240
  399. package/dist/es/standards-sdk.es69.js.map +1 -1
  400. package/dist/es/standards-sdk.es7.js +28 -183
  401. package/dist/es/standards-sdk.es7.js.map +1 -1
  402. package/dist/es/standards-sdk.es70.js +170 -286
  403. package/dist/es/standards-sdk.es70.js.map +1 -1
  404. package/dist/es/standards-sdk.es71.js +71 -207
  405. package/dist/es/standards-sdk.es71.js.map +1 -1
  406. package/dist/es/standards-sdk.es72.js +71 -72
  407. package/dist/es/standards-sdk.es72.js.map +1 -1
  408. package/dist/es/standards-sdk.es73.js +143 -71
  409. package/dist/es/standards-sdk.es73.js.map +1 -1
  410. package/dist/es/standards-sdk.es74.js +62 -136
  411. package/dist/es/standards-sdk.es74.js.map +1 -1
  412. package/dist/es/standards-sdk.es75.js +380 -45
  413. package/dist/es/standards-sdk.es75.js.map +1 -1
  414. package/dist/es/standards-sdk.es76.js +222 -130
  415. package/dist/es/standards-sdk.es76.js.map +1 -1
  416. package/dist/es/standards-sdk.es77.js +320 -444
  417. package/dist/es/standards-sdk.es77.js.map +1 -1
  418. package/dist/es/standards-sdk.es78.js +88 -364
  419. package/dist/es/standards-sdk.es78.js.map +1 -1
  420. package/dist/es/standards-sdk.es79.js +125 -89
  421. package/dist/es/standards-sdk.es79.js.map +1 -1
  422. package/dist/es/standards-sdk.es8.js +80 -29
  423. package/dist/es/standards-sdk.es8.js.map +1 -1
  424. package/dist/es/standards-sdk.es80.js +8 -125
  425. package/dist/es/standards-sdk.es80.js.map +1 -1
  426. package/dist/es/standards-sdk.es81.js +45 -6
  427. package/dist/es/standards-sdk.es81.js.map +1 -1
  428. package/dist/es/standards-sdk.es82.js +98 -44
  429. package/dist/es/standards-sdk.es82.js.map +1 -1
  430. package/dist/es/standards-sdk.es83.js +331 -84
  431. package/dist/es/standards-sdk.es83.js.map +1 -1
  432. package/dist/es/standards-sdk.es84.js +93 -160
  433. package/dist/es/standards-sdk.es84.js.map +1 -1
  434. package/dist/es/standards-sdk.es85.js +55 -275
  435. package/dist/es/standards-sdk.es85.js.map +1 -1
  436. package/dist/es/standards-sdk.es86.js +43 -55
  437. package/dist/es/standards-sdk.es86.js.map +1 -1
  438. package/dist/es/standards-sdk.es87.js +145 -22
  439. package/dist/es/standards-sdk.es87.js.map +1 -1
  440. package/dist/es/standards-sdk.es88.js +34 -47
  441. package/dist/es/standards-sdk.es88.js.map +1 -1
  442. package/dist/es/standards-sdk.es89.js +22 -57
  443. package/dist/es/standards-sdk.es89.js.map +1 -1
  444. package/dist/es/standards-sdk.es9.js +104 -80
  445. package/dist/es/standards-sdk.es9.js.map +1 -1
  446. package/dist/es/standards-sdk.es90.js +23 -28
  447. package/dist/es/standards-sdk.es90.js.map +1 -1
  448. package/dist/es/standards-sdk.es91.js +238 -23
  449. package/dist/es/standards-sdk.es91.js.map +1 -1
  450. package/dist/es/standards-sdk.es92.js +265 -152
  451. package/dist/es/standards-sdk.es92.js.map +1 -1
  452. package/dist/es/standards-sdk.es93.js +95 -68
  453. package/dist/es/standards-sdk.es93.js.map +1 -1
  454. package/dist/es/standards-sdk.es94.js +124 -136
  455. package/dist/es/standards-sdk.es94.js.map +1 -1
  456. package/dist/es/standards-sdk.es95.js +42 -138
  457. package/dist/es/standards-sdk.es95.js.map +1 -1
  458. package/dist/es/standards-sdk.es96.js +259 -42
  459. package/dist/es/standards-sdk.es96.js.map +1 -1
  460. package/dist/es/standards-sdk.es97.js +82 -243
  461. package/dist/es/standards-sdk.es97.js.map +1 -1
  462. package/dist/es/standards-sdk.es98.js +48 -47
  463. package/dist/es/standards-sdk.es98.js.map +1 -1
  464. package/dist/es/standards-sdk.es99.js +29 -100
  465. package/dist/es/standards-sdk.es99.js.map +1 -1
  466. package/dist/es/utils/crypto-abstraction.d.ts.map +1 -1
  467. package/dist/es/utils/crypto-env.d.ts.map +1 -1
  468. package/dist/es/utils/dynamic-import.d.ts +5 -1
  469. package/dist/es/utils/dynamic-import.d.ts.map +1 -1
  470. package/dist/es/utils/hash-adapter.d.ts.map +1 -1
  471. package/package.json +15 -16
  472. package/dist/cjs/patches/topic-autorenew-patch.d.ts +0 -2
  473. package/dist/cjs/patches/topic-autorenew-patch.d.ts.map +0 -1
  474. package/dist/es/patches/topic-autorenew-patch.d.ts +0 -2
  475. package/dist/es/patches/topic-autorenew-patch.d.ts.map +0 -1
@@ -1,947 +1,32 @@
1
- import { Logger } from "./standards-sdk.es106.js";
2
- import { Registration } from "./standards-sdk.es21.js";
3
- import { HCS11Client } from "./standards-sdk.es28.js";
4
- import { PublicKey } from "@hashgraph/sdk";
5
- import { HederaMirrorNode } from "./standards-sdk.es127.js";
6
- import "node:path";
7
- import "node:buffer";
8
- import "node:crypto";
9
- import "@noble/curves/secp256k1.js";
10
- import "./standards-sdk.es130.js";
11
- import "./standards-sdk.es138.js";
12
- import "zod";
13
- import { buildHcs10SubmitConnectionRequestTx, buildHcs10OutboundConnectionRequestRecordTx, buildHcs10OutboundConnectionCreatedRecordTx } from "./standards-sdk.es23.js";
14
- import { HRLResolver } from "./standards-sdk.es110.js";
15
- var Hcs10MemoType = /* @__PURE__ */ ((Hcs10MemoType2) => {
16
- Hcs10MemoType2["INBOUND"] = "inbound";
17
- Hcs10MemoType2["OUTBOUND"] = "outbound";
18
- Hcs10MemoType2["CONNECTION"] = "connection";
19
- Hcs10MemoType2["REGISTRY"] = "registry";
20
- return Hcs10MemoType2;
21
- })(Hcs10MemoType || {});
22
- class HCS10BaseClient extends Registration {
23
- constructor(config) {
24
- super();
25
- this.network = config.network;
26
- this.logger = Logger.getInstance({
27
- level: config.logLevel || "info",
28
- module: "HCS10-BaseClient",
29
- prettyPrint: config.prettyPrint,
30
- silent: config.silent
31
- });
32
- this.mirrorNode = new HederaMirrorNode(
33
- config.network,
34
- this.logger,
35
- config.mirrorNode
36
- );
37
- this.feeAmount = config.feeAmount || 1e-3;
38
- }
39
- /**
40
- * Updates the mirror node configuration.
41
- * @param config The new mirror node configuration.
42
- */
43
- configureMirrorNode(config) {
44
- this.mirrorNode.configureMirrorNode(config);
45
- this.logger.info("Mirror node configuration updated");
46
- }
47
- extractTopicFromOperatorId(operatorId) {
48
- if (!operatorId) {
49
- return "";
50
- }
51
- const parts = operatorId.split("@");
52
- if (parts.length > 0) {
53
- return parts[0];
54
- }
55
- return "";
56
- }
57
- extractAccountFromOperatorId(operatorId) {
58
- if (!operatorId) {
59
- return "";
60
- }
61
- const parts = operatorId.split("@");
62
- if (parts.length > 1) {
63
- return parts[1];
64
- }
65
- return "";
66
- }
67
- /**
68
- * Get a stream of messages from a connection topic
69
- * @param topicId The connection topic ID to get messages from
70
- * @param options Optional filtering options for messages
71
- * @returns A stream of filtered messages valid for connection topics
72
- */
73
- async getMessageStream(topicId, options) {
74
- try {
75
- const messages = await this.mirrorNode.getTopicMessages(topicId, options);
76
- const validOps = ["message", "close_connection", "transaction"];
77
- const filteredMessages = messages.filter((msg) => {
78
- if (msg.p !== "hcs-10" || !validOps.includes(msg.op)) {
79
- return false;
80
- }
81
- if (msg.op === "message" || msg.op === "close_connection") {
82
- if (!msg.operator_id) {
83
- return false;
84
- }
85
- if (!this.isValidOperatorId(msg.operator_id)) {
86
- return false;
87
- }
88
- if (msg.op === "message" && !msg.data) {
89
- return false;
90
- }
91
- }
92
- if (msg.op === "transaction") {
93
- if (!msg.operator_id || !msg.schedule_id) {
94
- return false;
95
- }
96
- if (!this.isValidOperatorId(msg.operator_id)) {
97
- return false;
98
- }
99
- }
100
- return true;
101
- });
102
- return {
103
- messages: filteredMessages
104
- };
105
- } catch (error) {
106
- if (this.logger) {
107
- this.logger.error(`Error fetching messages: ${error.message}`);
108
- }
109
- return { messages: [] };
110
- }
111
- }
112
- /**
113
- * Public method to retrieve topic information using the internal mirror node client.
114
- *
115
- * @param topicId The ID of the topic to query.
116
- * @returns Topic information or null if not found or an error occurs.
117
- */
118
- async getPublicTopicInfo(topicId) {
119
- try {
120
- return await this.mirrorNode.getTopicInfo(topicId);
121
- } catch (error) {
122
- this.logger.error(
123
- `Error getting public topic info for ${topicId}:`,
124
- error
125
- );
126
- return null;
127
- }
128
- }
129
- /**
130
- * Checks if a user can submit to a topic and determines if a fee is required
131
- * @param topicId The topic ID to check
132
- * @param userAccountId The account ID of the user attempting to submit
133
- * @returns Object with canSubmit, requiresFee, and optional reason
134
- */
135
- async canSubmitToTopic(topicId, userAccountId) {
136
- try {
137
- const topicInfo = await this.mirrorNode.getTopicInfo(topicId);
138
- if (!topicInfo) {
139
- return {
140
- canSubmit: false,
141
- requiresFee: false,
142
- reason: "Topic does not exist"
143
- };
144
- }
145
- if (!topicInfo.submit_key?.key) {
146
- return { canSubmit: true, requiresFee: false };
147
- }
148
- try {
149
- const userPublicKey = await this.mirrorNode.getPublicKey(userAccountId);
150
- if (topicInfo.submit_key._type === "ProtobufEncoded") {
151
- const keyBytes = Buffer.from(topicInfo.submit_key.key, "hex");
152
- const hasAccess = await this.mirrorNode.checkKeyListAccess(
153
- keyBytes,
154
- userPublicKey
155
- );
156
- if (hasAccess) {
157
- return { canSubmit: true, requiresFee: false };
158
- }
159
- } else {
160
- const topicSubmitKey = PublicKey.fromString(topicInfo.submit_key.key);
161
- if (userPublicKey.toString() === topicSubmitKey.toString()) {
162
- return { canSubmit: true, requiresFee: false };
163
- }
164
- }
165
- } catch (error) {
166
- this.logger.error(
167
- `Key validation error: ${error instanceof Error ? error.message : String(error)}`
168
- );
169
- }
170
- if (topicInfo.fee_schedule_key?.key && topicInfo.custom_fees?.fixed_fees?.length > 0) {
171
- return {
172
- canSubmit: true,
173
- requiresFee: true,
174
- reason: "Requires fee payment via HIP-991"
175
- };
176
- }
177
- return {
178
- canSubmit: false,
179
- requiresFee: false,
180
- reason: "User does not have submit permission for this topic"
181
- };
182
- } catch (error) {
183
- const errorMessage = error instanceof Error ? error.message : String(error);
184
- this.logger.error(`Topic submission validation error: ${errorMessage}`);
185
- return {
186
- canSubmit: false,
187
- requiresFee: false,
188
- reason: `Error: ${errorMessage}`
189
- };
190
- }
191
- }
192
- /**
193
- * Get all messages from a topic
194
- * @param topicId The topic ID to get messages from
195
- * @param options Optional filtering options for messages
196
- * @returns All messages from the topic
197
- */
198
- async getMessages(topicId, options) {
199
- try {
200
- const messages = await this.mirrorNode.getTopicMessages(topicId, options);
201
- const validatedMessages = messages.filter((msg) => {
202
- if (msg.p !== "hcs-10") {
203
- return false;
204
- }
205
- if (msg.op === "message") {
206
- if (!msg.data) {
207
- return false;
208
- }
209
- if (msg.operator_id) {
210
- if (!this.isValidOperatorId(msg.operator_id)) {
211
- return false;
212
- }
213
- }
214
- }
215
- return true;
216
- });
217
- return {
218
- messages: validatedMessages
219
- };
220
- } catch (error) {
221
- if (this.logger) {
222
- this.logger.error(`Error fetching messages: ${error.message}`);
223
- }
224
- return { messages: [] };
225
- }
226
- }
227
- /**
228
- * Requests an account from the mirror node
229
- * @param account The account ID to request
230
- * @returns The account response
231
- */
232
- async requestAccount(account) {
233
- try {
234
- if (!account) {
235
- throw new Error("Account ID is required");
236
- }
237
- return await this.mirrorNode.requestAccount(account);
238
- } catch (e) {
239
- this.logger.error("Failed to fetch account", e);
240
- throw e;
241
- }
242
- }
243
- /**
244
- * Retrieves the memo for an account
245
- * @param accountId The account ID to retrieve the memo for
246
- * @returns The memo
247
- */
248
- async getAccountMemo(accountId) {
249
- return await this.mirrorNode.getAccountMemo(accountId);
250
- }
251
- /**
252
- * Retrieves the profile for an account
253
- * @param accountId The account ID to retrieve the profile for
254
- * @param disableCache Whether to disable caching of the result
255
- * @param retryOptions Optional retry configuration
256
- * @returns The profile
257
- */
258
- async retrieveProfile(accountId, disableCache, retryOptions) {
259
- const maxRetries = retryOptions?.maxRetries ?? 0;
260
- const retryDelay = retryOptions?.retryDelay ?? 3e3;
261
- let retryCount = 0;
262
- while (retryCount <= maxRetries) {
263
- this.logger.debug(
264
- `Retrieving profile for account: ${accountId}${retryCount > 0 ? ` (attempt ${retryCount + 1}/${maxRetries + 1})` : ""}`
265
- );
266
- const cacheKey = `${accountId}-${this.network}`;
267
- if (!disableCache && retryCount === 0) {
268
- const cachedProfileResponse = HCS10Cache.getInstance().get(cacheKey);
269
- if (cachedProfileResponse) {
270
- this.logger.debug(`Cache hit for profile: ${accountId}`);
271
- return cachedProfileResponse;
272
- }
273
- }
274
- try {
275
- const hcs11Client = new HCS11Client({
276
- network: this.network,
277
- auth: {
278
- operatorId: "0.0.0"
279
- },
280
- logLevel: this.logger.getLevel()
281
- });
282
- const profileResult = await hcs11Client.fetchProfileByAccountId(
283
- accountId,
284
- this.network
285
- );
286
- if (!profileResult?.success) {
287
- if (retryCount < maxRetries) {
288
- this.logger.info(
289
- `Profile not found for account ${accountId}, retrying in ${retryDelay}ms... (${profileResult?.error})`
290
- );
291
- retryCount++;
292
- await new Promise((resolve) => setTimeout(resolve, retryDelay));
293
- continue;
294
- }
295
- this.logger.error(
296
- `Failed to retrieve profile for account ID: ${accountId}`,
297
- profileResult?.error
298
- );
299
- return {
300
- profile: null,
301
- success: false,
302
- error: profileResult?.error || `Failed to retrieve profile for account ID: ${accountId}`
303
- };
304
- }
305
- const profile = profileResult?.profile;
306
- let topicInfo = null;
307
- if (profileResult?.topicInfo?.inboundTopic && profileResult?.topicInfo?.outboundTopic && profileResult?.topicInfo?.profileTopicId) {
308
- topicInfo = {
309
- inboundTopic: profileResult.topicInfo.inboundTopic,
310
- outboundTopic: profileResult.topicInfo.outboundTopic,
311
- profileTopicId: profileResult.topicInfo.profileTopicId
312
- };
313
- }
314
- const responseToCache = {
315
- profile,
316
- topicInfo,
317
- success: true
318
- };
319
- HCS10Cache.getInstance().set(cacheKey, responseToCache);
320
- return responseToCache;
321
- } catch (e) {
322
- if (retryCount < maxRetries) {
323
- this.logger.info(
324
- `Error retrieving profile for account ${accountId}, retrying in ${retryDelay}ms... (${e.message})`
325
- );
326
- retryCount++;
327
- await new Promise((resolve) => setTimeout(resolve, retryDelay));
328
- continue;
329
- }
330
- const error = e;
331
- const logMessage = `Failed to retrieve profile: ${error.message}`;
332
- this.logger.error(logMessage);
333
- return {
334
- profile: null,
335
- success: false,
336
- error: logMessage
337
- };
338
- }
339
- }
340
- return {
341
- profile: null,
342
- success: false,
343
- error: "Unexpected error in profile retrieval"
344
- };
345
- }
346
- /**
347
- * @deprecated Use retrieveCommunicationTopics instead
348
- * @param accountId The account ID to retrieve the outbound connect topic for
349
- * @returns {TopicInfo} Topic Info from target profile.
350
- */
351
- async retrieveOutboundConnectTopic(accountId) {
352
- return await this.retrieveCommunicationTopics(accountId, true);
353
- }
354
- /**
355
- * Retrieves the communication topics for an account
356
- * @param accountId The account ID to retrieve the communication topics for
357
- * @param disableCache Whether to disable caching of the result
358
- * @param retryOptions Optional retry configuration
359
- * @returns {TopicInfo} Topic Info from target profile.
360
- */
361
- async retrieveCommunicationTopics(accountId, disableCache, retryOptions) {
362
- try {
363
- const profileResponse = await this.retrieveProfile(
364
- accountId,
365
- disableCache,
366
- retryOptions
367
- );
368
- if (!profileResponse?.success) {
369
- throw new Error(profileResponse.error || "Failed to retrieve profile");
370
- }
371
- const profile = profileResponse.profile;
372
- if (!profile) {
373
- throw new Error(
374
- `Profile is null or undefined for account ${accountId}`
375
- );
376
- }
377
- if (!profile.inboundTopicId || !profile.outboundTopicId) {
378
- throw new Error(
379
- `Invalid HCS-11 profile for HCS-10 agent: missing inboundTopicId or outboundTopicId`
380
- );
381
- }
382
- if (!profileResponse.topicInfo) {
383
- throw new Error(
384
- `TopicInfo is missing in the profile for account ${accountId}`
385
- );
386
- }
387
- return profileResponse.topicInfo;
388
- } catch (e) {
389
- const error = e;
390
- const logMessage = `Failed to retrieve topic info: ${error.message}`;
391
- this.logger.error(logMessage);
392
- throw error;
393
- }
394
- }
395
- /**
396
- * Retrieves outbound messages for an agent
397
- * @param agentAccountId The account ID of the agent
398
- * @param options Optional filtering options for messages
399
- * @returns The outbound messages
400
- */
401
- async retrieveOutboundMessages(agentAccountId, options) {
402
- try {
403
- const topicInfo = await this.retrieveCommunicationTopics(agentAccountId);
404
- if (!topicInfo) {
405
- this.logger.warn(
406
- `No outbound connect topic found for agentAccountId: ${agentAccountId}`
407
- );
408
- return [];
409
- }
410
- const response = await this.getMessages(topicInfo.outboundTopic, options);
411
- return response.messages.filter(
412
- (msg) => msg.p === "hcs-10" && (msg.op === "connection_request" || msg.op === "connection_created" || msg.op === "message")
413
- );
414
- } catch (e) {
415
- const error = e;
416
- const logMessage = `Failed to retrieve outbound messages: ${error.message}`;
417
- this.logger.error(logMessage);
418
- return [];
419
- }
420
- }
421
- /**
422
- * Checks if a connection has been created for an agent
423
- * @param agentAccountId The account ID of the agent
424
- * @param connectionId The ID of the connection
425
- * @returns True if the connection has been created, false otherwise
426
- */
427
- async hasConnectionCreated(agentAccountId, connectionId) {
428
- try {
429
- const outBoundTopic = await this.retrieveCommunicationTopics(agentAccountId);
430
- const messages = await this.retrieveOutboundMessages(
431
- outBoundTopic.outboundTopic
432
- );
433
- return messages.some(
434
- (msg) => msg.op === "connection_created" && msg.connection_id === connectionId
435
- );
436
- } catch (e) {
437
- const error = e;
438
- const logMessage = `Failed to check connection created: ${error.message}`;
439
- this.logger.error(logMessage);
440
- return false;
441
- }
442
- }
443
- /**
444
- * Gets message content, resolving any HRL references if needed
445
- * @param data The data string that may contain an HRL reference
446
- * @param forceRaw Whether to force returning raw binary data
447
- * @returns The resolved content
448
- */
449
- async getMessageContent(data, forceRaw = false) {
450
- if (!data.match(/^hcs:\/\/(\d+)\/([0-9]+\.[0-9]+\.[0-9]+)$/)) {
451
- return data;
452
- }
453
- try {
454
- const resolver = new HRLResolver(this.logger.getLevel());
455
- if (!resolver.isValidHRL(data)) {
456
- return data;
457
- }
458
- const result = await resolver.resolveHRL(data, {
459
- network: this.network,
460
- returnRaw: forceRaw
461
- });
462
- return result.content;
463
- } catch (e) {
464
- const error = e;
465
- const logMessage = `Error resolving HRL reference: ${error.message}`;
466
- this.logger.error(logMessage);
467
- throw new Error(logMessage);
468
- }
469
- }
470
- /**
471
- * Gets message content with its content type, resolving any HRL references if needed
472
- * @param data The data string that may contain an HRL reference
473
- * @param forceRaw Whether to force returning raw binary data
474
- * @returns The resolved content along with content type information
475
- */
476
- async getMessageContentWithType(data, forceRaw = false) {
477
- if (!data.match(/^hcs:\/\/(\d+)\/([0-9]+\.[0-9]+\.[0-9]+)$/)) {
478
- return {
479
- content: data,
480
- contentType: "text/plain",
481
- isBinary: false
482
- };
483
- }
484
- try {
485
- const resolver = new HRLResolver(this.logger.getLevel());
486
- return await resolver.getContentWithType(data, {
487
- network: this.network,
488
- returnRaw: forceRaw
489
- });
490
- } catch (e) {
491
- const error = e;
492
- const logMessage = `Error resolving HRL reference with type: ${error.message}`;
493
- this.logger.error(logMessage);
494
- throw new Error(logMessage);
495
- }
496
- }
497
- /**
498
- * Submits a connection request to an inbound topic
499
- * @param inboundTopicId The ID of the inbound topic
500
- * @param memo An optional memo for the message
501
- * @returns The transaction receipt
502
- */
503
- async submitConnectionRequest(inboundTopicId, memo) {
504
- const accountResponse = this.getAccountAndSigner();
505
- if (!accountResponse?.accountId) {
506
- throw new Error("Operator account ID is not set");
507
- }
508
- const operatorId = await this.getOperatorId();
509
- const accountId = accountResponse.accountId;
510
- const submissionCheck = await this.canSubmitToTopic(
511
- inboundTopicId,
512
- accountId
513
- );
514
- if (!submissionCheck?.canSubmit) {
515
- throw new Error(`Cannot submit to topic: ${submissionCheck.reason}`);
516
- }
517
- const inboundAccountOwner = await this.retrieveInboundAccountId(inboundTopicId);
518
- if (!inboundAccountOwner) {
519
- throw new Error("Failed to retrieve topic info account ID");
520
- }
521
- const requiresFee = submissionCheck.requiresFee;
522
- const connectionRequestTx = buildHcs10SubmitConnectionRequestTx({
523
- inboundTopicId,
524
- operatorId,
525
- memo
526
- });
527
- const response = await this.submitPayload(
528
- connectionRequestTx,
529
- void 0,
530
- void 0,
531
- requiresFee
532
- );
533
- this.logger.info(
534
- `Submitted connection request to topic ID: ${inboundTopicId}`
535
- );
536
- const outboundTopic = await this.retrieveCommunicationTopics(accountId);
537
- if (!outboundTopic) {
538
- throw new Error("Failed to retrieve outbound topic");
539
- }
540
- const responseSequenceNumber = response.topicSequenceNumber?.toNumber();
541
- if (!responseSequenceNumber) {
542
- throw new Error("Failed to get response sequence number");
543
- }
544
- const requestorOperatorId = `${inboundTopicId}@${inboundAccountOwner}`;
545
- const outboundRecordTx = buildHcs10OutboundConnectionRequestRecordTx({
546
- outboundTopicId: outboundTopic.outboundTopic,
547
- operatorId: requestorOperatorId,
548
- connectionRequestId: responseSequenceNumber,
549
- memo
550
- });
551
- await this.submitPayload(outboundRecordTx);
552
- return response;
553
- }
554
- /**
555
- * Records an outbound connection confirmation
556
- * @param outboundTopicId The ID of the outbound topic
557
- * @param connectionRequestId The ID of the connection request
558
- * @param confirmedRequestId The ID of the confirmed request
559
- * @param connectionTopicId The ID of the connection topic
560
- * @param operatorId The operator ID of the original message sender.
561
- * @param memo An optional memo for the message
562
- */
563
- async recordOutboundConnectionConfirmation({
564
- outboundTopicId,
565
- requestorOutboundTopicId,
566
- connectionRequestId,
567
- confirmedRequestId,
568
- connectionTopicId,
569
- operatorId,
570
- memo
571
- }) {
572
- const transaction = buildHcs10OutboundConnectionCreatedRecordTx({
573
- outboundTopicId,
574
- requestorOutboundTopicId,
575
- connectionTopicId,
576
- confirmedRequestId,
577
- connectionRequestId,
578
- operatorId,
579
- memo
580
- });
581
- return await this.submitPayload(transaction);
582
- }
583
- /**
584
- * Waits for confirmation of a connection request
585
- * @param inboundTopicId Inbound topic ID
586
- * @param connectionRequestId Connection request ID
587
- * @param maxAttempts Maximum number of attempts
588
- * @param delayMs Delay between attempts in milliseconds
589
- * @returns Connection confirmation details
590
- */
591
- async waitForConnectionConfirmation(inboundTopicId, connectionRequestId, maxAttempts = 60, delayMs = 2e3, recordConfirmation = true) {
592
- this.logger.info(
593
- `Waiting for connection confirmation on inbound topic ${inboundTopicId} for request ID ${connectionRequestId}`
594
- );
595
- for (let attempt = 0; attempt < maxAttempts; attempt++) {
596
- this.logger.info(
597
- `Attempt ${attempt + 1}/${maxAttempts} to find connection confirmation`
598
- );
599
- const messages = await this.mirrorNode.getTopicMessages(inboundTopicId, {
600
- order: "desc",
601
- limit: 100
602
- });
603
- const connectionCreatedMessages = messages.filter(
604
- (m) => m.op === "connection_created"
605
- );
606
- this.logger.info(
607
- `Found ${connectionCreatedMessages.length} connection_created messages`
608
- );
609
- if (connectionCreatedMessages.length > 0) {
610
- for (const message of connectionCreatedMessages) {
611
- if (Number(message.connection_id) === Number(connectionRequestId)) {
612
- const confirmationResult = {
613
- connectionTopicId: message.connection_topic_id,
614
- sequence_number: Number(message.sequence_number),
615
- confirmedBy: message.operator_id,
616
- memo: message.m
617
- };
618
- const confirmedByAccountId = this.extractAccountFromOperatorId(
619
- confirmationResult.confirmedBy
620
- );
621
- const account = this.getAccountAndSigner();
622
- const confirmedByConnectionTopics = await this.retrieveCommunicationTopics(confirmedByAccountId);
623
- const agentConnectionTopics = await this.retrieveCommunicationTopics(account.accountId);
624
- this.logger.info(
625
- "Connection confirmation found",
626
- confirmationResult
627
- );
628
- if (recordConfirmation) {
629
- await this.recordOutboundConnectionConfirmation({
630
- requestorOutboundTopicId: confirmedByConnectionTopics.outboundTopic,
631
- outboundTopicId: agentConnectionTopics.outboundTopic,
632
- connectionRequestId,
633
- confirmedRequestId: confirmationResult.sequence_number,
634
- connectionTopicId: confirmationResult.connectionTopicId,
635
- operatorId: confirmationResult.confirmedBy,
636
- memo: confirmationResult.memo || "Connection confirmed"
637
- });
638
- }
639
- return confirmationResult;
640
- }
641
- }
642
- }
643
- if (attempt < maxAttempts - 1) {
644
- this.logger.info(
645
- `No matching confirmation found, waiting ${delayMs}ms before retrying...`
646
- );
647
- await new Promise((resolve) => setTimeout(resolve, delayMs));
648
- }
649
- }
650
- throw new Error(
651
- `Connection confirmation not found after ${maxAttempts} attempts for request ID ${connectionRequestId}`
652
- );
653
- }
654
- /**
655
- * Retrieves the operator ID for the current agent
656
- * @param disableCache Whether to disable caching of the result
657
- * @returns The operator ID
658
- */
659
- async getOperatorId(disableCache) {
660
- if (this.operatorId && !disableCache) {
661
- return this.operatorId;
662
- }
663
- const accountResponse = this.getAccountAndSigner();
664
- if (!accountResponse?.accountId) {
665
- throw new Error("Operator ID not found");
666
- }
667
- const profile = await this.retrieveProfile(accountResponse.accountId);
668
- if (!profile?.success) {
669
- throw new Error("Failed to retrieve profile");
670
- }
671
- if (!profile?.topicInfo?.inboundTopic) {
672
- throw new Error("Failed to retrieve inbound topic");
673
- }
674
- const operatorId = `${profile.topicInfo?.inboundTopic}@${accountResponse.accountId}`;
675
- this.operatorId = operatorId;
676
- return operatorId;
677
- }
678
- /**
679
- * Retrieves the account ID of the owner of an inbound topic
680
- * @param inboundTopicId The ID of the inbound topic
681
- * @returns The account ID of the owner of the inbound topic
682
- */
683
- async retrieveInboundAccountId(inboundTopicId) {
684
- const topicInfo = await this.mirrorNode.getTopicInfo(inboundTopicId);
685
- if (!topicInfo?.memo) {
686
- throw new Error("Failed to retrieve topic info");
687
- }
688
- const topicInfoMemo = topicInfo.memo.toString();
689
- const topicInfoParts = topicInfoMemo.split(":");
690
- const inboundAccountOwner = topicInfoParts?.[4];
691
- if (!inboundAccountOwner) {
692
- throw new Error("Failed to retrieve topic info account ID");
693
- }
694
- return inboundAccountOwner;
695
- }
696
- clearCache() {
697
- HCS10Cache.getInstance().clear();
698
- }
699
- /**
700
- * Generates a standard HCS-10 memo string.
701
- * @param type The type of topic memo ('inbound', 'outbound', 'connection').
702
- * @param options Configuration options for the memo.
703
- * @returns The formatted memo string.
704
- * @protected
705
- */
706
- _generateHcs10Memo(type, options) {
707
- const ttl = options.ttl ?? 60;
708
- switch (type) {
709
- case "inbound":
710
- if (!options.accountId) {
711
- throw new Error("accountId is required for inbound memo");
712
- }
713
- return `hcs-10:0:${ttl}:0:${options.accountId}`;
714
- case "outbound":
715
- return `hcs-10:0:${ttl}:1`;
716
- case "connection":
717
- if (!options.inboundTopicId || options.connectionId === void 0) {
718
- throw new Error(
719
- "inboundTopicId and connectionId are required for connection memo"
720
- );
721
- }
722
- return `hcs-10:1:${ttl}:2:${options.inboundTopicId}:${options.connectionId}`;
723
- default:
724
- throw new Error(`Invalid HCS-10 memo type: ${type}`);
725
- }
726
- }
727
- /**
728
- * Reads a topic's memo and determines its HCS-10 type
729
- * @param topicId The topic ID to check
730
- * @returns The HCS-10 memo type or null if not an HCS-10 topic
731
- */
732
- async getTopicMemoType(topicId) {
733
- try {
734
- const topicInfo = await this.mirrorNode.getTopicInfo(topicId);
735
- if (!topicInfo?.memo) {
736
- this.logger.debug(`No memo found for topic ${topicId}`);
737
- return null;
738
- }
739
- const memo = topicInfo.memo.toString();
740
- if (!memo.startsWith("hcs-10:")) {
741
- this.logger.debug(`Topic ${topicId} is not an HCS-10 topic`);
742
- return null;
743
- }
744
- const parts = memo.split(":");
745
- if (parts.length < 4) {
746
- this.logger.warn(
747
- `Invalid HCS-10 memo format for topic ${topicId}: ${memo}`
748
- );
749
- return null;
750
- }
751
- const typeEnum = parts[3];
752
- switch (typeEnum) {
753
- case "0":
754
- return "inbound";
755
- case "1":
756
- return "outbound";
757
- case "2":
758
- return "connection";
759
- case "3":
760
- return "registry";
761
- default:
762
- this.logger.warn(
763
- `Unknown HCS-10 type enum: ${typeEnum} for topic ${topicId}`
764
- );
765
- return null;
766
- }
767
- } catch (error) {
768
- this.logger.error(`Error getting topic memo type for ${topicId}:`, error);
769
- return null;
770
- }
771
- }
772
- async checkRegistrationStatus(transactionId, network, baseUrl) {
773
- try {
774
- const response = await fetch(`${baseUrl}/api/request-confirm`, {
775
- method: "POST",
776
- headers: {
777
- "Content-Type": "application/json",
778
- "X-Network": network
779
- },
780
- body: JSON.stringify({ transaction_id: transactionId })
781
- });
782
- if (!response.ok) {
783
- throw new Error(
784
- `Failed to confirm registration: ${response.statusText}`
785
- );
786
- }
787
- return await response.json();
788
- } catch (e) {
789
- const error = e;
790
- const logMessage = `Error checking registration status: ${error.message}`;
791
- this.logger.error(logMessage);
792
- throw error;
793
- }
794
- }
795
- /**
796
- * Validates if an operator_id follows the correct format (agentTopicId@accountId)
797
- * @param operatorId The operator ID to validate
798
- * @returns True if the format is valid, false otherwise
799
- */
800
- isValidOperatorId(operatorId) {
801
- if (!operatorId) {
802
- return false;
803
- }
804
- const parts = operatorId.split("@");
805
- if (parts.length !== 2) {
806
- return false;
807
- }
808
- const agentTopicId = parts[0];
809
- const accountId = parts[1];
810
- if (!agentTopicId) {
811
- return false;
812
- }
813
- if (!accountId) {
814
- return false;
815
- }
816
- const hederaIdPattern = /^[0-9]+\.[0-9]+\.[0-9]+$/;
817
- if (!hederaIdPattern.test(accountId)) {
818
- return false;
819
- }
820
- if (!hederaIdPattern.test(agentTopicId)) {
821
- return false;
822
- }
823
- return true;
824
- }
825
- /**
826
- * Retrieves all transaction requests from a topic
827
- * @param topicId The topic ID to retrieve transactions from
828
- * @param options Optional filtering and retrieval options
829
- * @returns Array of transaction requests sorted by timestamp (newest first)
830
- */
831
- async getTransactionRequests(topicId, options) {
832
- this.logger.debug(`Retrieving transaction requests from topic ${topicId}`);
833
- const { messages } = await this.getMessageStream(topicId, {
834
- limit: options?.limit,
835
- sequenceNumber: options?.sequenceNumber,
836
- order: options?.order || "desc"
837
- });
838
- const transactOperations = messages.filter((m) => m.op === "transaction" && m.schedule_id).map((m) => ({
839
- operator_id: m.operator_id || "",
840
- schedule_id: m.schedule_id || "",
841
- data: m.data || "",
842
- memo: m.m,
843
- sequence_number: Number(m.sequence_number)
844
- })).sort((a, b) => {
845
- if (a.sequence_number && b.sequence_number) {
846
- return b.sequence_number - a.sequence_number;
847
- }
848
- return 0;
849
- });
850
- const result = options?.limit ? transactOperations.slice(0, options.limit) : transactOperations;
851
- return result;
852
- }
853
- /**
854
- * Gets the HCS-10 transaction memo for analytics based on the operation type
855
- * @param payload The operation payload
856
- * @returns The transaction memo in format hcs-10:op:{operation_enum}:{topic_type_enum}
857
- */
858
- getHcs10TransactionMemo(payload) {
859
- if (typeof payload !== "object" || !("op" in payload)) {
860
- return null;
861
- }
862
- const typedPayload = payload;
863
- const operation = typedPayload.op;
864
- let operationEnum;
865
- let topicTypeEnum;
866
- switch (operation) {
867
- case "register":
868
- operationEnum = "0";
869
- topicTypeEnum = "0";
870
- break;
871
- case "delete":
872
- operationEnum = "1";
873
- topicTypeEnum = "0";
874
- break;
875
- case "migrate":
876
- operationEnum = "2";
877
- topicTypeEnum = "0";
878
- break;
879
- case "connection_request":
880
- operationEnum = "3";
881
- topicTypeEnum = typedPayload.outbound_topic_id ? "2" : "1";
882
- break;
883
- case "connection_created":
884
- operationEnum = "4";
885
- topicTypeEnum = typedPayload.outbound_topic_id ? "2" : "1";
886
- break;
887
- case "connection_closed":
888
- operationEnum = "5";
889
- topicTypeEnum = typedPayload.outbound_topic_id ? "2" : "3";
890
- break;
891
- case "message":
892
- operationEnum = "6";
893
- topicTypeEnum = "3";
894
- break;
895
- case "close_connection":
896
- operationEnum = "5";
897
- topicTypeEnum = "3";
898
- break;
899
- case "transaction":
900
- operationEnum = "6";
901
- topicTypeEnum = "3";
902
- break;
903
- default:
904
- operationEnum = "6";
905
- topicTypeEnum = "3";
906
- }
907
- return `hcs-10:op:${operationEnum}:${topicTypeEnum}`;
1
+ class PayloadSizeError extends Error {
2
+ constructor(message, payloadSize) {
3
+ super(message);
4
+ this.payloadSize = payloadSize;
5
+ this.name = "PayloadSizeError";
908
6
  }
909
7
  }
910
- class HCS10Cache {
911
- constructor() {
912
- this.CACHE_TTL = 36e5;
913
- this.cache = /* @__PURE__ */ new Map();
914
- this.cacheExpiry = /* @__PURE__ */ new Map();
8
+ class AccountCreationError extends Error {
9
+ constructor(message) {
10
+ super(message);
11
+ this.name = "AccountCreationError";
915
12
  }
916
- static getInstance() {
917
- if (!HCS10Cache.instance) {
918
- HCS10Cache.instance = new HCS10Cache();
919
- }
920
- return HCS10Cache.instance;
921
- }
922
- set(key, value) {
923
- this.cache.set(key, value);
924
- this.cacheExpiry.set(key, Date.now() + this.CACHE_TTL);
925
- }
926
- get(key) {
927
- const expiry = this.cacheExpiry.get(key);
928
- if (expiry && expiry > Date.now()) {
929
- return this.cache.get(key);
930
- }
931
- if (expiry) {
932
- this.cache.delete(key);
933
- this.cacheExpiry.delete(key);
934
- }
935
- return void 0;
13
+ }
14
+ class TopicCreationError extends Error {
15
+ constructor(message) {
16
+ super(message);
17
+ this.name = "TopicCreationError";
936
18
  }
937
- clear() {
938
- this.cache.clear();
939
- this.cacheExpiry.clear();
19
+ }
20
+ class ConnectionConfirmationError extends Error {
21
+ constructor(message) {
22
+ super(message);
23
+ this.name = "ConnectionConfirmationError";
940
24
  }
941
25
  }
942
26
  export {
943
- HCS10BaseClient,
944
- HCS10Cache,
945
- Hcs10MemoType
27
+ AccountCreationError,
28
+ ConnectionConfirmationError,
29
+ PayloadSizeError,
30
+ TopicCreationError
946
31
  };
947
32
  //# sourceMappingURL=standards-sdk.es17.js.map