@hashgraphonline/standards-sdk 0.0.63 → 0.0.65

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 (295) hide show
  1. package/dist/es/fees/fee-config-builder.d.ts.map +1 -0
  2. package/dist/es/fees/index.d.ts +3 -0
  3. package/dist/es/fees/index.d.ts.map +1 -0
  4. package/dist/es/fees/types.d.ts +24 -0
  5. package/dist/es/fees/types.d.ts.map +1 -0
  6. package/dist/es/hcs-10/base-client.d.ts +1 -1
  7. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  8. package/dist/es/hcs-10/browser.d.ts +20 -35
  9. package/dist/es/hcs-10/browser.d.ts.map +1 -1
  10. package/dist/es/hcs-10/index.d.ts +4 -6
  11. package/dist/es/hcs-10/index.d.ts.map +1 -1
  12. package/dist/es/hcs-10/registrations.d.ts.map +1 -1
  13. package/dist/es/hcs-10/sdk.d.ts +16 -8
  14. package/dist/es/hcs-10/sdk.d.ts.map +1 -1
  15. package/dist/es/hcs-10/types.d.ts +2 -62
  16. package/dist/es/hcs-10/types.d.ts.map +1 -1
  17. package/dist/es/hcs-11/agent-builder.d.ts +53 -0
  18. package/dist/es/hcs-11/agent-builder.d.ts.map +1 -0
  19. package/dist/es/hcs-11/client.d.ts +82 -0
  20. package/dist/es/hcs-11/client.d.ts.map +1 -0
  21. package/dist/es/hcs-11/index.d.ts +4 -190
  22. package/dist/es/hcs-11/index.d.ts.map +1 -1
  23. package/dist/es/hcs-11/person-builder.d.ts +29 -0
  24. package/dist/es/hcs-11/person-builder.d.ts.map +1 -0
  25. package/dist/es/hcs-11/types.d.ts +165 -0
  26. package/dist/es/hcs-11/types.d.ts.map +1 -0
  27. package/dist/es/index.d.ts +1 -0
  28. package/dist/es/index.d.ts.map +1 -1
  29. package/dist/es/services/mirror-node.d.ts +2 -1
  30. package/dist/es/services/mirror-node.d.ts.map +1 -1
  31. package/dist/es/services/types.d.ts +0 -1
  32. package/dist/es/services/types.d.ts.map +1 -1
  33. package/dist/es/standards-sdk.es.js +9 -7
  34. package/dist/es/standards-sdk.es.js.map +1 -1
  35. package/dist/es/standards-sdk.es10.js +114 -1046
  36. package/dist/es/standards-sdk.es10.js.map +1 -1
  37. package/dist/es/standards-sdk.es100.js +13 -36
  38. package/dist/es/standards-sdk.es100.js.map +1 -1
  39. package/dist/es/standards-sdk.es101.js +36 -10
  40. package/dist/es/standards-sdk.es101.js.map +1 -1
  41. package/dist/es/standards-sdk.es102.js +10 -53
  42. package/dist/es/standards-sdk.es102.js.map +1 -1
  43. package/dist/es/standards-sdk.es103.js +47 -1275
  44. package/dist/es/standards-sdk.es103.js.map +1 -1
  45. package/dist/es/standards-sdk.es104.js +1282 -25
  46. package/dist/es/standards-sdk.es104.js.map +1 -1
  47. package/dist/es/standards-sdk.es105.js +31 -5
  48. package/dist/es/standards-sdk.es105.js.map +1 -1
  49. package/dist/es/standards-sdk.es106.js +5 -158
  50. package/dist/es/standards-sdk.es106.js.map +1 -1
  51. package/dist/es/standards-sdk.es107.js +147 -781
  52. package/dist/es/standards-sdk.es107.js.map +1 -1
  53. package/dist/es/standards-sdk.es108.js +785 -166
  54. package/dist/es/standards-sdk.es108.js.map +1 -1
  55. package/dist/es/standards-sdk.es109.js +2 -2
  56. package/dist/es/standards-sdk.es11.js +80 -71
  57. package/dist/es/standards-sdk.es11.js.map +1 -1
  58. package/dist/es/standards-sdk.es110.js +169 -16
  59. package/dist/es/standards-sdk.es110.js.map +1 -1
  60. package/dist/es/standards-sdk.es111.js +19 -25
  61. package/dist/es/standards-sdk.es111.js.map +1 -1
  62. package/dist/es/standards-sdk.es112.js +24 -23
  63. package/dist/es/standards-sdk.es112.js.map +1 -1
  64. package/dist/es/standards-sdk.es113.js +23 -35
  65. package/dist/es/standards-sdk.es113.js.map +1 -1
  66. package/dist/es/standards-sdk.es114.js +41 -0
  67. package/dist/es/standards-sdk.es114.js.map +1 -0
  68. package/dist/es/standards-sdk.es12.js +650 -7
  69. package/dist/es/standards-sdk.es12.js.map +1 -1
  70. package/dist/es/standards-sdk.es13.js +10 -664
  71. package/dist/es/standards-sdk.es13.js.map +1 -1
  72. package/dist/es/standards-sdk.es14.js +4 -1
  73. package/dist/es/standards-sdk.es14.js.map +1 -1
  74. package/dist/es/standards-sdk.es17.js +1 -1
  75. package/dist/es/standards-sdk.es18.js +3 -3
  76. package/dist/es/standards-sdk.es18.js.map +1 -1
  77. package/dist/es/standards-sdk.es19.js +82 -1754
  78. package/dist/es/standards-sdk.es19.js.map +1 -1
  79. package/dist/es/standards-sdk.es20.js +5 -3
  80. package/dist/es/standards-sdk.es20.js.map +1 -1
  81. package/dist/es/standards-sdk.es21.js +1703 -4103
  82. package/dist/es/standards-sdk.es21.js.map +1 -1
  83. package/dist/es/standards-sdk.es22.js +3 -36
  84. package/dist/es/standards-sdk.es22.js.map +1 -1
  85. package/dist/es/standards-sdk.es23.js +4167 -48
  86. package/dist/es/standards-sdk.es23.js.map +1 -1
  87. package/dist/es/standards-sdk.es24.js +2 -2
  88. package/dist/es/standards-sdk.es25.js +36 -2
  89. package/dist/es/standards-sdk.es25.js.map +1 -1
  90. package/dist/es/standards-sdk.es26.js +46 -1039
  91. package/dist/es/standards-sdk.es26.js.map +1 -1
  92. package/dist/es/standards-sdk.es27.js +2 -5
  93. package/dist/es/standards-sdk.es27.js.map +1 -1
  94. package/dist/es/standards-sdk.es28.js +1034 -94
  95. package/dist/es/standards-sdk.es28.js.map +1 -1
  96. package/dist/es/standards-sdk.es29.js +419 -2
  97. package/dist/es/standards-sdk.es29.js.map +1 -1
  98. package/dist/es/standards-sdk.es30.js +2 -16
  99. package/dist/es/standards-sdk.es30.js.map +1 -1
  100. package/dist/es/standards-sdk.es31.js +106 -395
  101. package/dist/es/standards-sdk.es31.js.map +1 -1
  102. package/dist/es/standards-sdk.es32.js +3 -2282
  103. package/dist/es/standards-sdk.es32.js.map +1 -1
  104. package/dist/es/standards-sdk.es34.js +3 -363
  105. package/dist/es/standards-sdk.es34.js.map +1 -1
  106. package/dist/es/standards-sdk.es35.js +100 -5
  107. package/dist/es/standards-sdk.es35.js.map +1 -1
  108. package/dist/es/standards-sdk.es36.js +2 -179
  109. package/dist/es/standards-sdk.es36.js.map +1 -1
  110. package/dist/es/standards-sdk.es37.js +15 -80
  111. package/dist/es/standards-sdk.es37.js.map +1 -1
  112. package/dist/es/standards-sdk.es38.js +400 -105
  113. package/dist/es/standards-sdk.es38.js.map +1 -1
  114. package/dist/es/standards-sdk.es39.js +2282 -52
  115. package/dist/es/standards-sdk.es39.js.map +1 -1
  116. package/dist/es/standards-sdk.es4.js +1 -1
  117. package/dist/es/standards-sdk.es40.js +364 -10
  118. package/dist/es/standards-sdk.es40.js.map +1 -1
  119. package/dist/es/standards-sdk.es41.js +5 -96
  120. package/dist/es/standards-sdk.es41.js.map +1 -1
  121. package/dist/es/standards-sdk.es42.js +178 -3
  122. package/dist/es/standards-sdk.es42.js.map +1 -1
  123. package/dist/es/standards-sdk.es43.js +81 -2
  124. package/dist/es/standards-sdk.es43.js.map +1 -1
  125. package/dist/es/standards-sdk.es44.js +104 -103
  126. package/dist/es/standards-sdk.es44.js.map +1 -1
  127. package/dist/es/standards-sdk.es45.js +49 -71
  128. package/dist/es/standards-sdk.es45.js.map +1 -1
  129. package/dist/es/standards-sdk.es46.js +9 -5
  130. package/dist/es/standards-sdk.es46.js.map +1 -1
  131. package/dist/es/standards-sdk.es47.js +96 -4
  132. package/dist/es/standards-sdk.es47.js.map +1 -1
  133. package/dist/es/standards-sdk.es48.js +3 -220
  134. package/dist/es/standards-sdk.es48.js.map +1 -1
  135. package/dist/es/standards-sdk.es49.js +2 -58
  136. package/dist/es/standards-sdk.es49.js.map +1 -1
  137. package/dist/es/standards-sdk.es5.js +393 -891
  138. package/dist/es/standards-sdk.es5.js.map +1 -1
  139. package/dist/es/standards-sdk.es50.js +112 -68
  140. package/dist/es/standards-sdk.es50.js.map +1 -1
  141. package/dist/es/standards-sdk.es51.js +74 -3
  142. package/dist/es/standards-sdk.es51.js.map +1 -1
  143. package/dist/es/standards-sdk.es52.js +5 -31
  144. package/dist/es/standards-sdk.es52.js.map +1 -1
  145. package/dist/es/standards-sdk.es53.js +4 -62
  146. package/dist/es/standards-sdk.es53.js.map +1 -1
  147. package/dist/es/standards-sdk.es54.js +217 -46
  148. package/dist/es/standards-sdk.es54.js.map +1 -1
  149. package/dist/es/standards-sdk.es55.js +57 -9
  150. package/dist/es/standards-sdk.es55.js.map +1 -1
  151. package/dist/es/standards-sdk.es56.js +68 -64
  152. package/dist/es/standards-sdk.es56.js.map +1 -1
  153. package/dist/es/standards-sdk.es57.js +32 -6
  154. package/dist/es/standards-sdk.es57.js.map +1 -1
  155. package/dist/es/standards-sdk.es58.js +61 -13
  156. package/dist/es/standards-sdk.es58.js.map +1 -1
  157. package/dist/es/standards-sdk.es59.js +50 -7
  158. package/dist/es/standards-sdk.es59.js.map +1 -1
  159. package/dist/es/standards-sdk.es60.js +10 -45
  160. package/dist/es/standards-sdk.es60.js.map +1 -1
  161. package/dist/es/standards-sdk.es61.js +65 -2
  162. package/dist/es/standards-sdk.es61.js.map +1 -1
  163. package/dist/es/standards-sdk.es62.js +5 -135
  164. package/dist/es/standards-sdk.es62.js.map +1 -1
  165. package/dist/es/standards-sdk.es63.js +13 -170
  166. package/dist/es/standards-sdk.es63.js.map +1 -1
  167. package/dist/es/standards-sdk.es64.js +4 -10
  168. package/dist/es/standards-sdk.es64.js.map +1 -1
  169. package/dist/es/standards-sdk.es65.js +45 -13
  170. package/dist/es/standards-sdk.es65.js.map +1 -1
  171. package/dist/es/standards-sdk.es66.js +2 -4
  172. package/dist/es/standards-sdk.es66.js.map +1 -1
  173. package/dist/es/standards-sdk.es67.js +134 -30
  174. package/dist/es/standards-sdk.es67.js.map +1 -1
  175. package/dist/es/standards-sdk.es68.js +171 -14
  176. package/dist/es/standards-sdk.es68.js.map +1 -1
  177. package/dist/es/standards-sdk.es69.js +13 -4
  178. package/dist/es/standards-sdk.es69.js.map +1 -1
  179. package/dist/es/standards-sdk.es7.js +959 -94
  180. package/dist/es/standards-sdk.es7.js.map +1 -1
  181. package/dist/es/standards-sdk.es70.js +13 -4
  182. package/dist/es/standards-sdk.es70.js.map +1 -1
  183. package/dist/es/standards-sdk.es71.js +31 -15
  184. package/dist/es/standards-sdk.es71.js.map +1 -1
  185. package/dist/es/standards-sdk.es72.js +14 -4
  186. package/dist/es/standards-sdk.es72.js.map +1 -1
  187. package/dist/es/standards-sdk.es73.js +4 -39
  188. package/dist/es/standards-sdk.es73.js.map +1 -1
  189. package/dist/es/standards-sdk.es74.js +4 -40
  190. package/dist/es/standards-sdk.es74.js.map +1 -1
  191. package/dist/es/standards-sdk.es75.js +15 -36
  192. package/dist/es/standards-sdk.es75.js.map +1 -1
  193. package/dist/es/standards-sdk.es76.js +5 -78
  194. package/dist/es/standards-sdk.es76.js.map +1 -1
  195. package/dist/es/standards-sdk.es77.js +39 -3
  196. package/dist/es/standards-sdk.es77.js.map +1 -1
  197. package/dist/es/standards-sdk.es78.js +40 -2
  198. package/dist/es/standards-sdk.es78.js.map +1 -1
  199. package/dist/es/standards-sdk.es79.js +37 -2
  200. package/dist/es/standards-sdk.es79.js.map +1 -1
  201. package/dist/es/standards-sdk.es8.js +1049 -393
  202. package/dist/es/standards-sdk.es8.js.map +1 -1
  203. package/dist/es/standards-sdk.es80.js +67 -408
  204. package/dist/es/standards-sdk.es80.js.map +1 -1
  205. package/dist/es/standards-sdk.es81.js +3 -2
  206. package/dist/es/standards-sdk.es81.js.map +1 -1
  207. package/dist/es/standards-sdk.es82.js +2 -120
  208. package/dist/es/standards-sdk.es82.js.map +1 -1
  209. package/dist/es/standards-sdk.es83.js +2 -34
  210. package/dist/es/standards-sdk.es83.js.map +1 -1
  211. package/dist/es/standards-sdk.es84.js +30 -29
  212. package/dist/es/standards-sdk.es84.js.map +1 -1
  213. package/dist/es/standards-sdk.es85.js +33 -9
  214. package/dist/es/standards-sdk.es85.js.map +1 -1
  215. package/dist/es/standards-sdk.es86.js +9 -34
  216. package/dist/es/standards-sdk.es86.js.map +1 -1
  217. package/dist/es/standards-sdk.es87.js +34 -2
  218. package/dist/es/standards-sdk.es87.js.map +1 -1
  219. package/dist/es/standards-sdk.es88.js +2 -84
  220. package/dist/es/standards-sdk.es88.js.map +1 -1
  221. package/dist/es/standards-sdk.es89.js +82 -21
  222. package/dist/es/standards-sdk.es89.js.map +1 -1
  223. package/dist/es/standards-sdk.es9.js +2 -2
  224. package/dist/es/standards-sdk.es9.js.map +1 -1
  225. package/dist/es/standards-sdk.es90.js +21 -146
  226. package/dist/es/standards-sdk.es90.js.map +1 -1
  227. package/dist/es/standards-sdk.es91.js +130 -73
  228. package/dist/es/standards-sdk.es91.js.map +1 -1
  229. package/dist/es/standards-sdk.es92.js +81 -185
  230. package/dist/es/standards-sdk.es92.js.map +1 -1
  231. package/dist/es/standards-sdk.es93.js +163 -406
  232. package/dist/es/standards-sdk.es93.js.map +1 -1
  233. package/dist/es/standards-sdk.es94.js +432 -19
  234. package/dist/es/standards-sdk.es94.js.map +1 -1
  235. package/dist/es/standards-sdk.es95.js +16 -130
  236. package/dist/es/standards-sdk.es95.js.map +1 -1
  237. package/dist/es/standards-sdk.es96.js +131 -10
  238. package/dist/es/standards-sdk.es96.js.map +1 -1
  239. package/dist/es/standards-sdk.es97.js +11 -22
  240. package/dist/es/standards-sdk.es97.js.map +1 -1
  241. package/dist/es/standards-sdk.es98.js +22 -22
  242. package/dist/es/standards-sdk.es98.js.map +1 -1
  243. package/dist/es/standards-sdk.es99.js +21 -13
  244. package/dist/es/standards-sdk.es99.js.map +1 -1
  245. package/dist/es/utils/logger.d.ts +1 -0
  246. package/dist/es/utils/logger.d.ts.map +1 -1
  247. package/dist/es/utils/types.d.ts +2 -0
  248. package/dist/es/utils/types.d.ts.map +1 -0
  249. package/dist/umd/fees/fee-config-builder.d.ts.map +1 -0
  250. package/dist/umd/fees/index.d.ts +3 -0
  251. package/dist/umd/fees/index.d.ts.map +1 -0
  252. package/dist/umd/fees/types.d.ts +24 -0
  253. package/dist/umd/fees/types.d.ts.map +1 -0
  254. package/dist/umd/hcs-10/base-client.d.ts +1 -1
  255. package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
  256. package/dist/umd/hcs-10/browser.d.ts +20 -35
  257. package/dist/umd/hcs-10/browser.d.ts.map +1 -1
  258. package/dist/umd/hcs-10/index.d.ts +4 -6
  259. package/dist/umd/hcs-10/index.d.ts.map +1 -1
  260. package/dist/umd/hcs-10/registrations.d.ts.map +1 -1
  261. package/dist/umd/hcs-10/sdk.d.ts +16 -8
  262. package/dist/umd/hcs-10/sdk.d.ts.map +1 -1
  263. package/dist/umd/hcs-10/types.d.ts +2 -62
  264. package/dist/umd/hcs-10/types.d.ts.map +1 -1
  265. package/dist/umd/hcs-11/agent-builder.d.ts +53 -0
  266. package/dist/umd/hcs-11/agent-builder.d.ts.map +1 -0
  267. package/dist/umd/hcs-11/client.d.ts +82 -0
  268. package/dist/umd/hcs-11/client.d.ts.map +1 -0
  269. package/dist/umd/hcs-11/index.d.ts +4 -190
  270. package/dist/umd/hcs-11/index.d.ts.map +1 -1
  271. package/dist/umd/hcs-11/person-builder.d.ts +29 -0
  272. package/dist/umd/hcs-11/person-builder.d.ts.map +1 -0
  273. package/dist/umd/hcs-11/types.d.ts +165 -0
  274. package/dist/umd/hcs-11/types.d.ts.map +1 -0
  275. package/dist/umd/index.d.ts +1 -0
  276. package/dist/umd/index.d.ts.map +1 -1
  277. package/dist/umd/services/mirror-node.d.ts +2 -1
  278. package/dist/umd/services/mirror-node.d.ts.map +1 -1
  279. package/dist/umd/services/types.d.ts +0 -1
  280. package/dist/umd/services/types.d.ts.map +1 -1
  281. package/dist/umd/standards-sdk.umd.js +7 -7
  282. package/dist/umd/standards-sdk.umd.js.map +1 -1
  283. package/dist/umd/utils/logger.d.ts +1 -0
  284. package/dist/umd/utils/logger.d.ts.map +1 -1
  285. package/dist/umd/utils/types.d.ts +2 -0
  286. package/dist/umd/utils/types.d.ts.map +1 -0
  287. package/package.json +6 -4
  288. package/dist/es/hcs-10/agent-builder.d.ts +0 -45
  289. package/dist/es/hcs-10/agent-builder.d.ts.map +0 -1
  290. package/dist/es/hcs-10/fee-config-builder.d.ts.map +0 -1
  291. package/dist/umd/hcs-10/agent-builder.d.ts +0 -45
  292. package/dist/umd/hcs-10/agent-builder.d.ts.map +0 -1
  293. package/dist/umd/hcs-10/fee-config-builder.d.ts.map +0 -1
  294. /package/dist/es/{hcs-10 → fees}/fee-config-builder.d.ts +0 -0
  295. /package/dist/umd/{hcs-10 → fees}/fee-config-builder.d.ts +0 -0
