@hashgraphonline/standards-sdk 0.1.144 → 0.1.146-chore-jsr-improvements.canary.74bacb9.89

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 (442) hide show
  1. package/README.md +2 -2
  2. package/dist/cjs/hcs-10/base-client.d.ts.map +1 -1
  3. package/dist/cjs/hcs-10/sdk.d.ts +8 -0
  4. package/dist/cjs/hcs-10/sdk.d.ts.map +1 -1
  5. package/dist/cjs/hcs-11/client.d.ts +2 -2
  6. package/dist/cjs/hcs-11/client.d.ts.map +1 -1
  7. package/dist/cjs/hcs-11/person-builder.d.ts +1 -0
  8. package/dist/cjs/hcs-11/person-builder.d.ts.map +1 -1
  9. package/dist/cjs/hcs-11/types.d.ts +1 -0
  10. package/dist/cjs/hcs-11/types.d.ts.map +1 -1
  11. package/dist/cjs/hcs-12/rendering/resource-manager.d.ts.map +1 -1
  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-3/src/types.d.ts +60 -0
  35. package/dist/cjs/hcs-3/src/types.d.ts.map +1 -0
  36. package/dist/cjs/hcs-7/types.d.ts +4 -4
  37. package/dist/cjs/index.d.ts.map +1 -1
  38. package/dist/cjs/inscribe/inscriber.d.ts +89 -0
  39. package/dist/cjs/inscribe/inscriber.d.ts.map +1 -1
  40. package/dist/cjs/jsr-entry.d.ts +16 -0
  41. package/dist/cjs/jsr-entry.d.ts.map +1 -0
  42. package/dist/cjs/services/registry-broker/client/base-client.d.ts +14 -1
  43. package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
  44. package/dist/cjs/services/registry-broker/client/feedback.d.ts +2 -0
  45. package/dist/cjs/services/registry-broker/client/feedback.d.ts.map +1 -0
  46. package/dist/cjs/services/registry-broker/hol-chat-ops.d.ts +24 -0
  47. package/dist/cjs/services/registry-broker/hol-chat-ops.d.ts.map +1 -0
  48. package/dist/cjs/services/registry-broker/index.d.ts +1 -0
  49. package/dist/cjs/services/registry-broker/index.d.ts.map +1 -1
  50. package/dist/cjs/services/registry-broker/private-key-signer.d.ts +1 -0
  51. package/dist/cjs/services/registry-broker/private-key-signer.d.ts.map +1 -1
  52. package/dist/cjs/services/registry-broker/schemas.d.ts +1010 -586
  53. package/dist/cjs/services/registry-broker/schemas.d.ts.map +1 -1
  54. package/dist/cjs/services/registry-broker/types.d.ts +20 -1
  55. package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
  56. package/dist/cjs/standards-sdk.cjs +3 -3
  57. package/dist/cjs/standards-sdk.cjs.map +1 -1
  58. package/dist/cjs/utils/crypto-abstraction.d.ts.map +1 -1
  59. package/dist/cjs/utils/crypto-env.d.ts.map +1 -1
  60. package/dist/cjs/utils/dynamic-import.d.ts +5 -1
  61. package/dist/cjs/utils/dynamic-import.d.ts.map +1 -1
  62. package/dist/cjs/utils/hash-adapter.d.ts.map +1 -1
  63. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  64. package/dist/es/hcs-10/sdk.d.ts +8 -0
  65. package/dist/es/hcs-10/sdk.d.ts.map +1 -1
  66. package/dist/es/hcs-11/client.d.ts +2 -2
  67. package/dist/es/hcs-11/client.d.ts.map +1 -1
  68. package/dist/es/hcs-11/person-builder.d.ts +1 -0
  69. package/dist/es/hcs-11/person-builder.d.ts.map +1 -1
  70. package/dist/es/hcs-11/types.d.ts +1 -0
  71. package/dist/es/hcs-11/types.d.ts.map +1 -1
  72. package/dist/es/hcs-12/rendering/resource-manager.d.ts.map +1 -1
  73. package/dist/es/hcs-14/issuers/hiero.d.ts.map +1 -1
  74. package/dist/es/hcs-15/browser.d.ts +2 -0
  75. package/dist/es/hcs-15/browser.d.ts.map +1 -1
  76. package/dist/es/hcs-15/sdk.d.ts +7 -1
  77. package/dist/es/hcs-15/sdk.d.ts.map +1 -1
  78. package/dist/es/hcs-15/tx.d.ts +4 -0
  79. package/dist/es/hcs-15/tx.d.ts.map +1 -1
  80. package/dist/es/hcs-15/types.d.ts +16 -1
  81. package/dist/es/hcs-15/types.d.ts.map +1 -1
  82. package/dist/es/hcs-16/browser.d.ts +11 -2
  83. package/dist/es/hcs-16/browser.d.ts.map +1 -1
  84. package/dist/es/hcs-16/sdk.d.ts +62 -1
  85. package/dist/es/hcs-16/sdk.d.ts.map +1 -1
  86. package/dist/es/hcs-16/tx.d.ts +21 -3
  87. package/dist/es/hcs-16/tx.d.ts.map +1 -1
  88. package/dist/es/hcs-17/base-client.d.ts +1 -0
  89. package/dist/es/hcs-17/base-client.d.ts.map +1 -1
  90. package/dist/es/hcs-17/sdk.d.ts.map +1 -1
  91. package/dist/es/hcs-17/tx.d.ts +2 -0
  92. package/dist/es/hcs-17/tx.d.ts.map +1 -1
  93. package/dist/es/hcs-17/types.d.ts +4 -0
  94. package/dist/es/hcs-17/types.d.ts.map +1 -1
  95. package/dist/es/hcs-3/src/types.d.ts +60 -0
  96. package/dist/es/hcs-3/src/types.d.ts.map +1 -0
  97. package/dist/es/hcs-7/types.d.ts +4 -4
  98. package/dist/es/index.d.ts.map +1 -1
  99. package/dist/es/inscribe/inscriber.d.ts +89 -0
  100. package/dist/es/inscribe/inscriber.d.ts.map +1 -1
  101. package/dist/es/jsr-entry.d.ts +16 -0
  102. package/dist/es/jsr-entry.d.ts.map +1 -0
  103. package/dist/es/services/registry-broker/client/base-client.d.ts +14 -1
  104. package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
  105. package/dist/es/services/registry-broker/client/feedback.d.ts +2 -0
  106. package/dist/es/services/registry-broker/client/feedback.d.ts.map +1 -0
  107. package/dist/es/services/registry-broker/hol-chat-ops.d.ts +24 -0
  108. package/dist/es/services/registry-broker/hol-chat-ops.d.ts.map +1 -0
  109. package/dist/es/services/registry-broker/index.d.ts +1 -0
  110. package/dist/es/services/registry-broker/index.d.ts.map +1 -1
  111. package/dist/es/services/registry-broker/private-key-signer.d.ts +1 -0
  112. package/dist/es/services/registry-broker/private-key-signer.d.ts.map +1 -1
  113. package/dist/es/services/registry-broker/schemas.d.ts +1010 -586
  114. package/dist/es/services/registry-broker/schemas.d.ts.map +1 -1
  115. package/dist/es/services/registry-broker/types.d.ts +20 -1
  116. package/dist/es/services/registry-broker/types.d.ts.map +1 -1
  117. package/dist/es/standards-sdk.es.js +146 -131
  118. package/dist/es/standards-sdk.es10.js +70 -90
  119. package/dist/es/standards-sdk.es10.js.map +1 -1
  120. package/dist/es/standards-sdk.es100.js +229 -26
  121. package/dist/es/standards-sdk.es100.js.map +1 -1
  122. package/dist/es/standards-sdk.es101.js +109 -228
  123. package/dist/es/standards-sdk.es101.js.map +1 -1
  124. package/dist/es/standards-sdk.es102.js +15 -94
  125. package/dist/es/standards-sdk.es102.js.map +1 -1
  126. package/dist/es/standards-sdk.es103.js +80 -30
  127. package/dist/es/standards-sdk.es103.js.map +1 -1
  128. package/dist/es/standards-sdk.es104.js +27 -80
  129. package/dist/es/standards-sdk.es104.js.map +1 -1
  130. package/dist/es/standards-sdk.es105.js +136 -25
  131. package/dist/es/standards-sdk.es105.js.map +1 -1
  132. package/dist/es/standards-sdk.es106.js +27 -140
  133. package/dist/es/standards-sdk.es106.js.map +1 -1
  134. package/dist/es/standards-sdk.es107.js +20 -27
  135. package/dist/es/standards-sdk.es107.js.map +1 -1
  136. package/dist/es/standards-sdk.es108.js +156 -18
  137. package/dist/es/standards-sdk.es108.js.map +1 -1
  138. package/dist/es/standards-sdk.es109.js +198 -148
  139. package/dist/es/standards-sdk.es109.js.map +1 -1
  140. package/dist/es/standards-sdk.es11.js +121 -45
  141. package/dist/es/standards-sdk.es11.js.map +1 -1
  142. package/dist/es/standards-sdk.es110.js +747 -166
  143. package/dist/es/standards-sdk.es110.js.map +1 -1
  144. package/dist/es/standards-sdk.es111.js +9 -786
  145. package/dist/es/standards-sdk.es111.js.map +1 -1
  146. package/dist/es/standards-sdk.es112.js +567 -13
  147. package/dist/es/standards-sdk.es112.js.map +1 -1
  148. package/dist/es/standards-sdk.es113.js +576 -541
  149. package/dist/es/standards-sdk.es113.js.map +1 -1
  150. package/dist/es/standards-sdk.es114.js +12 -601
  151. package/dist/es/standards-sdk.es114.js.map +1 -1
  152. package/dist/es/standards-sdk.es115.js +2 -13
  153. package/dist/es/standards-sdk.es115.js.map +1 -1
  154. package/dist/es/standards-sdk.es116.js +87 -2
  155. package/dist/es/standards-sdk.es116.js.map +1 -1
  156. package/dist/es/standards-sdk.es117.js +37 -80
  157. package/dist/es/standards-sdk.es117.js.map +1 -1
  158. package/dist/es/standards-sdk.es118.js +2 -39
  159. package/dist/es/standards-sdk.es118.js.map +1 -1
  160. package/dist/es/standards-sdk.es119.js +231 -2
  161. package/dist/es/standards-sdk.es119.js.map +1 -1
  162. package/dist/es/standards-sdk.es12.js +60 -159
  163. package/dist/es/standards-sdk.es12.js.map +1 -1
  164. package/dist/es/standards-sdk.es120.js +1110 -193
  165. package/dist/es/standards-sdk.es120.js.map +1 -1
  166. package/dist/es/standards-sdk.es121.js +225 -1059
  167. package/dist/es/standards-sdk.es121.js.map +1 -1
  168. package/dist/es/standards-sdk.es122.js +419 -303
  169. package/dist/es/standards-sdk.es122.js.map +1 -1
  170. package/dist/es/standards-sdk.es123.js +351 -418
  171. package/dist/es/standards-sdk.es123.js.map +1 -1
  172. package/dist/es/standards-sdk.es124.js +1109 -347
  173. package/dist/es/standards-sdk.es124.js.map +1 -1
  174. package/dist/es/standards-sdk.es125.js +182 -854
  175. package/dist/es/standards-sdk.es125.js.map +1 -1
  176. package/dist/es/standards-sdk.es126.js +1512 -153
  177. package/dist/es/standards-sdk.es126.js.map +1 -1
  178. package/dist/es/standards-sdk.es127.js +157 -1547
  179. package/dist/es/standards-sdk.es127.js.map +1 -1
  180. package/dist/es/standards-sdk.es128.js +192 -162
  181. package/dist/es/standards-sdk.es128.js.map +1 -1
  182. package/dist/es/standards-sdk.es129.js +61 -164
  183. package/dist/es/standards-sdk.es129.js.map +1 -1
  184. package/dist/es/standards-sdk.es13.js +200 -60
  185. package/dist/es/standards-sdk.es13.js.map +1 -1
  186. package/dist/es/standards-sdk.es130.js +102 -85
  187. package/dist/es/standards-sdk.es130.js.map +1 -1
  188. package/dist/es/standards-sdk.es131.js +222 -96
  189. package/dist/es/standards-sdk.es131.js.map +1 -1
  190. package/dist/es/standards-sdk.es132.js +153 -220
  191. package/dist/es/standards-sdk.es132.js.map +1 -1
  192. package/dist/es/standards-sdk.es133.js +104 -162
  193. package/dist/es/standards-sdk.es133.js.map +1 -1
  194. package/dist/es/standards-sdk.es134.js +296 -92
  195. package/dist/es/standards-sdk.es134.js.map +1 -1
  196. package/dist/es/standards-sdk.es135.js +432 -294
  197. package/dist/es/standards-sdk.es135.js.map +1 -1
  198. package/dist/es/standards-sdk.es136.js +14 -363
  199. package/dist/es/standards-sdk.es136.js.map +1 -1
  200. package/dist/es/standards-sdk.es137.js +79 -15
  201. package/dist/es/standards-sdk.es137.js.map +1 -1
  202. package/dist/es/standards-sdk.es138.js +79 -59
  203. package/dist/es/standards-sdk.es138.js.map +1 -1
  204. package/dist/es/standards-sdk.es139.js +53 -80
  205. package/dist/es/standards-sdk.es139.js.map +1 -1
  206. package/dist/es/standards-sdk.es14.js +149 -178
  207. package/dist/es/standards-sdk.es14.js.map +1 -1
  208. package/dist/es/standards-sdk.es140.js +1 -1
  209. package/dist/es/standards-sdk.es142.js +1 -1
  210. package/dist/es/standards-sdk.es143.js +1 -1
  211. package/dist/es/standards-sdk.es144.js +30 -28
  212. package/dist/es/standards-sdk.es144.js.map +1 -1
  213. package/dist/es/standards-sdk.es145.js +34 -138
  214. package/dist/es/standards-sdk.es145.js.map +1 -1
  215. package/dist/es/standards-sdk.es146.js +28 -42
  216. package/dist/es/standards-sdk.es146.js.map +1 -1
  217. package/dist/es/standards-sdk.es147.js +105 -12256
  218. package/dist/es/standards-sdk.es147.js.map +1 -1
  219. package/dist/es/standards-sdk.es148.js +40 -15
  220. package/dist/es/standards-sdk.es148.js.map +1 -1
  221. package/dist/es/standards-sdk.es149.js +959 -56
  222. package/dist/es/standards-sdk.es149.js.map +1 -1
  223. package/dist/es/standards-sdk.es15.js +152 -151
  224. package/dist/es/standards-sdk.es15.js.map +1 -1
  225. package/dist/es/standards-sdk.es150.js +12264 -57
  226. package/dist/es/standards-sdk.es150.js.map +1 -1
  227. package/dist/es/standards-sdk.es151.js +51 -167
  228. package/dist/es/standards-sdk.es151.js.map +1 -1
  229. package/dist/es/standards-sdk.es152.js +70 -308
  230. package/dist/es/standards-sdk.es152.js.map +1 -1
  231. package/dist/es/standards-sdk.es153.js +13 -342
  232. package/dist/es/standards-sdk.es153.js.map +1 -1
  233. package/dist/es/standards-sdk.es154.js +129 -410
  234. package/dist/es/standards-sdk.es154.js.map +1 -1
  235. package/dist/es/standards-sdk.es155.js +200 -209
  236. package/dist/es/standards-sdk.es155.js.map +1 -1
  237. package/dist/es/standards-sdk.es156.js +334 -64
  238. package/dist/es/standards-sdk.es156.js.map +1 -1
  239. package/dist/es/standards-sdk.es157.js +453 -871
  240. package/dist/es/standards-sdk.es157.js.map +1 -1
  241. package/dist/es/standards-sdk.es158.js +314 -222
  242. package/dist/es/standards-sdk.es158.js.map +1 -1
  243. package/dist/es/standards-sdk.es159.js +60 -228
  244. package/dist/es/standards-sdk.es159.js.map +1 -1
  245. package/dist/es/standards-sdk.es16.js +917 -136
  246. package/dist/es/standards-sdk.es16.js.map +1 -1
  247. package/dist/es/standards-sdk.es160.js +242 -0
  248. package/dist/es/standards-sdk.es160.js.map +1 -0
  249. package/dist/es/standards-sdk.es161.js +247 -0
  250. package/dist/es/standards-sdk.es161.js.map +1 -0
  251. package/dist/es/standards-sdk.es17.js +23 -944
  252. package/dist/es/standards-sdk.es17.js.map +1 -1
  253. package/dist/es/standards-sdk.es18.js +2422 -24
  254. package/dist/es/standards-sdk.es18.js.map +1 -1
  255. package/dist/es/standards-sdk.es19.js +817 -2071
  256. package/dist/es/standards-sdk.es19.js.map +1 -1
  257. package/dist/es/standards-sdk.es2.js +654 -189
  258. package/dist/es/standards-sdk.es2.js.map +1 -1
  259. package/dist/es/standards-sdk.es20.js +205 -1091
  260. package/dist/es/standards-sdk.es20.js.map +1 -1
  261. package/dist/es/standards-sdk.es21.js +858 -221
  262. package/dist/es/standards-sdk.es21.js.map +1 -1
  263. package/dist/es/standards-sdk.es22.js +179 -903
  264. package/dist/es/standards-sdk.es22.js.map +1 -1
  265. package/dist/es/standards-sdk.es23.js +164 -179
  266. package/dist/es/standards-sdk.es23.js.map +1 -1
  267. package/dist/es/standards-sdk.es24.js +62 -118
  268. package/dist/es/standards-sdk.es24.js.map +1 -1
  269. package/dist/es/standards-sdk.es25.js +377 -52
  270. package/dist/es/standards-sdk.es25.js.map +1 -1
  271. package/dist/es/standards-sdk.es26.js +36 -394
  272. package/dist/es/standards-sdk.es26.js.map +1 -1
  273. package/dist/es/standards-sdk.es27.js +901 -50
  274. package/dist/es/standards-sdk.es27.js.map +1 -1
  275. package/dist/es/standards-sdk.es28.js +134 -902
  276. package/dist/es/standards-sdk.es28.js.map +1 -1
  277. package/dist/es/standards-sdk.es29.js +7 -134
  278. package/dist/es/standards-sdk.es29.js.map +1 -1
  279. package/dist/es/standards-sdk.es3.js +63 -680
  280. package/dist/es/standards-sdk.es3.js.map +1 -1
  281. package/dist/es/standards-sdk.es30.js +344 -7
  282. package/dist/es/standards-sdk.es30.js.map +1 -1
  283. package/dist/es/standards-sdk.es31.js +302 -287
  284. package/dist/es/standards-sdk.es31.js.map +1 -1
  285. package/dist/es/standards-sdk.es32.js +94 -322
  286. package/dist/es/standards-sdk.es32.js.map +1 -1
  287. package/dist/es/standards-sdk.es33.js +458 -101
  288. package/dist/es/standards-sdk.es33.js.map +1 -1
  289. package/dist/es/standards-sdk.es34.js +132 -451
  290. package/dist/es/standards-sdk.es34.js.map +1 -1
  291. package/dist/es/standards-sdk.es35.js +216 -130
  292. package/dist/es/standards-sdk.es35.js.map +1 -1
  293. package/dist/es/standards-sdk.es36.js +273 -195
  294. package/dist/es/standards-sdk.es36.js.map +1 -1
  295. package/dist/es/standards-sdk.es37.js +148 -87
  296. package/dist/es/standards-sdk.es37.js.map +1 -1
  297. package/dist/es/standards-sdk.es38.js +183 -320
  298. package/dist/es/standards-sdk.es38.js.map +1 -1
  299. package/dist/es/standards-sdk.es39.js +238 -161
  300. package/dist/es/standards-sdk.es39.js.map +1 -1
  301. package/dist/es/standards-sdk.es4.js +425 -63
  302. package/dist/es/standards-sdk.es4.js.map +1 -1
  303. package/dist/es/standards-sdk.es40.js +136 -254
  304. package/dist/es/standards-sdk.es40.js.map +1 -1
  305. package/dist/es/standards-sdk.es41.js +225 -176
  306. package/dist/es/standards-sdk.es41.js.map +1 -1
  307. package/dist/es/standards-sdk.es42.js +199 -261
  308. package/dist/es/standards-sdk.es42.js.map +1 -1
  309. package/dist/es/standards-sdk.es43.js +237 -199
  310. package/dist/es/standards-sdk.es43.js.map +1 -1
  311. package/dist/es/standards-sdk.es44.js +209 -201
  312. package/dist/es/standards-sdk.es44.js.map +1 -1
  313. package/dist/es/standards-sdk.es45.js +305 -201
  314. package/dist/es/standards-sdk.es45.js.map +1 -1
  315. package/dist/es/standards-sdk.es46.js +371 -261
  316. package/dist/es/standards-sdk.es46.js.map +1 -1
  317. package/dist/es/standards-sdk.es47.js +316 -371
  318. package/dist/es/standards-sdk.es47.js.map +1 -1
  319. package/dist/es/standards-sdk.es48.js +404 -336
  320. package/dist/es/standards-sdk.es48.js.map +1 -1
  321. package/dist/es/standards-sdk.es49.js +83 -449
  322. package/dist/es/standards-sdk.es49.js.map +1 -1
  323. package/dist/es/standards-sdk.es5.js +232 -354
  324. package/dist/es/standards-sdk.es5.js.map +1 -1
  325. package/dist/es/standards-sdk.es50.js +179 -89
  326. package/dist/es/standards-sdk.es50.js.map +1 -1
  327. package/dist/es/standards-sdk.es51.js +231 -165
  328. package/dist/es/standards-sdk.es51.js.map +1 -1
  329. package/dist/es/standards-sdk.es52.js +25 -262
  330. package/dist/es/standards-sdk.es52.js.map +1 -1
  331. package/dist/es/standards-sdk.es53.js +56 -26
  332. package/dist/es/standards-sdk.es53.js.map +1 -1
  333. package/dist/es/standards-sdk.es54.js +12 -57
  334. package/dist/es/standards-sdk.es54.js.map +1 -1
  335. package/dist/es/standards-sdk.es55.js +49 -12
  336. package/dist/es/standards-sdk.es55.js.map +1 -1
  337. package/dist/es/standards-sdk.es56.js +115 -43
  338. package/dist/es/standards-sdk.es56.js.map +1 -1
  339. package/dist/es/standards-sdk.es57.js +42 -115
  340. package/dist/es/standards-sdk.es57.js.map +1 -1
  341. package/dist/es/standards-sdk.es58.js +52 -43
  342. package/dist/es/standards-sdk.es58.js.map +1 -1
  343. package/dist/es/standards-sdk.es59.js +36 -50
  344. package/dist/es/standards-sdk.es59.js.map +1 -1
  345. package/dist/es/standards-sdk.es6.js +125 -246
  346. package/dist/es/standards-sdk.es6.js.map +1 -1
  347. package/dist/es/standards-sdk.es60.js +207 -39
  348. package/dist/es/standards-sdk.es60.js.map +1 -1
  349. package/dist/es/standards-sdk.es61.js +24 -200
  350. package/dist/es/standards-sdk.es61.js.map +1 -1
  351. package/dist/es/standards-sdk.es62.js +87 -25
  352. package/dist/es/standards-sdk.es62.js.map +1 -1
  353. package/dist/es/standards-sdk.es63.js +3 -51
  354. package/dist/es/standards-sdk.es63.js.map +1 -1
  355. package/dist/es/standards-sdk.es64.js +100 -3
  356. package/dist/es/standards-sdk.es64.js.map +1 -1
  357. package/dist/es/standards-sdk.es65.js +61 -62
  358. package/dist/es/standards-sdk.es65.js.map +1 -1
  359. package/dist/es/standards-sdk.es66.js +17 -98
  360. package/dist/es/standards-sdk.es66.js.map +1 -1
  361. package/dist/es/standards-sdk.es67.js +77 -19
  362. package/dist/es/standards-sdk.es67.js.map +1 -1
  363. package/dist/es/standards-sdk.es68.js +458 -77
  364. package/dist/es/standards-sdk.es68.js.map +1 -1
  365. package/dist/es/standards-sdk.es69.js +106 -240
  366. package/dist/es/standards-sdk.es69.js.map +1 -1
  367. package/dist/es/standards-sdk.es7.js +28 -183
  368. package/dist/es/standards-sdk.es7.js.map +1 -1
  369. package/dist/es/standards-sdk.es70.js +170 -286
  370. package/dist/es/standards-sdk.es70.js.map +1 -1
  371. package/dist/es/standards-sdk.es71.js +71 -207
  372. package/dist/es/standards-sdk.es71.js.map +1 -1
  373. package/dist/es/standards-sdk.es72.js +71 -72
  374. package/dist/es/standards-sdk.es72.js.map +1 -1
  375. package/dist/es/standards-sdk.es73.js +143 -71
  376. package/dist/es/standards-sdk.es73.js.map +1 -1
  377. package/dist/es/standards-sdk.es74.js +62 -136
  378. package/dist/es/standards-sdk.es74.js.map +1 -1
  379. package/dist/es/standards-sdk.es75.js +380 -45
  380. package/dist/es/standards-sdk.es75.js.map +1 -1
  381. package/dist/es/standards-sdk.es76.js +222 -130
  382. package/dist/es/standards-sdk.es76.js.map +1 -1
  383. package/dist/es/standards-sdk.es77.js +320 -444
  384. package/dist/es/standards-sdk.es77.js.map +1 -1
  385. package/dist/es/standards-sdk.es78.js +88 -370
  386. package/dist/es/standards-sdk.es78.js.map +1 -1
  387. package/dist/es/standards-sdk.es79.js +125 -89
  388. package/dist/es/standards-sdk.es79.js.map +1 -1
  389. package/dist/es/standards-sdk.es8.js +80 -29
  390. package/dist/es/standards-sdk.es8.js.map +1 -1
  391. package/dist/es/standards-sdk.es80.js +8 -125
  392. package/dist/es/standards-sdk.es80.js.map +1 -1
  393. package/dist/es/standards-sdk.es81.js +45 -6
  394. package/dist/es/standards-sdk.es81.js.map +1 -1
  395. package/dist/es/standards-sdk.es82.js +98 -44
  396. package/dist/es/standards-sdk.es82.js.map +1 -1
  397. package/dist/es/standards-sdk.es83.js +331 -84
  398. package/dist/es/standards-sdk.es83.js.map +1 -1
  399. package/dist/es/standards-sdk.es84.js +93 -160
  400. package/dist/es/standards-sdk.es84.js.map +1 -1
  401. package/dist/es/standards-sdk.es85.js +55 -275
  402. package/dist/es/standards-sdk.es85.js.map +1 -1
  403. package/dist/es/standards-sdk.es86.js +43 -55
  404. package/dist/es/standards-sdk.es86.js.map +1 -1
  405. package/dist/es/standards-sdk.es87.js +145 -22
  406. package/dist/es/standards-sdk.es87.js.map +1 -1
  407. package/dist/es/standards-sdk.es88.js +34 -47
  408. package/dist/es/standards-sdk.es88.js.map +1 -1
  409. package/dist/es/standards-sdk.es89.js +22 -57
  410. package/dist/es/standards-sdk.es89.js.map +1 -1
  411. package/dist/es/standards-sdk.es9.js +104 -80
  412. package/dist/es/standards-sdk.es9.js.map +1 -1
  413. package/dist/es/standards-sdk.es90.js +23 -28
  414. package/dist/es/standards-sdk.es90.js.map +1 -1
  415. package/dist/es/standards-sdk.es91.js +238 -23
  416. package/dist/es/standards-sdk.es91.js.map +1 -1
  417. package/dist/es/standards-sdk.es92.js +265 -152
  418. package/dist/es/standards-sdk.es92.js.map +1 -1
  419. package/dist/es/standards-sdk.es93.js +95 -68
  420. package/dist/es/standards-sdk.es93.js.map +1 -1
  421. package/dist/es/standards-sdk.es94.js +124 -136
  422. package/dist/es/standards-sdk.es94.js.map +1 -1
  423. package/dist/es/standards-sdk.es95.js +42 -138
  424. package/dist/es/standards-sdk.es95.js.map +1 -1
  425. package/dist/es/standards-sdk.es96.js +259 -42
  426. package/dist/es/standards-sdk.es96.js.map +1 -1
  427. package/dist/es/standards-sdk.es97.js +82 -243
  428. package/dist/es/standards-sdk.es97.js.map +1 -1
  429. package/dist/es/standards-sdk.es98.js +48 -47
  430. package/dist/es/standards-sdk.es98.js.map +1 -1
  431. package/dist/es/standards-sdk.es99.js +29 -100
  432. package/dist/es/standards-sdk.es99.js.map +1 -1
  433. package/dist/es/utils/crypto-abstraction.d.ts.map +1 -1
  434. package/dist/es/utils/crypto-env.d.ts.map +1 -1
  435. package/dist/es/utils/dynamic-import.d.ts +5 -1
  436. package/dist/es/utils/dynamic-import.d.ts.map +1 -1
  437. package/dist/es/utils/hash-adapter.d.ts.map +1 -1
  438. package/package.json +36 -13
  439. package/dist/cjs/patches/topic-autorenew-patch.d.ts +0 -2
  440. package/dist/cjs/patches/topic-autorenew-patch.d.ts.map +0 -1
  441. package/dist/es/patches/topic-autorenew-patch.d.ts +0 -2
  442. package/dist/es/patches/topic-autorenew-patch.d.ts.map +0 -1