@@ -1,987 +1,489 @@
1
- import Buffer from "./standards-sdk.es19.js";
2
- import { Client, PrivateKey, AccountCreateTransaction, Hbar, CustomFixedFee, AccountId, KeyList, TopicCreateTransaction, PublicKey, TopicMessageSubmitTransaction, TopicId, Transaction } from "@hashgraph/sdk";
3
- import { AccountCreationError, TopicCreationError, ConnectionConfirmationError, PayloadSizeError } from "./standards-sdk.es6.js";
4
- import { InscriptionSDK } from "./standards-sdk.es24.js";
1
+ import Buffer from "./standards-sdk.es21.js";
5
2
  import { Logger } from "./standards-sdk.es14.js";
6
- import { HCS10BaseClient, Hcs10MemoType } from "./standards-sdk.es8.js";
7
- import { m as mimeTypesExports } from "./standards-sdk.es20.js";
8
- import { InboundTopicType } from "./standards-sdk.es12.js";
9
- import { HCS11Client } from "./standards-sdk.es13.js";
10
- import { accountIdsToExemptKeys } from "./standards-sdk.es15.js";
11
- class HCS10Client extends HCS10BaseClient {
3
+ import { Registration } from "./standards-sdk.es9.js";
4
+ import { HCS11Client } from "./standards-sdk.es12.js";
5
+ import { PublicKey } from "@hashgraph/sdk";
6
+ import "./standards-sdk.es25.js";
7
+ import { HederaMirrorNode } from "./standards-sdk.es18.js";
8
+ import axios from "./standards-sdk.es26.js";
9
+ var Hcs10MemoType = /* @__PURE__ */ ((Hcs10MemoType2) => {
10
+ Hcs10MemoType2["INBOUND"] = "inbound";
11
+ Hcs10MemoType2["OUTBOUND"] = "outbound";
12
+ Hcs10MemoType2["CONNECTION"] = "connection";
13
+ return Hcs10MemoType2;
14
+ })(Hcs10MemoType || {});
15
+ class HCS10BaseClient extends Registration {
12
16
  constructor(config) {
13
- super({
14
- network: config.network,
15
- logLevel: config.logLevel,
16
- prettyPrint: config.prettyPrint,
17
- feeAmount: config.feeAmount
18
- });
19
- this.client = config.network === "mainnet" ? Client.forMainnet() : Client.forTestnet();
20
- this.operatorPrivateKey = PrivateKey.fromString(config.operatorPrivateKey);
17
+ super();
21
18
  this.network = config.network;
22
- this.client.setOperator(
23
- config.operatorId,
24
- this.operatorPrivateKey.toString()
25
- );
26
19
  this.logger = Logger.getInstance({
27
20
  level: config.logLevel || "info",
28
- module: "HCS-SDK"
29
- });
30
- this.guardedRegistryBaseUrl = config.guardedRegistryBaseUrl || "https://moonscape.tech";
31
- this.hcs11Client = new HCS11Client({
32
- network: config.network,
33
- auth: {
34
- operatorId: config.operatorId,
35
- privateKey: config.operatorPrivateKey
36
- },
37
- logLevel: config.logLevel
21
+ module: "HCS10-BaseClient",
22
+ prettyPrint: config.prettyPrint
38
23
  });
39
- }
40
- getClient() {
41
- return this.client;
42
- }
43
- /**
44
- * Creates a new Hedera account
45
- * @returns Object with account ID and private key
46
- */
47
- async createAccount() {
48
- this.logger.info("Creating new account");
49
- const newKey = PrivateKey.generate();
50
- const accountTransaction = new AccountCreateTransaction().setKey(newKey.publicKey).setInitialBalance(new Hbar(10));
51
- this.logger.debug("Executing account creation transaction");
52
- const accountResponse = await accountTransaction.execute(this.client);
53
- const accountReceipt = await accountResponse.getReceipt(this.client);
54
- const newAccountId = accountReceipt.accountId;
55
- if (!newAccountId) {
56
- this.logger.error("Account creation failed: accountId is null");
57
- throw new AccountCreationError(
58
- "Failed to create account: accountId is null"
59
- );
60
- }
61
- this.logger.info(
62
- `Account created successfully: ${newAccountId.toString()}`
24
+ this.mirrorNode = new HederaMirrorNode(
25
+ config.network,
26
+ this.logger
63
27
  );
64
- return {
65
- accountId: newAccountId.toString(),
66
- privateKey: newKey.toString()
67
- };
28
+ this.feeAmount = config.feeAmount || 1e-3;
68
29
  }
69
30
  /**
70
- * Creates an inbound topic for an agent
71
- * @param accountId The account ID associated with the inbound topic
72
- * @param topicType Type of inbound topic (public, controlled, or fee-based)
73
- * @param ttl Optional Time-To-Live for the topic memo, defaults to 60
74
- * @param feeConfigBuilder Optional fee configuration builder for fee-based topics
75
- * @returns The topic ID of the created inbound topic
31
+ * Get a stream of messages from a connection topic
32
+ * @param topicId The connection topic ID to get messages from
33
+ * @returns A stream of filtered messages valid for connection topics
76
34
  */
77
- async createInboundTopic(accountId, topicType, ttl = 60, feeConfigBuilder) {
78
- const memo = this._generateHcs10Memo(Hcs10MemoType.INBOUND, {
79
- accountId,
80
- ttl
81
- });
82
- let submitKey;
83
- let feeConfig;
84
- switch (topicType) {
85
- case InboundTopicType.PUBLIC:
86
- submitKey = false;
87
- break;
88
- case InboundTopicType.CONTROLLED:
89
- submitKey = true;
90
- break;
91
- case InboundTopicType.FEE_BASED:
92
- submitKey = true;
93
- if (!feeConfigBuilder) {
94
- throw new Error(
95
- "Fee configuration builder is required for fee-based topics"
96
- );
35
+ async getMessageStream(topicId) {
36
+ try {
37
+ const messages = await this.mirrorNode.getTopicMessages(topicId);
38
+ const validOps = ["message", "close_connection"];
39
+ const filteredMessages = messages.filter((msg) => {
40
+ if (msg.p !== "hcs-10" || !validOps.includes(msg.op)) {
41
+ return false;
97
42
  }
98
- feeConfig = feeConfigBuilder.build();
99
- break;
100
- default:
101
- throw new Error(`Unsupported inbound topic type: ${topicType}`);
102
- }
103
- return this.createTopic(memo, true, submitKey, feeConfig);
104
- }
105
- /**
106
- * Creates a new agent with inbound and outbound topics
107
- * @param builder The agent builder object
108
- * @param ttl Optional Time-To-Live for the topic memos, defaults to 60
109
- * @returns Object with topic IDs
110
- */
111
- async createAgent(builder, ttl = 60) {
112
- const config = builder.build();
113
- const outboundMemo = this._generateHcs10Memo(Hcs10MemoType.OUTBOUND, {
114
- ttl
115
- });
116
- const outboundTopicId = await this.createTopic(outboundMemo, true, true);
117
- this.logger.info(`Created new outbound topic ID: ${outboundTopicId}`);
118
- const accountId = this.client.operatorAccountId?.toString();
119
- if (!accountId) {
120
- throw new Error("Failed to retrieve operator account ID");
121
- }
122
- const inboundTopicId = await this.createInboundTopic(
123
- accountId,
124
- config.inboundTopicType,
125
- ttl,
126
- config.inboundTopicType === InboundTopicType.FEE_BASED ? config.feeConfig : void 0
127
- );
128
- let pfpTopicId = config.existingPfpTopicId || "";
129
- if (!pfpTopicId && config.pfpBuffer && config.pfpBuffer.length > 0) {
130
- this.logger.info("Inscribing new profile picture");
131
- const pfpResult = await this.inscribePfp(
132
- config.pfpBuffer,
133
- config.pfpFileName
134
- );
135
- pfpTopicId = pfpResult.pfpTopicId;
136
- this.logger.info(
137
- `Profile picture inscribed with topic ID: ${pfpTopicId}`
138
- );
139
- } else if (config.existingPfpTopicId) {
140
- this.logger.info(
141
- `Using existing profile picture with topic ID: ${config.existingPfpTopicId}`
142
- );
43
+ if (msg.op === "message") {
44
+ if (!msg.data) {
45
+ return false;
46
+ }
47
+ if (!msg.operator_id) {
48
+ return false;
49
+ }
50
+ if (!this.isValidOperatorId(msg.operator_id)) {
51
+ return false;
52
+ }
53
+ }
54
+ if (msg.op === "close_connection") {
55
+ if (!msg.operator_id) {
56
+ return false;
57
+ }
58
+ if (!this.isValidOperatorId(msg.operator_id)) {
59
+ return false;
60
+ }
61
+ }
62
+ return true;
63
+ });
64
+ return {
65
+ messages: filteredMessages
66
+ };
67
+ } catch (error) {
68
+ if (this.logger) {
69
+ this.logger.error(`Error fetching messages: ${error.message}`);
70
+ }
71
+ return { messages: [] };
143
72
  }
144
- const profileResult = await this.storeHCS11Profile(
145
- config.name,
146
- config.description,
147
- inboundTopicId,
148
- outboundTopicId,
149
- config.capabilities,
150
- config.metadata,
151
- config.pfpBuffer && config.pfpBuffer.length > 0 ? config.pfpBuffer : void 0,
152
- config.pfpFileName,
153
- config.existingPfpTopicId
154
- );
155
- const profileTopicId = profileResult.profileTopicId;
156
- this.logger.info(`Profile stored with topic ID: ${profileTopicId}`);
157
- return {
158
- inboundTopicId,
159
- outboundTopicId,
160
- pfpTopicId,
161
- profileTopicId
162
- };
163
73
  }
164
74
  /**
165
- * Inscribes a profile picture to Hedera
166
- * @param buffer Profile picture buffer
167
- * @param fileName Filename
168
- * @returns Response with topic ID and transaction ID
75
+ * Checks if a user can submit to a topic and determines if a fee is required
76
+ * @param topicId The topic ID to check
77
+ * @param userAccountId The account ID of the user attempting to submit
78
+ * @returns Object with canSubmit, requiresFee, and optional reason
169
79
  */
170
- async inscribePfp(buffer, fileName) {
80
+ async canSubmitToTopic(topicId, userAccountId) {
171
81
  try {
172
- this.logger.info("Inscribing profile picture using HCS-11 client");
173
- const imageResult = await this.hcs11Client.inscribeImage(
174
- buffer,
175
- fileName
176
- );
177
- if (!imageResult.success) {
82
+ const topicInfo = await this.mirrorNode.getTopicInfo(topicId);
83
+ if (!topicInfo) {
84
+ return {
85
+ canSubmit: false,
86
+ requiresFee: false,
87
+ reason: "Topic does not exist"
88
+ };
89
+ }
90
+ if (!topicInfo.submit_key?.key) {
91
+ return { canSubmit: true, requiresFee: false };
92
+ }
93
+ try {
94
+ const userPublicKey = await this.mirrorNode.getPublicKey(userAccountId);
95
+ if (topicInfo.submit_key._type === "ProtobufEncoded") {
96
+ const keyBytes = Buffer.from(topicInfo.submit_key.key, "hex");
97
+ const hasAccess = await this.mirrorNode.checkKeyListAccess(
98
+ keyBytes,
99
+ userPublicKey
100
+ );
101
+ if (hasAccess) {
102
+ return { canSubmit: true, requiresFee: false };
103
+ }
104
+ } else {
105
+ const topicSubmitKey = PublicKey.fromString(topicInfo.submit_key.key);
106
+ if (userPublicKey.toString() === topicSubmitKey.toString()) {
107
+ return { canSubmit: true, requiresFee: false };
108
+ }
109
+ }
110
+ } catch (error) {
178
111
  this.logger.error(
179
- `Failed to inscribe profile picture: ${imageResult.error}`
180
- );
181
- throw new Error(
182
- imageResult?.error || "Failed to inscribe profile picture"
112
+ `Key validation error: ${error instanceof Error ? error.message : String(error)}`
183
113
  );
184
114
  }
185
- this.logger.info(
186
- `Successfully inscribed profile picture with topic ID: ${imageResult.imageTopicId}`
187
- );
115
+ if (topicInfo.fee_schedule_key?.key && topicInfo.custom_fees?.fixed_fees?.length > 0) {
116
+ return {
117
+ canSubmit: true,
118
+ requiresFee: true,
119
+ reason: "Requires fee payment via HIP-991"
120
+ };
121
+ }
188
122
  return {
189
- pfpTopicId: imageResult.imageTopicId,
190
- transactionId: imageResult.transactionId,
191
- success: true
123
+ canSubmit: false,
124
+ requiresFee: false,
125
+ reason: "User does not have submit permission for this topic"
192
126
  };
193
127
  } catch (error) {
194
- this.logger.error(`Error inscribing profile picture: ${error.message}`);
128
+ const errorMessage = error instanceof Error ? error.message : String(error);
129
+ this.logger.error(`Topic submission validation error: ${errorMessage}`);
195
130
  return {
196
- pfpTopicId: "",
197
- transactionId: "",
198
- success: false,
199
- error: error.message
131
+ canSubmit: false,
132
+ requiresFee: false,
133
+ reason: `Error: ${errorMessage}`
200
134
  };
201
135
  }
202
136
  }
203
137
  /**
204
- * Stores an HCS-11 profile for an agent
205
- * @param agentName Agent name
206
- * @param agentDescription Agent description
207
- * @param inboundTopicId Inbound topic ID
208
- * @param outboundTopicId Outbound topic ID
209
- * @param capabilities Agent capability tags
210
- * @param metadata Additional metadata
211
- * @param pfpBuffer Optional profile picture buffer
212
- * @param pfpFileName Optional profile picture filename
213
- * @returns Response with topic IDs and transaction ID
138
+ * Get all messages from a topic
139
+ * @param topicId The topic ID to get messages from
140
+ * @returns All messages from the topic
214
141
  */
215
- async storeHCS11Profile(agentName, agentDescription, inboundTopicId, outboundTopicId, capabilities = [], metadata, pfpBuffer, pfpFileName, existingPfpTopicId) {
142
+ async getMessages(topicId) {
216
143
  try {
217
- let pfpTopicId = existingPfpTopicId || "";
218
- if (!pfpTopicId && pfpBuffer && pfpFileName) {
219
- this.logger.info("Inscribing profile picture for HCS-11 profile");
220
- const pfpResult = await this.inscribePfp(pfpBuffer, pfpFileName);
221
- if (!pfpResult.success) {
222
- this.logger.error(
223
- "Failed to inscribe profile picture, continuing without PFP"
224
- );
225
- } else {
226
- pfpTopicId = pfpResult.pfpTopicId;
144
+ const messages = await this.mirrorNode.getTopicMessages(topicId);
145
+ const validatedMessages = messages.filter((msg) => {
146
+ if (msg.p !== "hcs-10") {
147
+ return false;
227
148
  }
228
- } else if (existingPfpTopicId) {
229
- this.logger.info(
230
- `Using existing profile picture with topic ID: ${existingPfpTopicId} for HCS-11 profile`
231
- );
149
+ if (msg.op === "message") {
150
+ if (!msg.data) {
151
+ return false;
152
+ }
153
+ if (msg.operator_id) {
154
+ if (!this.isValidOperatorId(msg.operator_id)) {
155
+ return false;
156
+ }
157
+ }
158
+ }
159
+ return true;
160
+ });
161
+ return {
162
+ messages: validatedMessages
163
+ };
164
+ } catch (error) {
165
+ if (this.logger) {
166
+ this.logger.error(`Error fetching messages: ${error.message}`);
232
167
  }
233
- const agentType = this.hcs11Client.getAgentTypeFromMetadata({
234
- type: metadata.type || "autonomous"
168
+ return { messages: [] };
169
+ }
170
+ }
171
+ async requestAccount(account) {
172
+ try {
173
+ return await this.mirrorNode.requestAccount(account);
174
+ } catch (e) {
175
+ this.logger.error("Failed to fetch account", e);
176
+ throw e;
177
+ }
178
+ }
179
+ async getAccountMemo(accountId) {
180
+ return await this.mirrorNode.getAccountMemo(accountId);
181
+ }
182
+ async retrieveProfile(accountId) {
183
+ this.logger.info(`Retrieving profile for account: ${accountId}`);
184
+ try {
185
+ const hcs11Client = new HCS11Client({
186
+ network: this.network,
187
+ auth: {
188
+ operatorId: "0.0.0"
189
+ // Read-only operations only
190
+ },
191
+ logLevel: "info"
235
192
  });
236
- const formattedSocials = metadata.socials ? Object.entries(metadata.socials).filter(([_, handle]) => handle).map(([platform, handle]) => ({
237
- platform: platform === "x" ? "twitter" : platform,
238
- handle
239
- })) : void 0;
240
- const profile = this.hcs11Client.createAIAgentProfile(
241
- agentName,
242
- agentType,
243
- capabilities,
244
- metadata.model || "unknown",
245
- {
246
- alias: agentName.toLowerCase().replace(/\s+/g, "_"),
247
- bio: agentDescription,
248
- profileImage: pfpTopicId ? `hcs://1/${pfpTopicId}` : void 0,
249
- socials: formattedSocials,
250
- properties: metadata.properties,
251
- inboundTopicId,
252
- outboundTopicId,
253
- creator: metadata.creator
254
- }
255
- );
256
- const profileResult = await this.hcs11Client.createAndInscribeProfile(
257
- profile,
258
- true
193
+ const profileResult = await hcs11Client.fetchProfileByAccountId(
194
+ accountId,
195
+ this.network
259
196
  );
260
- if (!profileResult.success) {
261
- this.logger.error(`Failed to inscribe profile: ${profileResult.error}`);
262
- throw new Error(profileResult.error || "Failed to inscribe profile");
197
+ if (!profileResult?.success) {
198
+ this.logger.error(
199
+ `Failed to retrieve profile for account ID: ${accountId}`,
200
+ profileResult?.error
201
+ );
202
+ return {
203
+ profile: null,
204
+ success: false,
205
+ error: profileResult?.error || `Failed to retrieve profile for account ID: ${accountId}`
206
+ };
207
+ }
208
+ const profile = profileResult.profile;
209
+ let topicInfo = null;
210
+ if (profileResult.topicInfo?.inboundTopic && profileResult.topicInfo?.outboundTopic && profileResult.topicInfo?.profileTopicId) {
211
+ topicInfo = {
212
+ inboundTopic: profileResult.topicInfo.inboundTopic,
213
+ outboundTopic: profileResult.topicInfo.outboundTopic,
214
+ profileTopicId: profileResult.topicInfo.profileTopicId
215
+ };
216
+ const cacheKey = `${accountId}-${this.network}`;
217
+ HCS10Cache.getInstance().set(cacheKey, topicInfo);
263
218
  }
264
- this.logger.info(
265
- `Profile inscribed with topic ID: ${profileResult.profileTopicId}, transaction ID: ${profileResult.transactionId}`
266
- );
267
219
  return {
268
- profileTopicId: profileResult.profileTopicId,
269
- pfpTopicId,
270
- transactionId: profileResult.transactionId,
220
+ profile,
221
+ topicInfo,
271
222
  success: true
272
223
  };
273
224
  } catch (error) {
274
- this.logger.error(`Error storing HCS-11 profile: ${error.message}`);
225
+ this.logger.error("Failed to retrieve profile:", error);
275
226
  return {
276
- profileTopicId: "",
277
- pfpTopicId: "",
278
- transactionId: "",
227
+ profile: null,
279
228
  success: false,
280
- error: error.message
229
+ error: error instanceof Error ? error.message : String(error)
281
230
  };
282
231
  }
283
232
  }
284
- async setupFees(transaction, feeConfig, additionalExemptAccounts = []) {
285
- if (!this.client.operatorPublicKey) {
286
- return;
287
- }
288
- this.logger.info("Setting up topic with custom fees");
289
- const customFee = new CustomFixedFee().setAmount(Number(feeConfig.feeAmount.amount)).setFeeCollectorAccountId(
290
- AccountId.fromString(feeConfig.feeCollectorAccountId)
291
- );
292
- let exemptAccountIds = [
293
- ...feeConfig.exemptAccounts || [],
294
- ...additionalExemptAccounts
295
- ];
296
- console.log("exemptAccountIds", exemptAccountIds);
297
- if (exemptAccountIds.length > 0) {
298
- const uniqueExemptAccountIds = Array.from(new Set(exemptAccountIds));
299
- const filteredExemptAccounts = uniqueExemptAccountIds.filter(
300
- (account) => account !== this.client.operatorAccountId?.toString()
301
- );
302
- let exemptKeys = [];
303
- if (filteredExemptAccounts.length > 0) {
304
- try {
305
- exemptKeys = await accountIdsToExemptKeys(
306
- filteredExemptAccounts,
307
- this.network,
308
- this.logger
309
- );
310
- } catch (error) {
311
- this.logger.warn(
312
- `Error getting exempt keys: ${error}, continuing without exempt keys`
313
- );
314
- }
233
+ async retrieveOutboundConnectTopic(accountId) {
234
+ this.logger.info(`Retrieving topics for account: ${accountId}`);
235
+ try {
236
+ const profileResponse = await this.retrieveProfile(accountId);
237
+ if (!profileResponse?.success) {
238
+ throw new Error(profileResponse.error || "Failed to retrieve profile");
315
239
  }
316
- if (exemptKeys.length > 0) {
317
- transaction.setFeeExemptKeys(exemptKeys);
240
+ const profile = profileResponse.profile;
241
+ if (!profile.inboundTopicId || !profile.outboundTopicId) {
242
+ throw new Error(
243
+ `Invalid HCS-11 profile for HCS-10 agent: missing inboundTopicId or outboundTopicId`
244
+ );
318
245
  }
246
+ const topicInfo = {
247
+ inboundTopic: profile.inboundTopicId,
248
+ outboundTopic: profile.outboundTopicId,
249
+ profileTopicId: profile.profileTopicId
250
+ };
251
+ const cacheKey = `${accountId}-${this.network}`;
252
+ HCS10Cache.getInstance().set(cacheKey, topicInfo);
253
+ return topicInfo;
254
+ } catch (error) {
255
+ this.logger.error("Failed to retrieve topic info:", error);
256
+ throw error;
319
257
  }
320
- transaction.setFeeScheduleKey(this.client.operatorPublicKey).setCustomFees([customFee]);
321
258
  }
322
- /**
323
- * Handles a connection request from another account
324
- * @param inboundTopicId Inbound topic ID
325
- * @param requestingAccountId Requesting account ID
326
- * @param connectionRequestId Connection request ID
327
- * @param connectionFeeConfig Optional fee configuration for the connection topic
328
- * @param ttl Optional ttl parameter with default
329
- * @returns Response with connection details
330
- */
331
- async handleConnectionRequest(inboundTopicId, requestingAccountId, connectionRequestId, connectionFeeConfig, ttl = 60) {
332
- const memo = this._generateHcs10Memo(Hcs10MemoType.CONNECTION, {
333
- ttl,
334
- inboundTopicId,
335
- connectionId: connectionRequestId
336
- });
337
- this.logger.info(
338
- `Handling connection request ${connectionRequestId} from ${requestingAccountId}`
339
- );
340
- const accountId = this.getClient().operatorAccountId?.toString();
341
- if (!accountId) {
342
- throw new Error("Failed to retrieve operator account ID");
343
- }
344
- let requesterKey = await this.mirrorNode.getPublicKey(requestingAccountId);
345
- const accountKey = await this.mirrorNode.getPublicKey(accountId);
346
- if (!accountKey) {
347
- throw new Error("Failed to retrieve public key");
348
- }
349
- const thresholdKey = new KeyList([accountKey, requesterKey], 1);
350
- let connectionTopicId;
259
+ async retrieveOutboundMessages(agentAccountId) {
351
260
  try {
352
- if (connectionFeeConfig) {
353
- const feeConfig = connectionFeeConfig.build();
354
- const modifiedFeeConfig = {
355
- ...feeConfig,
356
- exemptAccounts: [...feeConfig.exemptAccounts || []]
357
- };
358
- connectionTopicId = await this.createTopic(
359
- memo,
360
- thresholdKey,
361
- thresholdKey,
362
- modifiedFeeConfig
363
- );
364
- } else {
365
- connectionTopicId = await this.createTopic(
366
- memo,
367
- thresholdKey,
368
- thresholdKey
261
+ const topicInfo = await this.retrieveOutboundConnectTopic(agentAccountId);
262
+ if (!topicInfo) {
263
+ this.logger.warn(
264
+ `No outbound connect topic found for agentAccountId: ${agentAccountId}`
369
265
  );
266
+ return [];
370
267
  }
371
- this.logger.info(`Created new connection topic ID: ${connectionTopicId}`);
372
- } catch (error) {
373
- this.logger.error(`Failed to create connection topic: ${error}`);
374
- throw new TopicCreationError(
375
- `Failed to create connection topic: ${error}`
268
+ const response = await this.getMessages(topicInfo.outboundTopic);
269
+ return response.messages.filter(
270
+ (msg) => msg.p === "hcs-10" && (msg.op === "connection_request" || msg.op === "connection_created" || msg.op === "message")
376
271
  );
272
+ } catch (error) {
273
+ this.logger.error("Failed to retrieve outbound messages:", error);
274
+ return [];
377
275
  }
378
- const operatorId = `${inboundTopicId}@${accountId}`;
379
- const confirmedConnectionSequenceNumber = await this.confirmConnection(
380
- inboundTopicId,
381
- connectionTopicId,
382
- requestingAccountId,
383
- connectionRequestId,
384
- "Connection accepted. Looking forward to collaborating!"
385
- );
386
- return {
387
- connectionTopicId,
388
- confirmedConnectionSequenceNumber,
389
- operatorId
390
- };
391
276
  }
392
- async confirmConnection(inboundTopicId, connectionTopicId, connectedAccountId, connectionId, memo, submitKey) {
393
- const operatorId = await this.getOperatorId();
394
- this.logger.info(`Confirming connection with ID ${connectionId}`);
395
- const payload = {
396
- p: "hcs-10",
397
- op: "connection_created",
398
- connection_topic_id: connectionTopicId,
399
- connected_account_id: connectedAccountId,
400
- operator_id: operatorId,
401
- connection_id: connectionId,
402
- m: memo
403
- };
404
- const submissionCheck = await this.canSubmitToTopic(
405
- inboundTopicId,
406
- this.client.operatorAccountId?.toString() || ""
407
- );
408
- const result = await this.submitPayload(
409
- inboundTopicId,
410
- payload,
411
- submitKey,
412
- submissionCheck.requiresFee
413
- );
414
- const sequenceNumber = result.topicSequenceNumber?.toNumber();
415
- if (!sequenceNumber) {
416
- throw new ConnectionConfirmationError(
417
- "Failed to confirm connection: sequence number is null"
277
+ async hasConnectionCreated(agentAccountId, connectionId) {
278
+ try {
279
+ const outBoundTopic = await this.retrieveOutboundConnectTopic(
280
+ agentAccountId
418
281
  );
419
- }
420
- return sequenceNumber;
421
- }
422
- async sendMessage(connectionTopicId, data, memo, submitKey) {
423
- const submissionCheck = await this.canSubmitToTopic(
424
- connectionTopicId,
425
- this.client.operatorAccountId?.toString() || ""
426
- );
427
- const operatorId = await this.getOperatorId();
428
- const payload = {
429
- p: "hcs-10",
430
- op: "message",
431
- operator_id: operatorId,
432
- data,
433
- m: memo
434
- };
435
- const payloadString = JSON.stringify(payload);
436
- const isLargePayload = Buffer.from(payloadString).length > 1e3;
437
- if (isLargePayload) {
438
- this.logger.info(
439
- "Message payload exceeds 1000 bytes, storing via inscription"
282
+ const messages = await this.retrieveOutboundMessages(
283
+ outBoundTopic.outboundTopic
440
284
  );
441
- try {
442
- const contentBuffer = Buffer.from(data);
443
- const fileName = `message-${Date.now()}.json`;
444
- const inscriptionResult = await this.inscribeFile(
445
- contentBuffer,
446
- fileName
447
- );
448
- if (inscriptionResult?.topic_id) {
449
- payload.data = `hcs://1/${inscriptionResult.topic_id}`;
450
- this.logger.info(
451
- `Large message inscribed with topic ID: ${inscriptionResult.topic_id}`
452
- );
453
- } else {
454
- throw new Error("Failed to inscribe large message content");
455
- }
456
- } catch (error) {
457
- this.logger.error("Error inscribing large message:", error);
458
- throw new Error(
459
- `Failed to handle large message: ${error instanceof Error ? error.message : "Unknown error"}`
460
- );
461
- }
285
+ return messages.some(
286
+ (msg) => msg.op === "connection_created" && msg.connection_id === connectionId
287
+ );
288
+ } catch (error) {
289
+ this.logger.error("Failed to check connection created:", error);
290
+ return false;
462
291
  }
463
- this.logger.info("Submitting message to connection topic", payload);
464
- return await this.submitPayload(
465
- connectionTopicId,
466
- payload,
467
- submitKey,
468
- submissionCheck.requiresFee
469
- );
470
292
  }
471
- async createTopic(memo, adminKey, submitKey, feeConfig) {
472
- this.logger.info("Creating topic");
473
- const transaction = new TopicCreateTransaction().setTopicMemo(memo);
474
- if (adminKey) {
475
- if (typeof adminKey === "boolean" && adminKey && this.client.operatorPublicKey) {
476
- transaction.setAdminKey(this.client.operatorPublicKey);
477
- transaction.setAutoRenewAccountId(this.client.operatorAccountId);
478
- } else if (adminKey instanceof PublicKey || adminKey instanceof KeyList) {
479
- transaction.setAdminKey(adminKey);
480
- if (this.client.operatorAccountId) {
481
- transaction.setAutoRenewAccountId(this.client.operatorAccountId);
482
- }
483
- }
293
+ /**
294
+ * Gets message content, resolving any HRL references if needed
295
+ * @param data The message data which might be an HRL reference
296
+ * @returns The resolved content
297
+ */
298
+ async getMessageContent(data) {
299
+ const hrlPattern = /^hcs:\/\/(\d+)\/([0-9.]+)$/;
300
+ const match = data.match(hrlPattern);
301
+ if (!match) {
302
+ return data;
484
303
  }
485
- if (submitKey) {
486
- if (typeof submitKey === "boolean" && submitKey && this.client.operatorPublicKey) {
487
- transaction.setSubmitKey(this.client.operatorPublicKey);
488
- } else if (submitKey instanceof PublicKey || submitKey instanceof KeyList) {
489
- transaction.setSubmitKey(submitKey);
304
+ const [_, standard, topicId] = match;
305
+ this.logger.info(
306
+ `Resolving HRL reference: standard=${standard}, topicId=${topicId}`
307
+ );
308
+ try {
309
+ const cdnUrl = `https://kiloscribe.com/api/inscription-cdn/${topicId}?network=${this.network}`;
310
+ const response = await axios.get(cdnUrl);
311
+ if (!response.data) {
312
+ throw new Error(`Failed to fetch content from topic: ${topicId}`);
490
313
  }
491
- }
492
- if (feeConfig) {
493
- await this.setupFees(transaction, feeConfig);
494
- }
495
- this.logger.debug("Executing topic creation transaction");
496
- const txResponse = await transaction.execute(this.client);
497
- const receipt = await txResponse.getReceipt(this.client);
498
- if (!receipt.topicId) {
499
- this.logger.error("Failed to create topic: topicId is null");
500
- throw new Error("Failed to create topic: topicId is null");
501
- }
502
- const topicId = receipt.topicId.toString();
503
- return topicId;
504
- }
505
- async submitPayload(topicId, payload, submitKey, requiresFee = false) {
506
- const message = typeof payload === "string" ? payload : JSON.stringify(payload);
507
- const payloadSizeInBytes = Buffer.byteLength(message, "utf8");
508
- if (payloadSizeInBytes > 1e3) {
509
- throw new PayloadSizeError(
510
- "Payload size exceeds 1000 bytes limit",
511
- payloadSizeInBytes
314
+ return response.data.content || response.data.text || JSON.stringify(response.data);
315
+ } catch (error) {
316
+ this.logger.error(
317
+ `Error resolving HRL reference: ${error instanceof Error ? error.message : "Unknown error"}`
512
318
  );
513
- }
514
- const transaction = new TopicMessageSubmitTransaction().setTopicId(TopicId.fromString(topicId)).setMessage(message);
515
- if (requiresFee) {
516
- this.logger.info(
517
- "Topic requires fee payment, setting max transaction fee"
319
+ throw new Error(
320
+ `Failed to resolve HRL reference: ${error instanceof Error ? error.message : "Unknown error"}`
518
321
  );
519
- transaction.setMaxTransactionFee(new Hbar(this.feeAmount));
520
- transaction.setTransactionMemo("HIP-991 Fee Payment");
521
- }
522
- let transactionResponse;
523
- if (submitKey) {
524
- const frozenTransaction = transaction.freezeWith(this.client);
525
- const signedTransaction = await frozenTransaction.sign(submitKey);
526
- transactionResponse = await signedTransaction.execute(this.client);
527
- } else {
528
- transactionResponse = await transaction.execute(this.client);
529
322
  }
530
- const receipt = await transactionResponse.getReceipt(this.client);
531
- if (!receipt) {
532
- this.logger.error("Failed to submit message: receipt is null");
533
- throw new Error("Failed to submit message: receipt is null");
534
- }
535
- this.logger.info("Message submitted successfully");
536
- return receipt;
537
323
  }
538
- async submitConnectionRequest(inboundTopicId, memo) {
539
- const accountResponse = this.getAccountAndSigner();
540
- if (!accountResponse.accountId) {
541
- throw new Error("Operator account ID is not set");
542
- }
543
- const operatorId = await this.getOperatorId();
544
- const accountId = accountResponse.accountId;
545
- const submissionCheck = await this.canSubmitToTopic(
546
- inboundTopicId,
547
- accountId
548
- );
549
- if (!submissionCheck.canSubmit) {
550
- throw new Error(`Cannot submit to topic: ${submissionCheck.reason}`);
551
- }
552
- const connectionRequestMessage = {
324
+ /**
325
+ * Records an outbound connection confirmation
326
+ * @param outboundTopicId The ID of the outbound topic
327
+ * @param connectionRequestId The ID of the connection request
328
+ * @param confirmedRequestId The ID of the confirmed request
329
+ * @param connectionTopicId The ID of the connection topic
330
+ * @param operatorId The operator ID of the message sender
331
+ * @param memo An optional memo for the message
332
+ */
333
+ async recordOutboundConnectionConfirmation({
334
+ outboundTopicId,
335
+ connectionRequestId,
336
+ confirmedRequestId,
337
+ connectionTopicId,
338
+ operatorId,
339
+ memo
340
+ }) {
341
+ const payload = {
553
342
  p: "hcs-10",
554
- op: "connection_request",
343
+ op: "connection_created",
344
+ connection_topic_id: connectionTopicId,
345
+ outbound_topic_id: outboundTopicId,
346
+ confirmed_request_id: confirmedRequestId,
347
+ connection_request_id: connectionRequestId,
555
348
  operator_id: operatorId,
556
349
  m: memo
557
350
  };
558
- const requiresFee = submissionCheck.requiresFee;
559
- const response = await this.submitPayload(
560
- inboundTopicId,
561
- connectionRequestMessage,
562
- void 0,
563
- requiresFee
564
- );
565
- this.logger.info(
566
- `Submitted connection request to topic ID: ${inboundTopicId}`
567
- );
568
- const outboundTopic = await this.retrieveOutboundConnectTopic(accountId);
569
- const responseSequenceNumber = response.topicSequenceNumber?.toNumber();
570
- if (!responseSequenceNumber) {
571
- throw new Error("Failed to get response sequence number");
572
- }
573
- await this.submitPayload(outboundTopic.outboundTopic, {
574
- ...connectionRequestMessage,
575
- outbound_topic_id: outboundTopic.outboundTopic,
576
- connection_request_id: responseSequenceNumber
577
- });
578
- return response;
351
+ return await this.submitPayload(outboundTopicId, payload);
579
352
  }
580
- async inscribeFile(buffer, fileName) {
581
- this.logger.info("Inscribing file");
582
- if (!this.client.operatorAccountId) {
583
- this.logger.error("Operator account ID is not set");
584
- throw new Error("Operator account ID is not set");
585
- }
586
- if (!this.operatorPrivateKey) {
587
- this.logger.error("Operator private key is not set");
588
- throw new Error("Operator private key is not set");
353
+ async getOperatorId(disableCache) {
354
+ if (this.operatorId && !disableCache) {
355
+ return this.operatorId;
589
356
  }
590
- const mimeType = mimeTypesExports.lookup(fileName) || "application/octet-stream";
591
- const sdk = await InscriptionSDK.createWithAuth({
592
- type: "server",
593
- accountId: this.client.operatorAccountId.toString(),
594
- privateKey: this.operatorPrivateKey.toString(),
595
- network: this.network
596
- });
597
- const result = await sdk.inscribeAndExecute(
598
- {
599
- file: {
600
- type: "base64",
601
- base64: buffer.toString("base64"),
602
- fileName,
603
- mimeType
604
- },
605
- holderId: this.client.operatorAccountId.toString(),
606
- mode: "file",
607
- network: this.network
608
- },
609
- {
610
- accountId: this.client.operatorAccountId.toString(),
611
- privateKey: this.operatorPrivateKey.toString(),
612
- network: this.network
613
- }
614
- );
615
- if (!result.transactionId || !result.jobId) {
616
- this.logger.error("Failed to inscribe, no transaction ID or job ID.");
617
- throw new Error("Failed to inscribe, no transaction ID or job ID.");
357
+ const accountResponse = this.getAccountAndSigner();
358
+ if (!accountResponse.accountId) {
359
+ throw new Error("Operator ID not found");
618
360
  }
619
- if (result.transactionId && result.jobId) {
620
- this.logger.info(
621
- `Transaction ID: ${result.transactionId}, Job ID: ${result.jobId}`
622
- );
361
+ const profile = await this.retrieveProfile(accountResponse.accountId);
362
+ if (!profile.success) {
363
+ throw new Error("Failed to retrieve profile");
623
364
  }
624
- const status = await sdk.waitForInscription(result.jobId, 30, 4e3, true);
625
- return status;
365
+ const operatorId = `${profile.topicInfo?.inboundTopic}@${accountResponse.accountId}`;
366
+ this.operatorId = operatorId;
367
+ return operatorId;
626
368
  }
627
- /**
628
- * Waits for confirmation of a connection request
629
- * @param inboundTopicId Inbound topic ID
630
- * @param connectionRequestId Connection request ID
631
- * @param maxAttempts Maximum number of attempts
632
- * @param delayMs Delay between attempts in milliseconds
633
- * @returns Connection confirmation details
634
- */
635
- async waitForConnectionConfirmation(inboundTopicId, connectionRequestId, maxAttempts = 60, delayMs = 2e3) {
636
- this.logger.info(
637
- `Waiting for connection confirmation on inbound topic ${inboundTopicId} for request ID ${connectionRequestId}`
638
- );
639
- for (let attempt = 0; attempt < maxAttempts; attempt++) {
640
- this.logger.info(
641
- `Attempt ${attempt + 1}/${maxAttempts} to find connection confirmation`
642
- );
643
- const messages = await this.mirrorNode.getTopicMessages(inboundTopicId);
644
- const connectionCreatedMessages = messages.filter(
645
- (m) => m.op === "connection_created"
646
- );
647
- this.logger.info(
648
- `Found ${connectionCreatedMessages.length} connection_created messages`
649
- );
650
- if (connectionCreatedMessages.length > 0) {
651
- for (const message of connectionCreatedMessages) {
652
- if (Number(message.connection_id) === Number(connectionRequestId)) {
653
- this.logger.info("Connection confirmation found");
654
- return {
655
- connectionTopicId: message.connection_topic_id,
656
- sequence_number: Number(message.sequence_number),
657
- confirmedBy: message.operator_id,
658
- memo: message.m
659
- };
660
- }
661
- }
662
- }
663
- if (attempt < maxAttempts - 1) {
664
- this.logger.info(
665
- `No matching confirmation found, waiting ${delayMs}ms before retrying...`
666
- );
667
- await new Promise((resolve) => setTimeout(resolve, delayMs));
668
- }
669
- }
670
- throw new Error(
671
- `Connection confirmation not found after ${maxAttempts} attempts for request ID ${connectionRequestId}`
672
- );
673
- }
674
- getAccountAndSigner() {
675
- return {
676
- accountId: this.client.operatorAccountId.toString(),
677
- signer: this.operatorPrivateKey
678
- };
369
+ clearCache() {
370
+ HCS10Cache.getInstance().clear();
679
371
  }
680
372
  /**
681
- * Creates and registers an agent with a Guarded registry.
682
- *
683
- * This function performs the following steps:
684
- * 1. Creates a new account if no existing account is provided.
685
- * 2. Initializes an HCS10 client with the new account.
686
- * 3. Creates an agent on the client.
687
- * 4. Registers the agent with the Hashgraph Online Guarded Registry.
688
- *
689
- * @param builder The agent builder object
690
- * @param options Optional configuration including progress callback and state management
691
- * @returns Agent registration result
373
+ * Generates a standard HCS-10 memo string.
374
+ * @param type The type of topic memo ('inbound', 'outbound', 'connection').
375
+ * @param options Configuration options for the memo.
376
+ * @returns The formatted memo string.
377
+ * @protected
692
378
  */
693
- async createAndRegisterAgent(builder, options) {
694
- try {
695
- const config = builder.build();
696
- const progressCallback = options?.progressCallback;
697
- const baseUrl = options?.baseUrl || this.guardedRegistryBaseUrl;
698
- let state = options?.existingState || void 0;
699
- if (progressCallback) {
700
- progressCallback({
701
- stage: "preparing",
702
- message: "Preparing agent registration",
703
- progressPercent: 10,
704
- details: { state }
705
- });
706
- }
707
- const account = config.existingAccount || await this.createAccount();
708
- if (progressCallback) {
709
- progressCallback({
710
- stage: "preparing",
711
- message: "Created account or using existing account",
712
- progressPercent: 20,
713
- details: { state, account }
714
- });
715
- }
716
- const agentClient = new HCS10Client({
717
- network: config.network,
718
- operatorId: account.accountId,
719
- operatorPrivateKey: account.privateKey,
720
- operatorPublicKey: PrivateKey.fromString(
721
- account.privateKey
722
- ).publicKey.toString(),
723
- logLevel: "info",
724
- guardedRegistryBaseUrl: baseUrl
725
- });
726
- if (progressCallback) {
727
- progressCallback({
728
- stage: "preparing",
729
- message: "Initialized agent client",
730
- progressPercent: 30,
731
- details: { state }
732
- });
733
- }
734
- const { outboundTopicId, inboundTopicId, pfpTopicId, profileTopicId } = await agentClient.createAgent(builder);
735
- if (progressCallback) {
736
- progressCallback({
737
- stage: "submitting",
738
- message: "Created agent with topics and profile",
739
- progressPercent: 60,
740
- details: {
741
- state,
742
- outboundTopicId,
743
- inboundTopicId,
744
- pfpTopicId,
745
- profileTopicId
746
- }
747
- });
748
- }
749
- const operatorId = `${inboundTopicId}@${account.accountId}`;
750
- const registrationResult = await agentClient.registerAgentWithGuardedRegistry(
751
- account.accountId,
752
- config.network,
753
- {
754
- progressCallback: (data) => {
755
- const adjustedPercent = 60 + (data.progressPercent || 0) * 0.4;
756
- if (progressCallback) {
757
- progressCallback({
758
- stage: data.stage,
759
- message: data.message,
760
- progressPercent: adjustedPercent,
761
- details: {
762
- ...data.details,
763
- outboundTopicId,
764
- inboundTopicId,
765
- pfpTopicId,
766
- profileTopicId,
767
- operatorId,
768
- state: data.details?.state || state
769
- }
770
- });
771
- }
772
- },
773
- existingState: state
379
+ _generateHcs10Memo(type, options) {
380
+ const ttl = options.ttl ?? 60;
381
+ switch (type) {
382
+ case "inbound":
383
+ if (!options.accountId) {
384
+ throw new Error("accountId is required for inbound memo");
774
385
  }
775
- );
776
- if (!registrationResult.success) {
777
- return registrationResult;
778
- }
779
- if (progressCallback) {
780
- progressCallback({
781
- stage: "completed",
782
- message: "Agent creation and registration complete",
783
- progressPercent: 100,
784
- details: {
785
- outboundTopicId,
786
- inboundTopicId,
787
- pfpTopicId,
788
- profileTopicId,
789
- operatorId,
790
- state: registrationResult.state
791
- }
792
- });
793
- }
794
- return {
795
- ...registrationResult,
796
- metadata: {
797
- accountId: account.accountId,
798
- privateKey: account.privateKey,
799
- operatorId,
800
- inboundTopicId,
801
- outboundTopicId,
802
- profileTopicId,
803
- pfpTopicId
386
+ return `hcs-10:0:${ttl}:0:${options.accountId}`;
387
+ case "outbound":
388
+ return `hcs-10:0:${ttl}:1`;
389
+ case "connection":
390
+ if (!options.inboundTopicId || options.connectionId === void 0) {
391
+ throw new Error(
392
+ "inboundTopicId and connectionId are required for connection memo"
393
+ );
804
394
  }
805
- };
806
- } catch (error) {
807
- this.logger.error(
808
- `Failed to create and register agent: ${error.message}`
809
- );
810
- return {
811
- error: error.message,
812
- success: false
813
- };
395
+ return `hcs-10:1:${ttl}:2:${options.inboundTopicId}:${options.connectionId}`;
396
+ default:
397
+ throw new Error(`Invalid HCS-10 memo type: ${type}`);
814
398
  }
815
399
  }
816
- /**
817
- * Registers an agent with the guarded registry
818
- * @param accountId Account ID to register
819
- * @param inboundTopicId Inbound topic ID for the agent
820
- * @param network Network type ('mainnet' or 'testnet')
821
- * @param options Optional configuration including progress callback and confirmation settings
822
- * @returns Registration result
823
- */
824
- async registerAgentWithGuardedRegistry(accountId, network = this.network, options) {
400
+ async checkRegistrationStatus(transactionId, network, baseUrl) {
825
401
  try {
826
- this.logger.info("Registering agent with guarded registry");
827
- const maxAttempts = options?.maxAttempts ?? 60;
828
- const delayMs = options?.delayMs ?? 2e3;
829
- const progressCallback = options?.progressCallback;
830
- let state = options?.existingState || {
831
- currentStage: "registration",
832
- completedPercentage: 0,
833
- createdResources: []
834
- };
835
- if (progressCallback) {
836
- progressCallback({
837
- stage: "preparing",
838
- message: "Preparing agent registration",
839
- progressPercent: 10,
840
- details: {
841
- state
842
- }
843
- });
844
- }
845
- const registrationResult = await this.executeRegistration(
846
- accountId,
847
- network,
848
- this.guardedRegistryBaseUrl,
849
- this.logger
850
- );
851
- if (!registrationResult.success) {
852
- return {
853
- ...registrationResult,
854
- state
855
- };
856
- }
857
- if (progressCallback) {
858
- progressCallback({
859
- stage: "submitting",
860
- message: "Submitting registration to registry",
861
- progressPercent: 30,
862
- details: {
863
- transactionId: registrationResult.transactionId,
864
- state
865
- }
866
- });
867
- }
868
- if (registrationResult.transaction) {
869
- const transaction = Transaction.fromBytes(
870
- Buffer.from(registrationResult.transaction, "base64")
871
- );
872
- this.logger.info(`Processing registration transaction`);
873
- await transaction.execute(this.client);
874
- this.logger.info(`Successfully processed registration transaction`);
875
- }
876
- if (progressCallback) {
877
- progressCallback({
878
- stage: "confirming",
879
- message: "Confirming registration transaction",
880
- progressPercent: 60,
881
- details: {
882
- accountId,
883
- transactionId: registrationResult.transactionId,
884
- state
885
- }
886
- });
887
- }
888
- const confirmed = await this.waitForRegistrationConfirmation(
889
- registrationResult.transactionId,
890
- network,
891
- this.guardedRegistryBaseUrl,
892
- maxAttempts,
893
- delayMs,
894
- this.logger
895
- );
896
- state.currentStage = "complete";
897
- state.completedPercentage = 100;
898
- if (!state.createdResources) {
899
- state.createdResources = [];
900
- }
901
- if (registrationResult.transactionId) {
902
- state.createdResources.push(
903
- `registration:${registrationResult.transactionId}`
402
+ const response = await fetch(`${baseUrl}/api/request-confirm`, {
403
+ method: "POST",
404
+ headers: {
405
+ "Content-Type": "application/json",
406
+ "X-Network": network
407
+ },
408
+ body: JSON.stringify({ transaction_id: transactionId })
409
+ });
410
+ if (!response.ok) {
411
+ throw new Error(
412
+ `Failed to confirm registration: ${response.statusText}`
904
413
  );
905
414
  }
906
- if (progressCallback) {
907
- progressCallback({
908
- stage: "completed",
909
- message: "Agent registration complete",
910
- progressPercent: 100,
911
- details: {
912
- confirmed,
913
- transactionId: registrationResult.transactionId,
914
- state
915
- }
916
- });
917
- }
918
- return {
919
- ...registrationResult,
920
- confirmed,
921
- state
922
- };
415
+ return await response.json();
923
416
  } catch (error) {
924
- this.logger.error(`Failed to register agent: ${error.message}`);
925
- return {
926
- error: error.message,
927
- success: false
928
- };
417
+ this.logger.error(`Error checking registration status: ${error}`);
418
+ throw error;
929
419
  }
930
420
  }
931
421
  /**
932
- * Registers an agent with the guarded registry. Should be called by a registry.
933
- * @param registryTopicId - The topic ID of the guarded registry.
934
- * @param accountId - The account ID of the agent
935
- * @param inboundTopicId - The topic ID of the inbound topic
936
- * @param memo - The memo of the agent
937
- * @param submitKey - The submit key of the agent
422
+ * Validates if an operator_id follows the correct format (agentTopicId@accountId)
423
+ * @param operatorId The operator ID to validate
424
+ * @returns True if the format is valid, false otherwise
938
425
  */
939
- async registerAgent(registryTopicId, accountId, inboundTopicId, memo, submitKey) {
940
- this.logger.info("Registering agent");
941
- const payload = {
942
- p: "hcs-10",
943
- op: "register",
944
- account_id: accountId,
945
- inbound_topic_id: inboundTopicId,
946
- m: memo
947
- };
948
- await this.submitPayload(registryTopicId, payload, submitKey);
426
+ isValidOperatorId(operatorId) {
427
+ if (!operatorId) {
428
+ return false;
429
+ }
430
+ const parts = operatorId.split("@");
431
+ if (parts.length !== 2) {
432
+ return false;
433
+ }
434
+ const agentTopicId = parts[0];
435
+ const accountId = parts[1];
436
+ if (!agentTopicId) {
437
+ return false;
438
+ }
439
+ if (!accountId) {
440
+ return false;
441
+ }
442
+ const hederaIdPattern = /^[0-9]+\.[0-9]+\.[0-9]+$/;
443
+ if (!hederaIdPattern.test(accountId)) {
444
+ return false;
445
+ }
446
+ if (!hederaIdPattern.test(agentTopicId)) {
447
+ return false;
448
+ }
449
+ return true;
949
450
  }
950
- async getInboundTopicType(topicId) {
951
- try {
952
- const topicInfo = await this.mirrorNode.getTopicInfo(topicId);
953
- if (!topicInfo) {
954
- throw new Error("Topic does not exist");
955
- }
956
- const hasSubmitKey = topicInfo.submit_key && topicInfo.submit_key.key;
957
- if (!hasSubmitKey) {
958
- return InboundTopicType.PUBLIC;
959
- }
960
- const hasFeeScheduleKey = topicInfo.fee_schedule_key && topicInfo.fee_schedule_key.key;
961
- if (hasFeeScheduleKey && topicInfo.custom_fees) {
962
- const customFees = topicInfo.custom_fees;
963
- if (customFees && customFees.fixed_fees && customFees.fixed_fees.length > 0) {
964
- this.logger.info(
965
- `Topic ${topicId} is fee-based with ${customFees.fixed_fees.length} custom fees`
966
- );
967
- return InboundTopicType.FEE_BASED;
968
- }
969
- }
970
- return InboundTopicType.CONTROLLED;
971
- } catch (error) {
972
- this.logger.error(`Error determining topic type: ${error.message}`);
973
- throw new Error(`Failed to determine topic type: ${error.message}`);
451
+ }
452
+ class HCS10Cache {
453
+ constructor() {
454
+ this.CACHE_TTL = 36e5;
455
+ this.cache = /* @__PURE__ */ new Map();
456
+ this.cacheExpiry = /* @__PURE__ */ new Map();
457
+ }
458
+ static getInstance() {
459
+ if (!HCS10Cache.instance) {
460
+ HCS10Cache.instance = new HCS10Cache();
974
461
  }
462
+ return HCS10Cache.instance;
463
+ }
464
+ set(key, value) {
465
+ this.cache.set(key, value);
466
+ this.cacheExpiry.set(key, Date.now() + this.CACHE_TTL);
975
467
  }
976
- getNetwork() {
977
- return this.network;
468
+ get(key) {
469
+ const expiry = this.cacheExpiry.get(key);
470
+ if (expiry && expiry > Date.now()) {
471
+ return this.cache.get(key);
472
+ }
473
+ if (expiry) {
474
+ this.cache.delete(key);
475
+ this.cacheExpiry.delete(key);
476
+ }
477
+ return void 0;
978
478
  }
979
- getLogger() {
980
- return this.logger;
479
+ clear() {
480
+ this.cache.clear();
481
+ this.cacheExpiry.clear();
981
482
  }
982
483
  }
983
484
  export {
984
- HCS10Client,
985
- InboundTopicType
485
+ HCS10BaseClient,
486
+ HCS10Cache,
487
+ Hcs10MemoType
986
488
  };
987
489
  //# sourceMappingURL=standards-sdk.es5.js.map