@@ -1,74 +1,925 @@
1
- import { Logger } from "./standards-sdk.es106.js";
2
- class FloraBuilder {
3
- constructor() {
4
- this.config = {
1
+ import { Client, Status, PrivateKey, AccountUpdateTransaction } from "@hashgraph/sdk";
2
+ import { inscribeWithSigner, inscribe } from "./standards-sdk.es124.js";
3
+ import "./standards-sdk.es150.js";
4
+ import { Logger } from "./standards-sdk.es105.js";
5
+ import { HederaMirrorNode } from "./standards-sdk.es126.js";
6
+ import { ProgressReporter } from "./standards-sdk.es108.js";
7
+ import "axios";
8
+ import "./standards-sdk.es127.js";
9
+ import "./standards-sdk.es128.js";
10
+ import "./standards-sdk.es129.js";
11
+ import "./standards-sdk.es130.js";
12
+ import "./standards-sdk.es131.js";
13
+ import "./standards-sdk.es132.js";
14
+ import "./standards-sdk.es133.js";
15
+ import "./standards-sdk.es134.js";
16
+ import "buffer";
17
+ import "crypto";
18
+ import "@noble/curves/secp256k1.js";
19
+ import { z } from "zod";
20
+ import "./standards-sdk.es149.js";
21
+ import "./standards-sdk.es138.js";
22
+ import "@hashgraph/proto";
23
+ import "ethers";
24
+ import "./standards-sdk.es122.js";
25
+ import "./standards-sdk.es113.js";
26
+ import { getTopicId } from "./standards-sdk.es114.js";
27
+ import * as mime from "mime-types";
28
+ import { isHederaNetwork, toHederaCaip10 } from "./standards-sdk.es57.js";
29
+ import { createNodeOperatorContext } from "./standards-sdk.es147.js";
30
+ import { AIAgentCapability, AIAgentType, VerificationType, MCPServerCapability, ProfileType, capabilityNameToCapabilityMap } from "./standards-sdk.es28.js";
31
+ const SocialLinkSchema = z.object({
32
+ platform: z.string().min(1),
33
+ handle: z.string().min(1)
34
+ });
35
+ const AIAgentDetailsSchema = z.object({
36
+ type: z.nativeEnum(AIAgentType),
37
+ capabilities: z.array(z.nativeEnum(AIAgentCapability)).min(1),
38
+ model: z.string().min(1),
39
+ creator: z.string().optional()
40
+ });
41
+ const MCPServerConnectionInfoSchema = z.object({
42
+ url: z.string().min(1),
43
+ transport: z.enum(["stdio", "sse"])
44
+ });
45
+ const MCPServerVerificationSchema = z.object({
46
+ type: z.nativeEnum(VerificationType),
47
+ value: z.string(),
48
+ dns_field: z.string().optional(),
49
+ challenge_path: z.string().optional()
50
+ });
51
+ const MCPServerHostSchema = z.object({
52
+ minVersion: z.string().optional()
53
+ });
54
+ const MCPServerResourceSchema = z.object({
55
+ name: z.string().min(1),
56
+ description: z.string().min(1)
57
+ });
58
+ const MCPServerToolSchema = z.object({
59
+ name: z.string().min(1),
60
+ description: z.string().min(1)
61
+ });
62
+ const MCPServerDetailsSchema = z.object({
63
+ version: z.string().min(1),
64
+ connectionInfo: MCPServerConnectionInfoSchema,
65
+ services: z.array(z.nativeEnum(MCPServerCapability)).min(1),
66
+ description: z.string().min(1),
67
+ verification: MCPServerVerificationSchema.optional(),
68
+ host: MCPServerHostSchema.optional(),
69
+ capabilities: z.array(z.string()).optional(),
70
+ resources: z.array(MCPServerResourceSchema).optional(),
71
+ tools: z.array(MCPServerToolSchema).optional(),
72
+ maintainer: z.string().optional(),
73
+ repository: z.string().optional(),
74
+ docs: z.string().optional()
75
+ });
76
+ const BaseProfileSchema = z.object({
77
+ version: z.string().min(1),
78
+ type: z.nativeEnum(ProfileType),
79
+ display_name: z.string().min(1),
80
+ alias: z.string().optional(),
81
+ bio: z.string().optional(),
82
+ socials: z.array(SocialLinkSchema).optional(),
83
+ profileImage: z.string().optional(),
84
+ uaid: z.string().optional(),
85
+ properties: z.record(z.any()).optional(),
86
+ inboundTopicId: z.string().optional(),
87
+ outboundTopicId: z.string().optional(),
88
+ base_account: z.string().optional()
89
+ });
90
+ const PersonalProfileSchema = BaseProfileSchema.extend({
91
+ type: z.literal(ProfileType.PERSONAL),
92
+ language: z.string().optional(),
93
+ timezone: z.string().optional()
94
+ });
95
+ const AIAgentProfileSchema = BaseProfileSchema.extend({
96
+ type: z.literal(ProfileType.AI_AGENT),
97
+ aiAgent: AIAgentDetailsSchema
98
+ });
99
+ const MCPServerProfileSchema = BaseProfileSchema.extend({
100
+ type: z.literal(ProfileType.MCP_SERVER),
101
+ mcpServer: MCPServerDetailsSchema
102
+ });
103
+ const FloraProfileSchema = z.object({
104
+ version: z.string(),
105
+ type: z.literal(ProfileType.FLORA),
106
+ display_name: z.string().min(1),
107
+ members: z.array(
108
+ z.object({
109
+ accountId: z.string(),
110
+ publicKey: z.string().optional(),
111
+ weight: z.number().optional()
112
+ })
113
+ ),
114
+ threshold: z.number().min(1),
115
+ topics: z.object({
116
+ communication: z.string(),
117
+ transaction: z.string(),
118
+ state: z.string()
119
+ }),
120
+ inboundTopicId: z.string(),
121
+ outboundTopicId: z.string(),
122
+ bio: z.string().optional(),
123
+ metadata: z.record(z.any()).optional(),
124
+ policies: z.record(z.any()).optional()
125
+ });
126
+ const HCS11ProfileSchema = z.union([
127
+ PersonalProfileSchema,
128
+ AIAgentProfileSchema,
129
+ MCPServerProfileSchema,
130
+ FloraProfileSchema
131
+ ]);
132
+ class HCS11Client {
133
+ constructor(config) {
134
+ this.client = config.network === "mainnet" ? Client.forMainnet() : Client.forTestnet();
135
+ this.auth = config.auth;
136
+ this.network = config.network;
137
+ this.operatorId = config.auth.operatorId;
138
+ this.logger = Logger.getInstance({
139
+ level: config.logLevel || "info",
140
+ module: "HCS-11",
141
+ silent: config.silent
142
+ });
143
+ this.mirrorNode = new HederaMirrorNode(
144
+ this.network,
145
+ this.logger
146
+ );
147
+ if (this.auth.privateKey) {
148
+ this.operatorCtx = createNodeOperatorContext({
149
+ network: this.network,
150
+ operatorId: this.operatorId,
151
+ operatorKey: this.auth.privateKey,
152
+ keyType: config.keyType,
153
+ mirrorNode: this.mirrorNode,
154
+ logger: this.logger,
155
+ client: this.client
156
+ });
157
+ this.client = this.operatorCtx.client;
158
+ this.keyType = this.operatorCtx.keyType;
159
+ void this.operatorCtx.ensureInitialized();
160
+ this.client.setOperator(
161
+ this.operatorId.toString(),
162
+ this.operatorCtx.operatorKey
163
+ );
164
+ } else {
165
+ this.keyType = config.keyType || "ed25519";
166
+ }
167
+ }
168
+ getClient() {
169
+ return this.client;
170
+ }
171
+ getOperatorId() {
172
+ return this.auth.operatorId;
173
+ }
174
+ async initializeOperator() {
175
+ if (!this.operatorCtx) {
176
+ return;
177
+ }
178
+ try {
179
+ await this.operatorCtx.ensureInitialized();
180
+ this.keyType = this.operatorCtx.keyType;
181
+ this.client.setOperator(this.operatorId, this.operatorCtx.operatorKey);
182
+ } catch (error) {
183
+ this.logger.warn(
184
+ `Failed to verify operator key with mirror node: ${error.message}`
185
+ );
186
+ }
187
+ }
188
+ createPersonalProfile(displayName, options) {
189
+ return {
5
190
  version: "1.0",
6
- type: 3
191
+ type: ProfileType.PERSONAL,
192
+ display_name: displayName,
193
+ alias: options?.alias,
194
+ bio: options?.bio,
195
+ socials: options?.socials,
196
+ profileImage: options?.profileImage,
197
+ properties: options?.properties,
198
+ inboundTopicId: options?.inboundTopicId,
199
+ outboundTopicId: options?.outboundTopicId,
200
+ base_account: options?.baseAccount
7
201
  };
8
- this.logger = Logger.getInstance({
9
- module: "FloraBuilder"
202
+ }
203
+ createAIAgentProfile(displayName, agentType, capabilities, model, options) {
204
+ const validation = this.validateProfile({
205
+ version: "1.0",
206
+ type: ProfileType.AI_AGENT,
207
+ display_name: displayName,
208
+ alias: options?.alias,
209
+ bio: options?.bio,
210
+ socials: options?.socials,
211
+ profileImage: options?.profileImage,
212
+ properties: options?.properties,
213
+ inboundTopicId: options?.inboundTopicId,
214
+ outboundTopicId: options?.outboundTopicId,
215
+ base_account: options?.baseAccount,
216
+ aiAgent: {
217
+ type: agentType,
218
+ capabilities,
219
+ model,
220
+ creator: options?.creator
221
+ }
10
222
  });
223
+ if (!validation.valid) {
224
+ throw new Error(
225
+ `Invalid AI Agent Profile: ${validation.errors.join(", ")}`
226
+ );
227
+ }
228
+ return {
229
+ version: "1.0",
230
+ type: ProfileType.AI_AGENT,
231
+ display_name: displayName,
232
+ alias: options?.alias,
233
+ bio: options?.bio,
234
+ socials: options?.socials,
235
+ profileImage: options?.profileImage,
236
+ properties: options?.properties,
237
+ inboundTopicId: options?.inboundTopicId,
238
+ outboundTopicId: options?.outboundTopicId,
239
+ base_account: options?.baseAccount,
240
+ aiAgent: {
241
+ type: agentType,
242
+ capabilities,
243
+ model,
244
+ creator: options?.creator
245
+ }
246
+ };
11
247
  }
12
- setDisplayName(displayName) {
13
- this.config.display_name = displayName;
14
- return this;
248
+ /**
249
+ * Creates an MCP server profile.
250
+ *
251
+ * @param displayName - The display name for the MCP server
252
+ * @param serverDetails - The MCP server details
253
+ * @param options - Additional profile options
254
+ * @returns An MCPServerProfile object
255
+ */
256
+ createMCPServerProfile(displayName, serverDetails, options) {
257
+ const validation = this.validateProfile({
258
+ version: "1.0",
259
+ type: ProfileType.MCP_SERVER,
260
+ display_name: displayName,
261
+ alias: options?.alias,
262
+ bio: options?.bio,
263
+ socials: options?.socials,
264
+ profileImage: options?.profileImage,
265
+ properties: options?.properties,
266
+ inboundTopicId: options?.inboundTopicId,
267
+ outboundTopicId: options?.outboundTopicId,
268
+ mcpServer: serverDetails
269
+ });
270
+ if (!validation.valid) {
271
+ throw new Error(
272
+ `Invalid MCP Server Profile: ${validation.errors.join(", ")}`
273
+ );
274
+ }
275
+ return {
276
+ version: "1.0",
277
+ type: ProfileType.MCP_SERVER,
278
+ display_name: displayName,
279
+ alias: options?.alias,
280
+ bio: options?.bio,
281
+ socials: options?.socials,
282
+ profileImage: options?.profileImage,
283
+ properties: options?.properties,
284
+ inboundTopicId: options?.inboundTopicId,
285
+ outboundTopicId: options?.outboundTopicId,
286
+ mcpServer: serverDetails
287
+ };
15
288
  }
16
- setBio(bio) {
17
- this.config.bio = bio;
18
- return this;
289
+ validateProfile(profile) {
290
+ const result = HCS11ProfileSchema.safeParse(profile);
291
+ if (result.success) {
292
+ return { valid: true, errors: [] };
293
+ }
294
+ const formattedErrors = result.error.errors.map((err) => {
295
+ const path = err.path.join(".");
296
+ let message = err.message;
297
+ if (err.code === "invalid_type") {
298
+ message = `Expected ${err.expected}, got ${err.received}`;
299
+ } else if (err.code === "invalid_enum_value") {
300
+ const validOptions = err.options?.join(", ");
301
+ message = `Invalid value. Valid options are: ${validOptions}`;
302
+ } else if (err.code === "too_small" && err.type === "string") {
303
+ message = "Cannot be empty";
304
+ }
305
+ return `${path}: ${message}`;
306
+ });
307
+ return { valid: false, errors: formattedErrors };
308
+ }
309
+ profileToJSONString(profile) {
310
+ return JSON.stringify(profile);
19
311
  }
20
- setMembers(members) {
21
- this.config.members = members;
22
- return this;
312
+ parseProfileFromString(profileStr) {
313
+ try {
314
+ const parsedProfile = JSON.parse(profileStr);
315
+ const validation = this.validateProfile(parsedProfile);
316
+ if (!validation.valid) {
317
+ this.logger.error("Invalid profile format:", validation.errors);
318
+ return null;
319
+ }
320
+ return parsedProfile;
321
+ } catch (error) {
322
+ this.logger.error("Error parsing profile:");
323
+ return null;
324
+ }
23
325
  }
24
- setThreshold(threshold) {
25
- this.config.threshold = threshold;
26
- return this;
326
+ setProfileForAccountMemo(topicId, topicStandard = 1) {
327
+ return `hcs-11:hcs://${topicStandard}/${topicId}`;
328
+ }
329
+ async executeTransaction(transaction) {
330
+ try {
331
+ if (this.auth.privateKey) {
332
+ const signedTx = await transaction.signWithOperator(this.client);
333
+ const response2 = await signedTx.execute(this.client);
334
+ const receipt2 = await response2.getReceipt(this.client);
335
+ if (receipt2.status.toString() !== Status.Success.toString()) {
336
+ return {
337
+ success: false,
338
+ error: `Transaction failed: ${receipt2.status.toString()}`
339
+ };
340
+ }
341
+ return {
342
+ success: true,
343
+ result: receipt2
344
+ };
345
+ }
346
+ if (!this.auth.signer) {
347
+ throw new Error("No valid authentication method provided");
348
+ }
349
+ const signer = this.auth.signer;
350
+ const frozenTransaction = await transaction.freezeWithSigner(signer);
351
+ const response = await frozenTransaction.executeWithSigner(signer);
352
+ const receipt = await response.getReceiptWithSigner(signer);
353
+ if (receipt.status.toString() !== Status.Success.toString()) {
354
+ return {
355
+ success: false,
356
+ error: `Transaction failed: ${receipt.status.toString()}: ${Status.Success.toString()}`
357
+ };
358
+ }
359
+ return {
360
+ success: true,
361
+ result: receipt
362
+ };
363
+ } catch (error) {
364
+ return {
365
+ success: false,
366
+ error: error instanceof Error ? error.message : "Unknown error during transaction execution"
367
+ };
368
+ }
27
369
  }
28
- setTopics(topics) {
29
- this.config.topics = topics;
30
- this.config.inboundTopicId = topics.communication;
31
- this.config.outboundTopicId = topics.transaction;
32
- return this;
370
+ async inscribeImage(buffer, fileName, options) {
371
+ try {
372
+ const progressCallback = options?.progressCallback;
373
+ const progressReporter = new ProgressReporter({
374
+ module: "HCS11-Image",
375
+ logger: this.logger,
376
+ callback: progressCallback
377
+ });
378
+ progressReporter.preparing("Preparing to inscribe image", 0);
379
+ const mimeType = mime.lookup(fileName) || "application/octet-stream";
380
+ const waitForConfirmation = options?.waitForConfirmation ?? true;
381
+ let inscriptionResponse;
382
+ if (this.auth.signer) {
383
+ if ("accountId" in this.auth.signer) {
384
+ progressReporter.preparing("Using signer for inscription", 10);
385
+ inscriptionResponse = await inscribeWithSigner(
386
+ {
387
+ type: "buffer",
388
+ buffer,
389
+ fileName,
390
+ mimeType
391
+ },
392
+ this.auth.signer,
393
+ {
394
+ network: this.network,
395
+ waitForConfirmation,
396
+ waitMaxAttempts: 150,
397
+ waitIntervalMs: 4e3,
398
+ logging: {
399
+ level: "debug"
400
+ },
401
+ progressCallback: (data) => {
402
+ const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;
403
+ progressReporter.report({
404
+ stage: data.stage,
405
+ message: data.message,
406
+ progressPercent: adjustedPercent,
407
+ details: data.details
408
+ });
409
+ }
410
+ }
411
+ );
412
+ } else {
413
+ progressReporter.failed(
414
+ "Signer must be a DAppSigner for inscription"
415
+ );
416
+ throw new Error("Signer must be a DAppSigner for inscription");
417
+ }
418
+ } else {
419
+ if (!this.auth.privateKey) {
420
+ progressReporter.failed("Private key is required for inscription");
421
+ this.logger.error("Private key is required for inscription");
422
+ throw new Error("Private key is required for inscription");
423
+ }
424
+ progressReporter.preparing("Using private key for inscription", 10);
425
+ const PK = this.keyType === "ecdsa" ? PrivateKey.fromStringECDSA(this.auth.privateKey) : PrivateKey.fromStringED25519(this.auth.privateKey);
426
+ inscriptionResponse = await inscribe(
427
+ {
428
+ type: "buffer",
429
+ buffer,
430
+ fileName,
431
+ mimeType
432
+ },
433
+ {
434
+ accountId: this.auth.operatorId,
435
+ privateKey: PK,
436
+ network: this.network
437
+ },
438
+ {
439
+ waitForConfirmation,
440
+ waitMaxAttempts: 150,
441
+ waitIntervalMs: 2e3,
442
+ logging: {
443
+ level: "debug"
444
+ },
445
+ progressCallback: (data) => {
446
+ const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;
447
+ progressReporter.report({
448
+ stage: data.stage,
449
+ message: data.message,
450
+ progressPercent: adjustedPercent,
451
+ details: data.details
452
+ });
453
+ }
454
+ }
455
+ );
456
+ }
457
+ if (inscriptionResponse.confirmed) {
458
+ progressReporter.completed("Image inscription completed", {
459
+ topicId: getTopicId(inscriptionResponse.inscription)
460
+ });
461
+ return {
462
+ imageTopicId: getTopicId(inscriptionResponse.inscription) || "",
463
+ transactionId: inscriptionResponse.result.jobId,
464
+ success: true
465
+ };
466
+ } else {
467
+ const jobId = inscriptionResponse.quote ? "quote-only" : inscriptionResponse.result.jobId;
468
+ progressReporter.verifying("Waiting for inscription confirmation", 50, {
469
+ jobId
470
+ });
471
+ return {
472
+ imageTopicId: "",
473
+ transactionId: jobId,
474
+ success: false,
475
+ error: "Inscription not confirmed"
476
+ };
477
+ }
478
+ } catch (error) {
479
+ this.logger.error("Error inscribing image:", error);
480
+ return {
481
+ imageTopicId: "",
482
+ transactionId: "",
483
+ success: false,
484
+ error: error instanceof Error ? error.message : "Error inscribing image"
485
+ };
486
+ }
33
487
  }
34
- setPolicies(policies) {
35
- this.config.policies = policies;
36
- return this;
488
+ async inscribeProfile(profile, options) {
489
+ this.logger.info("Inscribing HCS-11 profile");
490
+ const progressCallback = options?.progressCallback;
491
+ const progressReporter = new ProgressReporter({
492
+ module: "HCS11-Profile",
493
+ logger: this.logger,
494
+ callback: progressCallback
495
+ });
496
+ await this.attachUaidIfMissing(profile);
497
+ progressReporter.preparing("Validating profile data", 5);
498
+ const validation = this.validateProfile(profile);
499
+ if (!validation.valid) {
500
+ progressReporter.failed(
501
+ `Invalid profile: ${validation.errors.join(", ")}`
502
+ );
503
+ return {
504
+ profileTopicId: "",
505
+ transactionId: "",
506
+ success: false,
507
+ error: `Invalid profile: ${validation.errors.join(", ")}`
508
+ };
509
+ }
510
+ progressReporter.preparing("Formatting profile for inscription", 15);
511
+ const profileJson = this.profileToJSONString(profile);
512
+ const fileName = `profile-${profile.display_name.toLowerCase().replace(/\s+/g, "-")}.json`;
513
+ try {
514
+ const contentBuffer = Buffer.from(profileJson, "utf-8");
515
+ const contentType = "application/json";
516
+ progressReporter.preparing("Preparing profile for inscription", 20);
517
+ const input = {
518
+ type: "buffer",
519
+ buffer: contentBuffer,
520
+ fileName,
521
+ mimeType: contentType
522
+ };
523
+ const inscriptionOptions = {
524
+ waitForConfirmation: true,
525
+ mode: "file",
526
+ network: this.network,
527
+ waitMaxAttempts: 100,
528
+ waitIntervalMs: 2e3,
529
+ progressCallback: (data) => {
530
+ const adjustedPercent = 20 + Number(data?.progressPercent || 0) * 0.75;
531
+ progressReporter?.report({
532
+ stage: data.stage,
533
+ message: data.message,
534
+ progressPercent: adjustedPercent,
535
+ details: data.details
536
+ });
537
+ }
538
+ };
539
+ progressReporter.submitting("Submitting profile to Hedera network", 30);
540
+ let inscriptionResponse;
541
+ if (this.auth.privateKey) {
542
+ const PK = this.keyType === "ecdsa" ? PrivateKey.fromStringECDSA(this.auth.privateKey) : PrivateKey.fromStringED25519(this.auth.privateKey);
543
+ inscriptionResponse = await inscribe(
544
+ input,
545
+ {
546
+ accountId: this.auth.operatorId,
547
+ privateKey: PK,
548
+ network: this.network
549
+ },
550
+ inscriptionOptions
551
+ );
552
+ } else if (this.auth.signer) {
553
+ inscriptionResponse = await inscribeWithSigner(
554
+ input,
555
+ this.auth.signer,
556
+ inscriptionOptions
557
+ );
558
+ } else {
559
+ throw new Error(
560
+ "No authentication method available - neither private key nor signer"
561
+ );
562
+ }
563
+ if (!inscriptionResponse.confirmed || !getTopicId(inscriptionResponse.inscription)) {
564
+ progressReporter.failed("Failed to inscribe profile content");
565
+ return {
566
+ profileTopicId: "",
567
+ transactionId: "",
568
+ success: false,
569
+ error: "Failed to inscribe profile content"
570
+ };
571
+ }
572
+ const topicId = getTopicId(inscriptionResponse.inscription);
573
+ progressReporter.completed("Profile inscription completed", {
574
+ topicId,
575
+ transactionId: inscriptionResponse.result.transactionId
576
+ });
577
+ return {
578
+ profileTopicId: topicId,
579
+ transactionId: inscriptionResponse.result.transactionId,
580
+ success: true,
581
+ totalCostHbar: inscriptionResponse.costSummary?.totalCostHbar
582
+ };
583
+ } catch (error) {
584
+ progressReporter.failed(
585
+ `Error inscribing profile: ${error.message || "Unknown error"}`
586
+ );
587
+ return {
588
+ profileTopicId: "",
589
+ transactionId: "",
590
+ success: false,
591
+ error: error.message || "Unknown error during inscription"
592
+ };
593
+ }
37
594
  }
38
- setMetadata(metadata) {
39
- this.config.metadata = metadata;
40
- return this;
595
+ async attachUaidIfMissing(profile) {
596
+ if (profile.uaid) {
597
+ return;
598
+ }
599
+ if (!isHederaNetwork(this.network)) {
600
+ return;
601
+ }
602
+ try {
603
+ const { HCS14Client } = await import("./standards-sdk.es146.js");
604
+ const hcs14 = new HCS14Client({ client: this.client });
605
+ const did = await hcs14.createDid({
606
+ method: "hedera",
607
+ client: this.client
608
+ });
609
+ const nativeId = toHederaCaip10(this.network, this.auth.operatorId);
610
+ let uid = this.auth.operatorId;
611
+ const inboundFromProfile = profile.inboundTopicId;
612
+ if (inboundFromProfile && inboundFromProfile.trim().length > 0) {
613
+ uid = `${inboundFromProfile}@${this.auth.operatorId}`;
614
+ } else {
615
+ try {
616
+ const fetched = await this.fetchProfileByAccountId(
617
+ this.auth.operatorId,
618
+ this.network
619
+ );
620
+ const inbound = fetched?.topicInfo?.inboundTopic;
621
+ if (inbound && inbound.trim().length > 0) {
622
+ uid = `${inbound}@${this.auth.operatorId}`;
623
+ }
624
+ } catch {
625
+ }
626
+ }
627
+ const uaid = hcs14.createUaid(did, { proto: "hcs-10", nativeId, uid });
628
+ profile.uaid = uaid;
629
+ } catch (e) {
630
+ this.logger.warn(
631
+ "Hiero registrar not available; skipping UAID generation for profile",
632
+ e
633
+ );
634
+ }
41
635
  }
42
- addMetadata(key, value) {
43
- if (!this.config.metadata) {
44
- this.config.metadata = {};
636
+ async updateAccountMemoWithProfile(accountId, profileTopicId, signerKeys) {
637
+ try {
638
+ this.logger.info(
639
+ `Updating account memo for ${accountId} with profile ${profileTopicId}`
640
+ );
641
+ const memo = this.setProfileForAccountMemo(profileTopicId);
642
+ const transaction = new AccountUpdateTransaction().setAccountMemo(memo).setAccountId(accountId);
643
+ if (signerKeys && signerKeys.length > 0) {
644
+ const frozen = await transaction.freezeWith(this.client);
645
+ let signed = frozen;
646
+ for (const key of signerKeys) {
647
+ signed = await signed.sign(key);
648
+ }
649
+ const response = await signed.execute(this.client);
650
+ const receipt = await response.getReceipt(this.client);
651
+ if (receipt.status.toString() !== Status.Success.toString()) {
652
+ return {
653
+ success: false,
654
+ error: `Transaction failed: ${receipt.status.toString()}`
655
+ };
656
+ }
657
+ return {
658
+ success: true,
659
+ result: receipt
660
+ };
661
+ }
662
+ return this.executeTransaction(transaction);
663
+ } catch (error) {
664
+ this.logger.error(
665
+ `Error updating account memo: ${error instanceof Error ? error.message : "Unknown error"}`
666
+ );
667
+ return {
668
+ success: false,
669
+ error: error instanceof Error ? error.message : "Unknown error updating account memo"
670
+ };
45
671
  }
46
- this.config.metadata[key] = value;
47
- return this;
48
672
  }
49
- build() {
50
- if (!this.config.display_name) {
51
- throw new Error("Flora display name is required");
673
+ /**
674
+ * Creates and inscribes a profile.
675
+ *
676
+ * @param profile - The profile to create and inscribe.
677
+ * @param updateAccountMemo - Whether to update the account memo with the profile.
678
+ * @param options - Optional configuration options.
679
+ * @returns A promise that resolves to the inscription result.
680
+ */
681
+ async createAndInscribeProfile(profile, updateAccountMemo = true, options) {
682
+ const progressCallback = options?.progressCallback;
683
+ const progressReporter = new ProgressReporter({
684
+ module: "HCS11-ProfileCreation",
685
+ logger: this.logger,
686
+ callback: progressCallback
687
+ });
688
+ progressReporter.preparing("Starting profile creation process", 0);
689
+ const inscriptionProgress = progressReporter.createSubProgress({
690
+ minPercent: 0,
691
+ maxPercent: 80,
692
+ logPrefix: "Inscription"
693
+ });
694
+ const inscriptionResult = await this.inscribeProfile(profile, {
695
+ ...options,
696
+ progressCallback: (data) => {
697
+ inscriptionProgress.report({
698
+ stage: data.stage,
699
+ message: data.message,
700
+ progressPercent: data.progressPercent,
701
+ details: data.details
702
+ });
703
+ }
704
+ });
705
+ if (!inscriptionResult?.success) {
706
+ progressReporter.failed("Profile inscription failed", {
707
+ error: inscriptionResult?.error
708
+ });
709
+ return inscriptionResult;
52
710
  }
53
- if (!this.config.members || this.config.members.length === 0) {
54
- throw new Error("Flora must have at least one member");
711
+ progressReporter.confirming("Profile inscribed, updating account memo", 85);
712
+ if (updateAccountMemo) {
713
+ const memoResult = await this.updateAccountMemoWithProfile(
714
+ this.auth.operatorId,
715
+ inscriptionResult.profileTopicId
716
+ );
717
+ if (!memoResult.success) {
718
+ progressReporter.failed("Failed to update account memo", {
719
+ error: memoResult?.error
720
+ });
721
+ return {
722
+ ...inscriptionResult,
723
+ success: false,
724
+ error: memoResult?.error
725
+ };
726
+ }
55
727
  }
56
- if (!this.config.threshold || this.config.threshold < 1) {
57
- throw new Error("Flora threshold must be at least 1");
728
+ progressReporter.completed("Profile creation completed successfully", {
729
+ profileTopicId: inscriptionResult.profileTopicId,
730
+ transactionId: inscriptionResult.transactionId,
731
+ totalCostHbar: inscriptionResult.totalCostHbar
732
+ });
733
+ return inscriptionResult;
734
+ }
735
+ /**
736
+ * Gets the capabilities from the capability names.
737
+ *
738
+ * @param capabilityNames - The capability names to get the capabilities for.
739
+ * @returns The capabilities.
740
+ */
741
+ async getCapabilitiesFromTags(capabilityNames) {
742
+ const capabilities = [];
743
+ if (capabilityNames.length === 0) {
744
+ return [AIAgentCapability.TEXT_GENERATION];
58
745
  }
59
- if (this.config.threshold > this.config.members.length) {
60
- throw new Error("Flora threshold cannot exceed number of members");
746
+ for (const capabilityName of capabilityNames) {
747
+ const capability = capabilityNameToCapabilityMap[capabilityName.toLowerCase()];
748
+ if (capability !== void 0 && !capabilities.includes(capability)) {
749
+ capabilities.push(capability);
750
+ }
61
751
  }
62
- if (!this.config.topics) {
63
- throw new Error("Flora topics are required");
752
+ if (capabilities.length === 0) {
753
+ capabilities.push(AIAgentCapability.TEXT_GENERATION);
64
754
  }
65
- if (!this.config.inboundTopicId || !this.config.outboundTopicId) {
66
- throw new Error("Flora inbound and outbound topic IDs are required");
755
+ return capabilities;
756
+ }
757
+ /**
758
+ * Gets the agent type from the metadata.
759
+ *
760
+ * @param metadata - The metadata of the agent.
761
+ * @returns The agent type.
762
+ */
763
+ getAgentTypeFromMetadata(metadata) {
764
+ if (metadata.type === "autonomous") {
765
+ return AIAgentType.AUTONOMOUS;
766
+ } else {
767
+ return AIAgentType.MANUAL;
768
+ }
769
+ }
770
+ /**
771
+ * Fetches a profile from the account memo.
772
+ *
773
+ * @param accountId - The account ID of the agent to fetch the profile for.
774
+ * @param network - The network to use for the fetch.
775
+ * @returns A promise that resolves to the profile.
776
+ */
777
+ async fetchProfileByAccountId(accountId, network) {
778
+ try {
779
+ this.logger.debug(
780
+ `Fetching profile for account ${accountId.toString()} on ${this.network}`
781
+ );
782
+ const memo = await this.mirrorNode.getAccountMemo(accountId.toString());
783
+ this.logger.debug(`Got account memo: ${memo}`);
784
+ if (!memo?.startsWith("hcs-11:")) {
785
+ return {
786
+ success: false,
787
+ error: `Account ${accountId.toString()} does not have a valid HCS-11 memo. Current memo: ${memo || "empty"}`
788
+ };
789
+ }
790
+ this.logger.debug(`Found HCS-11 memo: ${memo}`);
791
+ const protocolReference = memo.substring(7);
792
+ if (protocolReference?.startsWith("hcs://")) {
793
+ const hcsFormat = protocolReference.match(/hcs:\/\/(\d+)\/(.+)/);
794
+ if (!hcsFormat) {
795
+ return {
796
+ success: false,
797
+ error: `Invalid HCS protocol reference format: ${protocolReference}`
798
+ };
799
+ }
800
+ const [_, protocolId, profileTopicId] = hcsFormat;
801
+ const networkParam = network || this.network || "mainnet";
802
+ this.logger.debug(
803
+ `Retrieving profile from Kiloscribe CDN: ${profileTopicId}`
804
+ );
805
+ const cdnUrl = `https://kiloscribe.com/api/inscription-cdn/${profileTopicId}?network=${networkParam}`;
806
+ try {
807
+ const response = await fetch(cdnUrl);
808
+ if (!response.ok) {
809
+ return {
810
+ success: false,
811
+ error: `Failed to fetch profile from Kiloscribe CDN: ${response.statusText}`
812
+ };
813
+ }
814
+ const profileData = await response.json();
815
+ if (!profileData) {
816
+ return {
817
+ success: false,
818
+ error: `No profile data found for topic ${profileTopicId}`
819
+ };
820
+ }
821
+ const parsed = HCS11ProfileSchema.safeParse(profileData);
822
+ if (!parsed.success) {
823
+ return {
824
+ success: false,
825
+ error: `Invalid HCS-11 profile data for topic ${profileTopicId}`
826
+ };
827
+ }
828
+ return {
829
+ success: true,
830
+ profile: parsed.data,
831
+ topicInfo: {
832
+ inboundTopic: parsed.data.inboundTopicId || "",
833
+ outboundTopic: parsed.data.outboundTopicId || "",
834
+ profileTopicId
835
+ }
836
+ };
837
+ } catch (cdnError) {
838
+ this.logger.error(
839
+ `Error retrieving from Kiloscribe CDN: ${cdnError.message}`
840
+ );
841
+ return {
842
+ success: false,
843
+ error: `Error retrieving from Kiloscribe CDN: ${cdnError.message}`
844
+ };
845
+ }
846
+ } else if (protocolReference.startsWith("ipfs://")) {
847
+ this.logger.warn("IPFS protocol references are not fully supported");
848
+ const response = await fetch(
849
+ `https://ipfs.io/ipfs/${protocolReference.replace("ipfs://", "")}`
850
+ );
851
+ const profileData = await response.json();
852
+ const parsed = HCS11ProfileSchema.safeParse(profileData);
853
+ if (!parsed.success) {
854
+ return {
855
+ success: false,
856
+ error: `Invalid HCS-11 profile data from IPFS reference ${protocolReference}`
857
+ };
858
+ }
859
+ return {
860
+ success: true,
861
+ profile: parsed.data,
862
+ topicInfo: {
863
+ inboundTopic: parsed.data.inboundTopicId || "",
864
+ outboundTopic: parsed.data.outboundTopicId || "",
865
+ profileTopicId: ""
866
+ }
867
+ };
868
+ } else if (protocolReference.startsWith("ar://")) {
869
+ const arTxId = protocolReference.replace("ar://", "");
870
+ const response = await fetch(`https://arweave.net/${arTxId}`);
871
+ if (!response.ok) {
872
+ return {
873
+ success: false,
874
+ error: `Failed to fetch profile from Arweave ${arTxId}: ${response.statusText}`
875
+ };
876
+ }
877
+ const profileData = await response.json();
878
+ const parsed = HCS11ProfileSchema.safeParse(profileData);
879
+ if (!parsed.success) {
880
+ return {
881
+ success: false,
882
+ error: `Invalid HCS-11 profile data from Arweave reference ${arTxId}`
883
+ };
884
+ }
885
+ return {
886
+ success: true,
887
+ profile: parsed.data,
888
+ topicInfo: {
889
+ inboundTopic: parsed.data.inboundTopicId || "",
890
+ outboundTopic: parsed.data.outboundTopicId || "",
891
+ profileTopicId: ""
892
+ }
893
+ };
894
+ } else {
895
+ return {
896
+ success: false,
897
+ error: `Invalid protocol reference format: ${protocolReference}`
898
+ };
899
+ }
900
+ } catch (error) {
901
+ this.logger.error(`Error fetching profile: ${error.message}`);
902
+ return {
903
+ success: false,
904
+ error: `Error fetching profile: ${error.message}`
905
+ };
67
906
  }
68
- return this.config;
69
907
  }
70
908
  }
71
909
  export {
72
- FloraBuilder
910
+ AIAgentDetailsSchema,
911
+ AIAgentProfileSchema,
912
+ BaseProfileSchema,
913
+ HCS11Client,
914
+ HCS11ProfileSchema,
915
+ MCPServerConnectionInfoSchema,
916
+ MCPServerDetailsSchema,
917
+ MCPServerHostSchema,
918
+ MCPServerProfileSchema,
919
+ MCPServerResourceSchema,
920
+ MCPServerToolSchema,
921
+ MCPServerVerificationSchema,
922
+ PersonalProfileSchema,
923
+ SocialLinkSchema
73
924
  };
74
925
  //# sourceMappingURL=standards-sdk.es27.js.map