@hashgraphonline/standards-sdk 0.0.69 → 0.0.70

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 (233) hide show
  1. package/README.md +13 -0
  2. package/dist/es/fees/fee-config-builder.d.ts +93 -45
  3. package/dist/es/fees/fee-config-builder.d.ts.map +1 -1
  4. package/dist/es/fees/types.d.ts +14 -12
  5. package/dist/es/fees/types.d.ts.map +1 -1
  6. package/dist/es/hcs-10/base-client.d.ts +8 -1
  7. package/dist/es/hcs-10/base-client.d.ts.map +1 -1
  8. package/dist/es/hcs-10/browser.d.ts.map +1 -1
  9. package/dist/es/hcs-10/sdk.d.ts +9 -1
  10. package/dist/es/hcs-10/sdk.d.ts.map +1 -1
  11. package/dist/es/services/mirror-node.d.ts +74 -1
  12. package/dist/es/services/mirror-node.d.ts.map +1 -1
  13. package/dist/es/services/types.d.ts +29 -0
  14. package/dist/es/services/types.d.ts.map +1 -1
  15. package/dist/es/standards-sdk.es.js +2 -0
  16. package/dist/es/standards-sdk.es.js.map +1 -1
  17. package/dist/es/standards-sdk.es100.js +60 -3
  18. package/dist/es/standards-sdk.es100.js.map +1 -1
  19. package/dist/es/standards-sdk.es101.js +1288 -3
  20. package/dist/es/standards-sdk.es101.js.map +1 -1
  21. package/dist/es/standards-sdk.es102.js +146 -14
  22. package/dist/es/standards-sdk.es102.js.map +1 -1
  23. package/dist/es/standards-sdk.es103.js +90 -4
  24. package/dist/es/standards-sdk.es103.js.map +1 -1
  25. package/dist/es/standards-sdk.es104.js +84 -39
  26. package/dist/es/standards-sdk.es104.js.map +1 -1
  27. package/dist/es/standards-sdk.es105.js +28 -36
  28. package/dist/es/standards-sdk.es105.js.map +1 -1
  29. package/dist/es/standards-sdk.es106.js +6 -37
  30. package/dist/es/standards-sdk.es106.js.map +1 -1
  31. package/dist/es/standards-sdk.es107.js +150 -69
  32. package/dist/es/standards-sdk.es107.js.map +1 -1
  33. package/dist/es/standards-sdk.es108.js +23 -3
  34. package/dist/es/standards-sdk.es108.js.map +1 -1
  35. package/dist/es/standards-sdk.es109.js +793 -2
  36. package/dist/es/standards-sdk.es109.js.map +1 -1
  37. package/dist/es/standards-sdk.es110.js +174 -2
  38. package/dist/es/standards-sdk.es110.js.map +1 -1
  39. package/dist/es/standards-sdk.es111.js +142 -33
  40. package/dist/es/standards-sdk.es111.js.map +1 -1
  41. package/dist/es/standards-sdk.es112.js +20 -32
  42. package/dist/es/standards-sdk.es112.js.map +1 -1
  43. package/dist/es/standards-sdk.es113.js +27 -9
  44. package/dist/es/standards-sdk.es113.js.map +1 -1
  45. package/dist/es/standards-sdk.es114.js +25 -33
  46. package/dist/es/standards-sdk.es114.js.map +1 -1
  47. package/dist/es/standards-sdk.es115.js +41 -0
  48. package/dist/es/standards-sdk.es115.js.map +1 -0
  49. package/dist/es/standards-sdk.es14.js +1 -1
  50. package/dist/es/standards-sdk.es18.js +91 -3
  51. package/dist/es/standards-sdk.es18.js.map +1 -1
  52. package/dist/es/standards-sdk.es19.js +127 -67
  53. package/dist/es/standards-sdk.es19.js.map +1 -1
  54. package/dist/es/standards-sdk.es20.js +7 -1041
  55. package/dist/es/standards-sdk.es20.js.map +1 -1
  56. package/dist/es/standards-sdk.es23.js +17 -17
  57. package/dist/es/standards-sdk.es24.js +2 -2
  58. package/dist/es/standards-sdk.es25.js +1 -1
  59. package/dist/es/standards-sdk.es27.js +1041 -5
  60. package/dist/es/standards-sdk.es27.js.map +1 -1
  61. package/dist/es/standards-sdk.es29.js +5 -419
  62. package/dist/es/standards-sdk.es29.js.map +1 -1
  63. package/dist/es/standards-sdk.es30.js +419 -2
  64. package/dist/es/standards-sdk.es30.js.map +1 -1
  65. package/dist/es/standards-sdk.es31.js +2 -120
  66. package/dist/es/standards-sdk.es31.js.map +1 -1
  67. package/dist/es/standards-sdk.es32.js +120 -3
  68. package/dist/es/standards-sdk.es32.js.map +1 -1
  69. package/dist/es/standards-sdk.es33.js +3 -164
  70. package/dist/es/standards-sdk.es33.js.map +1 -1
  71. package/dist/es/standards-sdk.es34.js +164 -2
  72. package/dist/es/standards-sdk.es34.js.map +1 -1
  73. package/dist/es/standards-sdk.es35.js +3 -194
  74. package/dist/es/standards-sdk.es35.js.map +1 -1
  75. package/dist/es/standards-sdk.es36.js +334 -408
  76. package/dist/es/standards-sdk.es36.js.map +1 -1
  77. package/dist/es/standards-sdk.es37.js +5 -24
  78. package/dist/es/standards-sdk.es37.js.map +1 -1
  79. package/dist/es/standards-sdk.es38.js +165 -125
  80. package/dist/es/standards-sdk.es38.js.map +1 -1
  81. package/dist/es/standards-sdk.es39.js +76 -13
  82. package/dist/es/standards-sdk.es39.js.map +1 -1
  83. package/dist/es/standards-sdk.es4.js +1 -1
  84. package/dist/es/standards-sdk.es40.js +111 -26
  85. package/dist/es/standards-sdk.es40.js.map +1 -1
  86. package/dist/es/standards-sdk.es41.js +47 -24
  87. package/dist/es/standards-sdk.es41.js.map +1 -1
  88. package/dist/es/standards-sdk.es42.js +9 -20
  89. package/dist/es/standards-sdk.es42.js.map +1 -1
  90. package/dist/es/standards-sdk.es43.js +90 -37
  91. package/dist/es/standards-sdk.es43.js.map +1 -1
  92. package/dist/es/standards-sdk.es44.js +3 -17
  93. package/dist/es/standards-sdk.es44.js.map +1 -1
  94. package/dist/es/standards-sdk.es45.js +2 -61
  95. package/dist/es/standards-sdk.es45.js.map +1 -1
  96. package/dist/es/standards-sdk.es46.js +107 -1283
  97. package/dist/es/standards-sdk.es46.js.map +1 -1
  98. package/dist/es/standards-sdk.es47.js +69 -143
  99. package/dist/es/standards-sdk.es47.js.map +1 -1
  100. package/dist/es/standards-sdk.es48.js +5 -90
  101. package/dist/es/standards-sdk.es48.js.map +1 -1
  102. package/dist/es/standards-sdk.es49.js +4 -83
  103. package/dist/es/standards-sdk.es49.js.map +1 -1
  104. package/dist/es/standards-sdk.es5.js +17 -0
  105. package/dist/es/standards-sdk.es5.js.map +1 -1
  106. package/dist/es/standards-sdk.es50.js +215 -26
  107. package/dist/es/standards-sdk.es50.js.map +1 -1
  108. package/dist/es/standards-sdk.es51.js +58 -6
  109. package/dist/es/standards-sdk.es51.js.map +1 -1
  110. package/dist/es/standards-sdk.es52.js +69 -159
  111. package/dist/es/standards-sdk.es52.js.map +1 -1
  112. package/dist/es/standards-sdk.es53.js +100 -22
  113. package/dist/es/standards-sdk.es53.js.map +1 -1
  114. package/dist/es/standards-sdk.es54.js +2 -793
  115. package/dist/es/standards-sdk.es54.js.map +1 -1
  116. package/dist/es/standards-sdk.es55.js +15 -173
  117. package/dist/es/standards-sdk.es55.js.map +1 -1
  118. package/dist/es/standards-sdk.es56.js +400 -134
  119. package/dist/es/standards-sdk.es56.js.map +1 -1
  120. package/dist/es/standards-sdk.es57.js +31 -3
  121. package/dist/es/standards-sdk.es57.js.map +1 -1
  122. package/dist/es/standards-sdk.es58.js +58 -16
  123. package/dist/es/standards-sdk.es58.js.map +1 -1
  124. package/dist/es/standards-sdk.es59.js +47 -24
  125. package/dist/es/standards-sdk.es59.js.map +1 -1
  126. package/dist/es/standards-sdk.es60.js +8 -24
  127. package/dist/es/standards-sdk.es60.js.map +1 -1
  128. package/dist/es/standards-sdk.es61.js +63 -36
  129. package/dist/es/standards-sdk.es61.js.map +1 -1
  130. package/dist/es/standards-sdk.es62.js +5 -363
  131. package/dist/es/standards-sdk.es62.js.map +1 -1
  132. package/dist/es/standards-sdk.es63.js +14 -5
  133. package/dist/es/standards-sdk.es63.js.map +1 -1
  134. package/dist/es/standards-sdk.es64.js +7 -179
  135. package/dist/es/standards-sdk.es64.js.map +1 -1
  136. package/dist/es/standards-sdk.es65.js +42 -78
  137. package/dist/es/standards-sdk.es65.js.map +1 -1
  138. package/dist/es/standards-sdk.es66.js +2 -114
  139. package/dist/es/standards-sdk.es66.js.map +1 -1
  140. package/dist/es/standards-sdk.es67.js +135 -51
  141. package/dist/es/standards-sdk.es67.js.map +1 -1
  142. package/dist/es/standards-sdk.es68.js +171 -9
  143. package/dist/es/standards-sdk.es68.js.map +1 -1
  144. package/dist/es/standards-sdk.es69.js +2282 -97
  145. package/dist/es/standards-sdk.es69.js.map +1 -1
  146. package/dist/es/standards-sdk.es7.js +93 -37
  147. package/dist/es/standards-sdk.es7.js.map +1 -1
  148. package/dist/es/standards-sdk.es70.js +13 -4
  149. package/dist/es/standards-sdk.es70.js.map +1 -1
  150. package/dist/es/standards-sdk.es71.js +13 -2
  151. package/dist/es/standards-sdk.es71.js.map +1 -1
  152. package/dist/es/standards-sdk.es72.js +30 -111
  153. package/dist/es/standards-sdk.es72.js.map +1 -1
  154. package/dist/es/standards-sdk.es73.js +14 -73
  155. package/dist/es/standards-sdk.es73.js.map +1 -1
  156. package/dist/es/standards-sdk.es74.js +3 -5
  157. package/dist/es/standards-sdk.es74.js.map +1 -1
  158. package/dist/es/standards-sdk.es75.js +3 -4
  159. package/dist/es/standards-sdk.es75.js.map +1 -1
  160. package/dist/es/standards-sdk.es76.js +14 -219
  161. package/dist/es/standards-sdk.es76.js.map +1 -1
  162. package/dist/es/standards-sdk.es77.js +5 -58
  163. package/dist/es/standards-sdk.es77.js.map +1 -1
  164. package/dist/es/standards-sdk.es78.js +38 -68
  165. package/dist/es/standards-sdk.es78.js.map +1 -1
  166. package/dist/es/standards-sdk.es79.js +37 -98
  167. package/dist/es/standards-sdk.es79.js.map +1 -1
  168. package/dist/es/standards-sdk.es8.js +0 -1
  169. package/dist/es/standards-sdk.es8.js.map +1 -1
  170. package/dist/es/standards-sdk.es80.js +37 -2
  171. package/dist/es/standards-sdk.es80.js.map +1 -1
  172. package/dist/es/standards-sdk.es81.js +78 -16
  173. package/dist/es/standards-sdk.es81.js.map +1 -1
  174. package/dist/es/standards-sdk.es82.js +3 -409
  175. package/dist/es/standards-sdk.es82.js.map +1 -1
  176. package/dist/es/standards-sdk.es83.js +2 -32
  177. package/dist/es/standards-sdk.es83.js.map +1 -1
  178. package/dist/es/standards-sdk.es84.js +2 -63
  179. package/dist/es/standards-sdk.es84.js.map +1 -1
  180. package/dist/es/standards-sdk.es85.js +2 -50
  181. package/dist/es/standards-sdk.es85.js.map +1 -1
  182. package/dist/es/standards-sdk.es86.js +33 -9
  183. package/dist/es/standards-sdk.es86.js.map +1 -1
  184. package/dist/es/standards-sdk.es87.js +28 -60
  185. package/dist/es/standards-sdk.es87.js.map +1 -1
  186. package/dist/es/standards-sdk.es88.js +9 -6
  187. package/dist/es/standards-sdk.es88.js.map +1 -1
  188. package/dist/es/standards-sdk.es89.js +33 -14
  189. package/dist/es/standards-sdk.es89.js.map +1 -1
  190. package/dist/es/standards-sdk.es90.js +194 -6
  191. package/dist/es/standards-sdk.es90.js.map +1 -1
  192. package/dist/es/standards-sdk.es91.js +432 -39
  193. package/dist/es/standards-sdk.es91.js.map +1 -1
  194. package/dist/es/standards-sdk.es92.js +25 -2
  195. package/dist/es/standards-sdk.es92.js.map +1 -1
  196. package/dist/es/standards-sdk.es93.js +127 -124
  197. package/dist/es/standards-sdk.es93.js.map +1 -1
  198. package/dist/es/standards-sdk.es94.js +14 -168
  199. package/dist/es/standards-sdk.es94.js.map +1 -1
  200. package/dist/es/standards-sdk.es95.js +29 -2282
  201. package/dist/es/standards-sdk.es95.js.map +1 -1
  202. package/dist/es/standards-sdk.es96.js +29 -13
  203. package/dist/es/standards-sdk.es96.js.map +1 -1
  204. package/dist/es/standards-sdk.es97.js +21 -13
  205. package/dist/es/standards-sdk.es97.js.map +1 -1
  206. package/dist/es/standards-sdk.es98.js +43 -31
  207. package/dist/es/standards-sdk.es98.js.map +1 -1
  208. package/dist/es/standards-sdk.es99.js +17 -14
  209. package/dist/es/standards-sdk.es99.js.map +1 -1
  210. package/dist/es/utils/index.d.ts +1 -0
  211. package/dist/es/utils/index.d.ts.map +1 -1
  212. package/dist/es/utils/types.d.ts +3 -0
  213. package/dist/es/utils/types.d.ts.map +1 -1
  214. package/dist/umd/fees/fee-config-builder.d.ts +93 -45
  215. package/dist/umd/fees/fee-config-builder.d.ts.map +1 -1
  216. package/dist/umd/fees/types.d.ts +14 -12
  217. package/dist/umd/fees/types.d.ts.map +1 -1
  218. package/dist/umd/hcs-10/base-client.d.ts +8 -1
  219. package/dist/umd/hcs-10/base-client.d.ts.map +1 -1
  220. package/dist/umd/hcs-10/browser.d.ts.map +1 -1
  221. package/dist/umd/hcs-10/sdk.d.ts +9 -1
  222. package/dist/umd/hcs-10/sdk.d.ts.map +1 -1
  223. package/dist/umd/services/mirror-node.d.ts +74 -1
  224. package/dist/umd/services/mirror-node.d.ts.map +1 -1
  225. package/dist/umd/services/types.d.ts +29 -0
  226. package/dist/umd/services/types.d.ts.map +1 -1
  227. package/dist/umd/standards-sdk.umd.js +1 -1
  228. package/dist/umd/standards-sdk.umd.js.map +1 -1
  229. package/dist/umd/utils/index.d.ts +1 -0
  230. package/dist/umd/utils/index.d.ts.map +1 -1
  231. package/dist/umd/utils/types.d.ts +3 -0
  232. package/dist/umd/utils/types.d.ts.map +1 -1
  233. package/package.json +2 -1
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es69.js","sources":["../../node_modules/axios/lib/cancel/CancelToken.js"],"sourcesContent":["'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n"],"names":[],"mappings":";AAWA,MAAM,YAAY;AAAA,EAChB,YAAY,UAAU;AACpB,QAAI,OAAO,aAAa,YAAY;AAClC,YAAM,IAAI,UAAU,8BAA8B;AAAA,IACxD;AAEI,QAAI;AAEJ,SAAK,UAAU,IAAI,QAAQ,SAAS,gBAAgB,SAAS;AAC3D,uBAAiB;AAAA,IACvB,CAAK;AAED,UAAM,QAAQ;AAGd,SAAK,QAAQ,KAAK,YAAU;AAC1B,UAAI,CAAC,MAAM,WAAY;AAEvB,UAAI,IAAI,MAAM,WAAW;AAEzB,aAAO,MAAM,GAAG;AACd,cAAM,WAAW,CAAC,EAAE,MAAM;AAAA,MAClC;AACM,YAAM,aAAa;AAAA,IACzB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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
@@ -1,5 +1,5 @@
1
1
  import Buffer from "./standards-sdk.es21.js";
2
- import { Client, PrivateKey, AccountCreateTransaction, Hbar, CustomFixedFee, AccountId, KeyList, TopicCreateTransaction, PublicKey, TopicMessageSubmitTransaction, TopicId, Transaction } from "@hashgraph/sdk";
2
+ import { Client, PrivateKey, AccountCreateTransaction, Hbar, CustomFixedFee, AccountId, TokenId, KeyList, TopicCreateTransaction, PublicKey, TopicMessageSubmitTransaction, TopicId, Transaction } from "@hashgraph/sdk";
3
3
  import { AccountCreationError, TopicCreationError, ConnectionConfirmationError, PayloadSizeError } from "./standards-sdk.es6.js";
4
4
  import { InscriptionSDK } from "./standards-sdk.es24.js";
5
5
  import { Logger } from "./standards-sdk.es14.js";
@@ -43,12 +43,15 @@ class HCS10Client extends HCS10BaseClient {
43
43
  }
44
44
  /**
45
45
  * Creates a new Hedera account
46
+ * @param initialBalance Optional initial balance in HBAR (default: 50)
46
47
  * @returns Object with account ID and private key
47
48
  */
48
- async createAccount() {
49
- this.logger.info("Creating new account");
49
+ async createAccount(initialBalance = 50) {
50
+ this.logger.info(
51
+ `Creating new account with ${initialBalance} HBAR initial balance`
52
+ );
50
53
  const newKey = PrivateKey.generate();
51
- const accountTransaction = new AccountCreateTransaction().setKey(newKey.publicKey).setInitialBalance(new Hbar(10));
54
+ const accountTransaction = new AccountCreateTransaction().setKey(newKey.publicKey).setInitialBalance(new Hbar(initialBalance));
52
55
  this.logger.debug("Executing account creation transaction");
53
56
  const accountResponse = await accountTransaction.execute(this.client);
54
57
  const accountReceipt = await accountResponse.getReceipt(this.client);
@@ -81,7 +84,7 @@ class HCS10Client extends HCS10BaseClient {
81
84
  ttl
82
85
  });
83
86
  let submitKey;
84
- let feeConfig;
87
+ let finalFeeConfig;
85
88
  switch (topicType) {
86
89
  case InboundTopicType.PUBLIC:
87
90
  submitKey = false;
@@ -90,18 +93,27 @@ class HCS10Client extends HCS10BaseClient {
90
93
  submitKey = true;
91
94
  break;
92
95
  case InboundTopicType.FEE_BASED:
93
- submitKey = true;
96
+ submitKey = false;
94
97
  if (!feeConfigBuilder) {
95
98
  throw new Error(
96
99
  "Fee configuration builder is required for fee-based topics"
97
100
  );
98
101
  }
99
- feeConfig = feeConfigBuilder.build();
102
+ const internalFees = feeConfigBuilder.customFees;
103
+ internalFees.forEach((fee) => {
104
+ if (!fee.feeCollectorAccountId) {
105
+ this.logger.debug(
106
+ `Defaulting fee collector for token ${fee.feeTokenId || "HBAR"} to agent ${accountId}`
107
+ );
108
+ fee.feeCollectorAccountId = accountId;
109
+ }
110
+ });
111
+ finalFeeConfig = feeConfigBuilder.build();
100
112
  break;
101
113
  default:
102
114
  throw new Error(`Unsupported inbound topic type: ${topicType}`);
103
115
  }
104
- return this.createTopic(memo, true, submitKey, feeConfig);
116
+ return this.createTopic(memo, true, submitKey, finalFeeConfig);
105
117
  }
106
118
  /**
107
119
  * Creates a new agent with inbound and outbound topics
@@ -284,42 +296,80 @@ class HCS10Client extends HCS10BaseClient {
284
296
  }
285
297
  }
286
298
  async setupFees(transaction, feeConfig, additionalExemptAccounts = []) {
299
+ let modifiedTransaction = transaction;
287
300
  if (!this.client.operatorPublicKey) {
288
- return;
301
+ return modifiedTransaction;
289
302
  }
290
- this.logger.info("Setting up topic with custom fees");
291
- const customFee = new CustomFixedFee().setAmount(Number(feeConfig.feeAmount.amount)).setFeeCollectorAccountId(
292
- AccountId.fromString(feeConfig.feeCollectorAccountId)
293
- );
294
- let exemptAccountIds = [
303
+ if (!feeConfig.customFees || feeConfig.customFees.length === 0) {
304
+ this.logger.warn("No custom fees provided in fee config for setupFees");
305
+ return modifiedTransaction;
306
+ }
307
+ if (feeConfig.customFees.length > 10) {
308
+ this.logger.warn(
309
+ "More than 10 custom fees provided, only the first 10 will be used"
310
+ );
311
+ feeConfig.customFees = feeConfig.customFees.slice(0, 10);
312
+ }
313
+ const customFees = feeConfig.customFees.map((fee) => {
314
+ if (!fee.feeCollectorAccountId) {
315
+ this.logger.error(
316
+ "Internal Error: Fee collector ID missing in setupFees"
317
+ );
318
+ return null;
319
+ }
320
+ if (fee.type === "FIXED_FEE") {
321
+ const customFee = new CustomFixedFee().setAmount(Number(fee.feeAmount.amount)).setFeeCollectorAccountId(
322
+ AccountId.fromString(fee.feeCollectorAccountId)
323
+ );
324
+ if (fee.feeTokenId) {
325
+ customFee.setDenominatingTokenId(
326
+ TokenId.fromString(fee.feeTokenId)
327
+ );
328
+ }
329
+ return customFee;
330
+ }
331
+ return null;
332
+ }).filter(Boolean);
333
+ if (customFees.length === 0) {
334
+ this.logger.warn("No valid custom fees to apply in setupFees");
335
+ return modifiedTransaction;
336
+ }
337
+ const exemptAccountIds = [
295
338
  ...feeConfig.exemptAccounts || [],
296
339
  ...additionalExemptAccounts
297
340
  ];
298
- console.log("exemptAccountIds", exemptAccountIds);
299
341
  if (exemptAccountIds.length > 0) {
300
- const uniqueExemptAccountIds = Array.from(new Set(exemptAccountIds));
301
- const filteredExemptAccounts = uniqueExemptAccountIds.filter(
302
- (account) => account !== this.client.operatorAccountId?.toString()
342
+ modifiedTransaction = await this.setupExemptKeys(
343
+ transaction,
344
+ exemptAccountIds
303
345
  );
304
- let exemptKeys = [];
305
- if (filteredExemptAccounts.length > 0) {
306
- try {
307
- exemptKeys = await accountIdsToExemptKeys(
308
- filteredExemptAccounts,
309
- this.network,
310
- this.logger
311
- );
312
- } catch (error) {
313
- this.logger.warn(
314
- `Error getting exempt keys: ${error}, continuing without exempt keys`
315
- );
316
- }
317
- }
318
- if (exemptKeys.length > 0) {
319
- transaction.setFeeExemptKeys(exemptKeys);
346
+ }
347
+ return modifiedTransaction.setFeeScheduleKey(this.client.operatorPublicKey).setCustomFees(customFees);
348
+ }
349
+ async setupExemptKeys(transaction, exemptAccountIds) {
350
+ let modifiedTransaction = transaction;
351
+ const uniqueExemptAccountIds = Array.from(new Set(exemptAccountIds));
352
+ const filteredExemptAccounts = uniqueExemptAccountIds.filter(
353
+ (account) => account !== this.client.operatorAccountId?.toString()
354
+ );
355
+ let exemptKeys = [];
356
+ if (filteredExemptAccounts.length > 0) {
357
+ try {
358
+ exemptKeys = await accountIdsToExemptKeys(
359
+ filteredExemptAccounts,
360
+ this.network,
361
+ this.logger
362
+ );
363
+ } catch (error) {
364
+ this.logger.warn(
365
+ `Error getting exempt keys: ${error}, continuing without exempt keys`
366
+ );
320
367
  }
321
368
  }
322
- transaction.setFeeScheduleKey(this.client.operatorPublicKey).setCustomFees([customFee]);
369
+ if (exemptKeys.length > 0) {
370
+ modifiedTransaction = modifiedTransaction.setFeeExemptKeys(exemptKeys);
371
+ }
372
+ return modifiedTransaction;
323
373
  }
324
374
  /**
325
375
  * Handles a connection request from another account
@@ -548,7 +598,6 @@ class HCS10Client extends HCS10BaseClient {
548
598
  "Topic requires fee payment, setting max transaction fee"
549
599
  );
550
600
  transaction.setMaxTransactionFee(new Hbar(this.feeAmount));
551
- transaction.setTransactionMemo("HIP-991 Fee Payment");
552
601
  }
553
602
  let transactionResponse;
554
603
  if (submitKey) {
@@ -756,7 +805,7 @@ class HCS10Client extends HCS10BaseClient {
756
805
  details: { state }
757
806
  });
758
807
  }
759
- const account = config.existingAccount || await this.createAccount();
808
+ const account = config.existingAccount || await this.createAccount(options?.initialBalance);
760
809
  if (progressCallback) {
761
810
  progressCallback({
762
811
  stage: "preparing",
@@ -1031,6 +1080,13 @@ class HCS10Client extends HCS10BaseClient {
1031
1080
  getLogger() {
1032
1081
  return this.logger;
1033
1082
  }
1083
+ /**
1084
+ * Public method to get the operator account ID configured for this client instance.
1085
+ * @returns The operator account ID string, or null if not set.
1086
+ */
1087
+ getOperatorAccountId() {
1088
+ return this.client.operatorAccountId?.toString() ?? null;
1089
+ }
1034
1090
  }
1035
1091
  export {
1036
1092
  HCS10Client
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es7.js","sources":["../../src/hcs-10/sdk.ts"],"sourcesContent":["import {\n Client,\n AccountCreateTransaction,\n PrivateKey,\n Hbar,\n KeyList,\n TopicCreateTransaction,\n TopicMessageSubmitTransaction,\n TopicId,\n Transaction,\n TransactionResponse,\n TransactionReceipt,\n PublicKey,\n AccountId,\n CustomFixedFee,\n} from '@hashgraph/sdk';\nimport {\n PayloadSizeError,\n AccountCreationError,\n TopicCreationError,\n ConnectionConfirmationError,\n} from './errors';\nimport {\n InscriptionSDK,\n RetrievedInscriptionResult,\n} from '@kiloscribe/inscription-sdk';\nimport { Logger, LogLevel } from '../utils/logger';\nimport { HCS10BaseClient } from './base-client';\nimport * as mime from 'mime-types';\nimport {\n HCSClientConfig,\n CreateAccountResponse,\n CreateAgentResponse,\n StoreHCS11ProfileResponse,\n AgentRegistrationResult,\n HandleConnectionRequestResponse,\n WaitForConnectionConfirmationResponse,\n GetAccountAndSignerResponse,\n AgentCreationState,\n RegistrationProgressCallback,\n InscribePfpResponse,\n} from './types';\nimport {\n HCS11Client,\n AgentMetadata as HCS11AgentMetadata,\n SocialLink,\n SocialPlatform,\n InboundTopicType,\n AgentMetadata,\n} from '../hcs-11';\nimport { FeeConfigBuilderInterface, TopicFeeConfig } from '../fees';\nimport { accountIdsToExemptKeys } from '../utils/topic-fee-utils';\nimport { Hcs10MemoType } from './base-client';\nimport { AgentBuilder } from '../hcs-11/agent-builder';\nimport { inscribe } from '../inscribe/inscriber';\n\nexport class HCS10Client extends HCS10BaseClient {\n private client: Client;\n private operatorPrivateKey: PrivateKey;\n protected declare network: string;\n protected declare logger: Logger;\n protected guardedRegistryBaseUrl: string;\n private hcs11Client: HCS11Client;\n\n constructor(config: HCSClientConfig) {\n super({\n network: config.network,\n logLevel: config.logLevel,\n prettyPrint: config.prettyPrint,\n feeAmount: config.feeAmount,\n });\n this.client =\n config.network === 'mainnet' ? Client.forMainnet() : Client.forTestnet();\n this.operatorPrivateKey = PrivateKey.fromString(config.operatorPrivateKey);\n this.network = config.network;\n this.client.setOperator(\n config.operatorId,\n this.operatorPrivateKey.toString()\n );\n this.logger = Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS-SDK',\n });\n this.guardedRegistryBaseUrl =\n config.guardedRegistryBaseUrl || 'https://moonscape.tech';\n\n this.hcs11Client = new HCS11Client({\n network: config.network,\n auth: {\n operatorId: config.operatorId,\n privateKey: config.operatorPrivateKey,\n },\n logLevel: config.logLevel,\n });\n }\n\n public getClient() {\n return this.client;\n }\n\n /**\n * Creates a new Hedera account\n * @returns Object with account ID and private key\n */\n async createAccount(): Promise<CreateAccountResponse> {\n this.logger.info('Creating new account');\n const newKey = PrivateKey.generate();\n\n const accountTransaction = new AccountCreateTransaction()\n .setKey(newKey.publicKey)\n .setInitialBalance(new Hbar(10));\n\n this.logger.debug('Executing account creation transaction');\n const accountResponse = await accountTransaction.execute(this.client);\n const accountReceipt = await accountResponse.getReceipt(this.client);\n const newAccountId = accountReceipt.accountId;\n\n if (!newAccountId) {\n this.logger.error('Account creation failed: accountId is null');\n throw new AccountCreationError(\n 'Failed to create account: accountId is null'\n );\n }\n\n this.logger.info(\n `Account created successfully: ${newAccountId.toString()}`\n );\n return {\n accountId: newAccountId.toString(),\n privateKey: newKey.toString(),\n };\n }\n\n /**\n * Creates an inbound topic for an agent\n * @param accountId The account ID associated with the inbound topic\n * @param topicType Type of inbound topic (public, controlled, or fee-based)\n * @param ttl Optional Time-To-Live for the topic memo, defaults to 60\n * @param feeConfigBuilder Optional fee configuration builder for fee-based topics\n * @returns The topic ID of the created inbound topic\n */\n async createInboundTopic(\n accountId: string,\n topicType: InboundTopicType,\n ttl: number = 60,\n feeConfigBuilder?: FeeConfigBuilderInterface\n ): Promise<string> {\n const memo = this._generateHcs10Memo(Hcs10MemoType.INBOUND, {\n accountId,\n ttl,\n });\n\n let submitKey: boolean | PublicKey | KeyList | undefined;\n let feeConfig: TopicFeeConfig | undefined;\n\n switch (topicType) {\n case InboundTopicType.PUBLIC:\n submitKey = false;\n break;\n case InboundTopicType.CONTROLLED:\n submitKey = true;\n break;\n case InboundTopicType.FEE_BASED:\n submitKey = true;\n if (!feeConfigBuilder) {\n throw new Error(\n 'Fee configuration builder is required for fee-based topics'\n );\n }\n feeConfig = feeConfigBuilder.build();\n break;\n default:\n throw new Error(`Unsupported inbound topic type: ${topicType}`);\n }\n\n return this.createTopic(memo, true, submitKey, feeConfig);\n }\n\n /**\n * Creates a new agent with inbound and outbound topics\n * @param builder The agent builder object\n * @param ttl Optional Time-To-Live for the topic memos, defaults to 60\n * @returns Object with topic IDs\n */\n async createAgent(\n builder: AgentBuilder,\n ttl: number = 60\n ): Promise<CreateAgentResponse> {\n const config = builder.build();\n const outboundMemo = this._generateHcs10Memo(Hcs10MemoType.OUTBOUND, {\n ttl,\n });\n const outboundTopicId = await this.createTopic(outboundMemo, true, true);\n this.logger.info(`Created new outbound topic ID: ${outboundTopicId}`);\n\n const accountId = this.client.operatorAccountId?.toString();\n if (!accountId) {\n throw new Error('Failed to retrieve operator account ID');\n }\n\n const inboundTopicId = await this.createInboundTopic(\n accountId,\n config.inboundTopicType,\n ttl,\n config.inboundTopicType === InboundTopicType.FEE_BASED\n ? config.feeConfig\n : undefined\n );\n\n let pfpTopicId = config.existingPfpTopicId || '';\n\n if (!pfpTopicId && config.pfpBuffer && config.pfpBuffer.length > 0) {\n this.logger.info('Inscribing new profile picture');\n const pfpResult = await this.inscribePfp(\n config.pfpBuffer,\n config.pfpFileName\n );\n pfpTopicId = pfpResult.pfpTopicId;\n this.logger.info(\n `Profile picture inscribed with topic ID: ${pfpTopicId}`\n );\n } else if (config.existingPfpTopicId) {\n this.logger.info(\n `Using existing profile picture with topic ID: ${config.existingPfpTopicId}`\n );\n }\n\n const profileResult = await this.storeHCS11Profile(\n config.name,\n config.bio,\n inboundTopicId,\n outboundTopicId,\n config.capabilities,\n config.metadata,\n config.pfpBuffer && config.pfpBuffer.length > 0\n ? config.pfpBuffer\n : undefined,\n config.pfpFileName,\n config.existingPfpTopicId\n );\n const profileTopicId = profileResult.profileTopicId;\n this.logger.info(`Profile stored with topic ID: ${profileTopicId}`);\n\n return {\n inboundTopicId,\n outboundTopicId,\n pfpTopicId,\n profileTopicId,\n };\n }\n\n /**\n * Inscribes a profile picture to Hedera\n * @param buffer Profile picture buffer\n * @param fileName Filename\n * @returns Response with topic ID and transaction ID\n */\n async inscribePfp(\n buffer: Buffer,\n fileName: string\n ): Promise<InscribePfpResponse> {\n try {\n this.logger.info('Inscribing profile picture using HCS-11 client');\n\n const imageResult = await this.hcs11Client.inscribeImage(\n buffer,\n fileName\n );\n\n if (!imageResult.success) {\n this.logger.error(\n `Failed to inscribe profile picture: ${imageResult.error}`\n );\n throw new Error(\n imageResult?.error || 'Failed to inscribe profile picture'\n );\n }\n\n this.logger.info(\n `Successfully inscribed profile picture with topic ID: ${imageResult.imageTopicId}`\n );\n return {\n pfpTopicId: imageResult.imageTopicId,\n transactionId: imageResult.transactionId,\n success: true,\n };\n } catch (error: any) {\n this.logger.error(`Error inscribing profile picture: ${error.message}`);\n return {\n pfpTopicId: '',\n transactionId: '',\n success: false,\n error: error.message,\n };\n }\n }\n\n /**\n * Stores an HCS-11 profile for an agent\n * @param agentName Agent name\n * @param agentBio Agent description\n * @param inboundTopicId Inbound topic ID\n * @param outboundTopicId Outbound topic ID\n * @param capabilities Agent capability tags\n * @param metadata Additional metadata\n * @param pfpBuffer Optional profile picture buffer\n * @param pfpFileName Optional profile picture filename\n * @returns Response with topic IDs and transaction ID\n */\n async storeHCS11Profile(\n agentName: string,\n agentBio: string,\n inboundTopicId: string,\n outboundTopicId: string,\n capabilities: number[] = [],\n metadata: AgentMetadata,\n pfpBuffer?: Buffer,\n pfpFileName?: string,\n existingPfpTopicId?: string\n ): Promise<StoreHCS11ProfileResponse> {\n try {\n let pfpTopicId = existingPfpTopicId || '';\n\n if (!pfpTopicId && pfpBuffer && pfpFileName) {\n this.logger.info('Inscribing profile picture for HCS-11 profile');\n const pfpResult = await this.inscribePfp(pfpBuffer, pfpFileName);\n if (!pfpResult.success) {\n this.logger.warn(\n `Failed to inscribe profile picture: ${pfpResult.error}, proceeding without pfp`\n );\n } else {\n pfpTopicId = pfpResult.pfpTopicId;\n }\n } else if (existingPfpTopicId) {\n this.logger.info(\n `Using existing profile picture with topic ID: ${existingPfpTopicId} for HCS-11 profile`\n );\n pfpTopicId = existingPfpTopicId;\n }\n\n const agentType = this.hcs11Client.getAgentTypeFromMetadata({\n type: metadata.type || 'autonomous',\n } as HCS11AgentMetadata);\n\n const formattedSocials: SocialLink[] | undefined = metadata.socials\n ? (Object.entries(metadata.socials)\n .filter(([_, handle]) => handle)\n .map(([platform, handle]) => ({\n platform: platform as SocialPlatform,\n handle: handle as string,\n })) as SocialLink[])\n : undefined;\n\n const profile = this.hcs11Client.createAIAgentProfile(\n agentName,\n agentType,\n capabilities,\n metadata.model || 'unknown',\n {\n alias: agentName.toLowerCase().replace(/\\s+/g, '_'),\n bio: agentBio,\n profileImage: pfpTopicId ? `hcs://1/${pfpTopicId}` : undefined,\n socials: formattedSocials,\n properties: metadata.properties,\n inboundTopicId,\n outboundTopicId,\n creator: metadata.creator,\n }\n );\n\n const profileResult = await this.hcs11Client.createAndInscribeProfile(\n profile,\n true\n );\n\n if (!profileResult.success) {\n this.logger.error(`Failed to inscribe profile: ${profileResult.error}`);\n throw new Error(profileResult.error || 'Failed to inscribe profile');\n }\n\n this.logger.info(\n `Profile inscribed with topic ID: ${profileResult.profileTopicId}, transaction ID: ${profileResult.transactionId}`\n );\n\n return {\n profileTopicId: profileResult.profileTopicId,\n pfpTopicId,\n transactionId: profileResult.transactionId,\n success: true,\n };\n } catch (error: any) {\n this.logger.error(`Error storing HCS-11 profile: ${error.message}`);\n return {\n profileTopicId: '',\n pfpTopicId: '',\n transactionId: '',\n success: false,\n error: error.message,\n };\n }\n }\n\n private async setupFees(\n transaction: TopicCreateTransaction,\n feeConfig: TopicFeeConfig,\n additionalExemptAccounts: string[] = []\n ): Promise<void> {\n if (!this.client.operatorPublicKey) {\n return;\n }\n\n this.logger.info('Setting up topic with custom fees');\n\n const customFee = new CustomFixedFee()\n .setAmount(Number(feeConfig.feeAmount.amount))\n .setFeeCollectorAccountId(\n AccountId.fromString(feeConfig.feeCollectorAccountId)\n );\n\n let exemptAccountIds = [\n ...(feeConfig.exemptAccounts || []),\n ...additionalExemptAccounts,\n ];\n\n console.log('exemptAccountIds', exemptAccountIds);\n\n if (exemptAccountIds.length > 0) {\n const uniqueExemptAccountIds = Array.from(new Set(exemptAccountIds));\n const filteredExemptAccounts = uniqueExemptAccountIds.filter(\n (account) => account !== this.client.operatorAccountId?.toString()\n );\n\n let exemptKeys: PublicKey[] = [];\n if (filteredExemptAccounts.length > 0) {\n try {\n exemptKeys = await accountIdsToExemptKeys(\n filteredExemptAccounts,\n this.network,\n this.logger\n );\n } catch (error) {\n this.logger.warn(\n `Error getting exempt keys: ${error}, continuing without exempt keys`\n );\n }\n }\n\n if (exemptKeys.length > 0) {\n transaction.setFeeExemptKeys(exemptKeys);\n }\n }\n\n transaction\n .setFeeScheduleKey(this.client.operatorPublicKey)\n .setCustomFees([customFee]);\n }\n\n /**\n * Handles a connection request from another account\n * @param inboundTopicId Inbound topic ID of your agent\n * @param requestingAccountId Requesting account ID\n * @param connectionRequestId Connection request ID\n * @param connectionFeeConfig Optional fee configuration for the connection topic\n * @param ttl Optional ttl parameter with default\n * @returns Response with connection details\n */\n async handleConnectionRequest(\n inboundTopicId: string,\n requestingAccountId: string,\n connectionRequestId: number,\n connectionFeeConfig?: FeeConfigBuilderInterface,\n ttl: number = 60\n ): Promise<HandleConnectionRequestResponse> {\n const memo = this._generateHcs10Memo(Hcs10MemoType.CONNECTION, {\n ttl,\n inboundTopicId,\n connectionId: connectionRequestId,\n });\n this.logger.info(\n `Handling connection request ${connectionRequestId} from ${requestingAccountId}`\n );\n\n const accountId = this.getClient().operatorAccountId?.toString();\n if (!accountId) {\n throw new Error('Failed to retrieve operator account ID');\n }\n\n let requesterKey = await this.mirrorNode.getPublicKey(requestingAccountId);\n const accountKey = await this.mirrorNode.getPublicKey(accountId);\n\n if (!accountKey) {\n throw new Error('Failed to retrieve public key');\n }\n\n const thresholdKey = new KeyList([accountKey, requesterKey], 1);\n\n let connectionTopicId: string;\n\n try {\n if (connectionFeeConfig) {\n const feeConfig = connectionFeeConfig.build();\n const modifiedFeeConfig = {\n ...feeConfig,\n exemptAccounts: [...(feeConfig.exemptAccounts || [])],\n };\n\n connectionTopicId = await this.createTopic(\n memo,\n thresholdKey,\n thresholdKey,\n modifiedFeeConfig\n );\n } else {\n connectionTopicId = await this.createTopic(\n memo,\n thresholdKey,\n thresholdKey\n );\n }\n\n this.logger.info(`Created new connection topic ID: ${connectionTopicId}`);\n } catch (error) {\n this.logger.error(`Failed to create connection topic: ${error}`);\n throw new TopicCreationError(\n `Failed to create connection topic: ${error}`\n );\n }\n\n const operatorId = `${inboundTopicId}@${accountId}`;\n\n const confirmedConnectionSequenceNumber = await this.confirmConnection(\n inboundTopicId,\n connectionTopicId,\n requestingAccountId,\n connectionRequestId,\n 'Connection accepted. Looking forward to collaborating!'\n );\n\n const accountTopics = await this.retrieveCommunicationTopics(accountId);\n\n const requestingAccountTopics = await this.retrieveCommunicationTopics(\n requestingAccountId\n );\n\n const requestingAccountOperatorId = `${requestingAccountTopics.inboundTopic}@${requestingAccountId}`;\n\n await this.recordOutboundConnectionConfirmation({\n outboundTopicId: accountTopics.outboundTopic,\n requestorOutboundTopicId: requestingAccountTopics.outboundTopic,\n connectionRequestId: connectionRequestId,\n confirmedRequestId: confirmedConnectionSequenceNumber,\n connectionTopicId,\n operatorId: requestingAccountOperatorId,\n memo: `Connection established with ${requestingAccountId}`,\n });\n\n return {\n connectionTopicId,\n confirmedConnectionSequenceNumber,\n operatorId,\n };\n }\n\n /**\n * Confirms a connection request from another account\n * @param inboundTopicId Inbound topic ID\n * @param connectionTopicId Connection topic ID\n * @param connectedAccountId Connected account ID\n * @param connectionId Connection ID\n * @param memo Memo for the connection request\n * @param submitKey Optional submit key\n * @returns Sequence number of the confirmed connection\n */\n async confirmConnection(\n inboundTopicId: string,\n connectionTopicId: string,\n connectedAccountId: string,\n connectionId: number,\n memo: string,\n submitKey?: PrivateKey\n ): Promise<number> {\n const operatorId = await this.getOperatorId();\n this.logger.info(`Confirming connection with ID ${connectionId}`);\n const payload = {\n p: 'hcs-10',\n op: 'connection_created',\n connection_topic_id: connectionTopicId,\n connected_account_id: connectedAccountId,\n operator_id: operatorId,\n connection_id: connectionId,\n m: memo,\n };\n\n const submissionCheck = await this.canSubmitToTopic(\n inboundTopicId,\n this.client.operatorAccountId?.toString() || ''\n );\n\n const result = await this.submitPayload(\n inboundTopicId,\n payload,\n submitKey,\n submissionCheck.requiresFee\n );\n\n const sequenceNumber = result.topicSequenceNumber?.toNumber();\n\n if (!sequenceNumber) {\n throw new ConnectionConfirmationError(\n 'Failed to confirm connection: sequence number is null'\n );\n }\n\n return sequenceNumber;\n }\n\n async sendMessage(\n connectionTopicId: string,\n data: string,\n memo?: string,\n submitKey?: PrivateKey,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n waitMaxAttempts?: number;\n waitIntervalMs?: number;\n }\n ): Promise<TransactionReceipt> {\n const submissionCheck = await this.canSubmitToTopic(\n connectionTopicId,\n this.client.operatorAccountId?.toString() || ''\n );\n\n const operatorId = await this.getOperatorId();\n\n const payload = {\n p: 'hcs-10',\n op: 'message',\n operator_id: operatorId,\n data,\n m: memo,\n };\n\n const payloadString = JSON.stringify(payload);\n const isLargePayload = Buffer.from(payloadString).length > 1000;\n\n if (isLargePayload) {\n this.logger.info(\n 'Message payload exceeds 1000 bytes, storing via inscription'\n );\n try {\n const contentBuffer = Buffer.from(data);\n const fileName = `message-${Date.now()}.json`;\n const inscriptionResult = await this.inscribeFile(\n contentBuffer,\n fileName,\n {\n progressCallback: options?.progressCallback,\n waitMaxAttempts: options?.waitMaxAttempts,\n waitIntervalMs: options?.waitIntervalMs,\n }\n );\n\n if (inscriptionResult?.topic_id) {\n payload.data = `hcs://1/${inscriptionResult.topic_id}`;\n this.logger.info(\n `Large message inscribed with topic ID: ${inscriptionResult.topic_id}`\n );\n } else {\n throw new Error('Failed to inscribe large message content');\n }\n } catch (error) {\n this.logger.error('Error inscribing large message:', error);\n throw new Error(\n `Failed to handle large message: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`\n );\n }\n }\n\n this.logger.info('Submitting message to connection topic', payload);\n return await this.submitPayload(\n connectionTopicId,\n payload,\n submitKey,\n submissionCheck.requiresFee\n );\n }\n\n async createTopic(\n memo: string,\n adminKey?: boolean | PublicKey | KeyList,\n submitKey?: boolean | PublicKey | KeyList,\n feeConfig?: TopicFeeConfig\n ): Promise<string> {\n this.logger.info('Creating topic');\n const transaction = new TopicCreateTransaction().setTopicMemo(memo);\n\n if (adminKey) {\n if (\n typeof adminKey === 'boolean' &&\n adminKey &&\n this.client.operatorPublicKey\n ) {\n transaction.setAdminKey(this.client.operatorPublicKey);\n transaction.setAutoRenewAccountId(this.client.operatorAccountId!);\n } else if (adminKey instanceof PublicKey || adminKey instanceof KeyList) {\n transaction.setAdminKey(adminKey);\n if (this.client.operatorAccountId) {\n transaction.setAutoRenewAccountId(this.client.operatorAccountId);\n }\n }\n }\n\n if (submitKey) {\n if (\n typeof submitKey === 'boolean' &&\n submitKey &&\n this.client.operatorPublicKey\n ) {\n transaction.setSubmitKey(this.client.operatorPublicKey);\n } else if (\n submitKey instanceof PublicKey ||\n submitKey instanceof KeyList\n ) {\n transaction.setSubmitKey(submitKey);\n }\n }\n\n if (feeConfig) {\n await this.setupFees(transaction, feeConfig);\n }\n\n this.logger.debug('Executing topic creation transaction');\n const txResponse = await transaction.execute(this.client);\n const receipt = await txResponse.getReceipt(this.client);\n\n if (!receipt.topicId) {\n this.logger.error('Failed to create topic: topicId is null');\n throw new Error('Failed to create topic: topicId is null');\n }\n\n const topicId = receipt.topicId.toString();\n return topicId;\n }\n\n public async submitPayload(\n topicId: string,\n payload: object | string,\n submitKey?: PrivateKey,\n requiresFee: boolean = false\n ): Promise<TransactionReceipt> {\n const message =\n typeof payload === 'string' ? payload : JSON.stringify(payload);\n\n const payloadSizeInBytes = Buffer.byteLength(message, 'utf8');\n if (payloadSizeInBytes > 1000) {\n throw new PayloadSizeError(\n 'Payload size exceeds 1000 bytes limit',\n payloadSizeInBytes\n );\n }\n\n const transaction = new TopicMessageSubmitTransaction()\n .setTopicId(TopicId.fromString(topicId))\n .setMessage(message);\n\n if (requiresFee) {\n this.logger.info(\n 'Topic requires fee payment, setting max transaction fee'\n );\n transaction.setMaxTransactionFee(new Hbar(this.feeAmount));\n transaction.setTransactionMemo('HIP-991 Fee Payment');\n }\n\n let transactionResponse: TransactionResponse;\n if (submitKey) {\n const frozenTransaction = transaction.freezeWith(this.client);\n const signedTransaction = await frozenTransaction.sign(submitKey);\n transactionResponse = await signedTransaction.execute(this.client);\n } else {\n transactionResponse = await transaction.execute(this.client);\n }\n\n const receipt = await transactionResponse.getReceipt(this.client);\n if (!receipt) {\n this.logger.error('Failed to submit message: receipt is null');\n throw new Error('Failed to submit message: receipt is null');\n }\n this.logger.info('Message submitted successfully');\n return receipt;\n }\n\n async submitConnectionRequest(\n inboundTopicId: string,\n memo: string\n ): Promise<TransactionReceipt> {\n const accountResponse = this.getAccountAndSigner();\n if (!accountResponse.accountId) {\n throw new Error('Operator account ID is not set');\n }\n const operatorId = await this.getOperatorId();\n const accountId = accountResponse.accountId;\n\n const submissionCheck = await this.canSubmitToTopic(\n inboundTopicId,\n accountId\n );\n\n if (!submissionCheck.canSubmit) {\n throw new Error(`Cannot submit to topic: ${submissionCheck.reason}`);\n }\n\n const connectionRequestMessage = {\n p: 'hcs-10',\n op: 'connection_request',\n operator_id: operatorId,\n m: memo,\n };\n\n const requiresFee = submissionCheck.requiresFee;\n const response = await this.submitPayload(\n inboundTopicId,\n connectionRequestMessage,\n undefined,\n requiresFee\n );\n\n this.logger.info(\n `Submitted connection request to topic ID: ${inboundTopicId}`\n );\n\n const outboundTopic = await this.retrieveCommunicationTopics(accountId);\n\n const responseSequenceNumber = response.topicSequenceNumber?.toNumber();\n\n if (!responseSequenceNumber) {\n throw new Error('Failed to get response sequence number');\n }\n\n await this.submitPayload(outboundTopic.outboundTopic, {\n ...connectionRequestMessage,\n outbound_topic_id: outboundTopic.outboundTopic,\n connection_request_id: responseSequenceNumber,\n });\n\n return response;\n }\n\n async inscribeFile(\n buffer: Buffer,\n fileName: string,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n waitMaxAttempts?: number;\n waitIntervalMs?: number;\n }\n ): Promise<RetrievedInscriptionResult> {\n this.logger.info('Inscribing file');\n if (!this.client.operatorAccountId) {\n this.logger.error('Operator account ID is not set');\n throw new Error('Operator account ID is not set');\n }\n\n if (!this.operatorPrivateKey) {\n this.logger.error('Operator private key is not set');\n throw new Error('Operator private key is not set');\n }\n\n const mimeType = mime.lookup(fileName) || 'application/octet-stream';\n\n const sdk = await InscriptionSDK.createWithAuth({\n type: 'server',\n accountId: this.client.operatorAccountId.toString(),\n privateKey: this.operatorPrivateKey.toString(),\n network: this.network as 'testnet' | 'mainnet',\n });\n\n const inscriptionOptions = {\n mode: 'file' as const,\n waitForConfirmation: true,\n waitMaxAttempts: options?.waitMaxAttempts || 30,\n waitIntervalMs: options?.waitIntervalMs || 4000,\n progressCallback: options?.progressCallback,\n logging: {\n level: this.logger.getLevel ? this.logger.getLevel() : 'info',\n },\n };\n\n const response = await inscribe(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n {\n accountId: this.client.operatorAccountId.toString(),\n privateKey: this.operatorPrivateKey.toString(),\n network: this.network as 'testnet' | 'mainnet',\n },\n inscriptionOptions,\n sdk\n );\n\n if (!response.confirmed || !response.inscription) {\n throw new Error('Inscription was not confirmed');\n }\n\n return response.inscription;\n }\n\n /**\n * Waits for confirmation of a connection request\n * @param inboundTopicId Inbound topic ID\n * @param connectionRequestId Connection request ID\n * @param maxAttempts Maximum number of attempts\n * @param delayMs Delay between attempts in milliseconds\n * @returns Connection confirmation details\n */\n async waitForConnectionConfirmation(\n inboundTopicId: string,\n connectionRequestId: number,\n maxAttempts = 60,\n delayMs = 2000,\n recordConfirmation = true\n ): Promise<WaitForConnectionConfirmationResponse> {\n this.logger.info(\n `Waiting for connection confirmation on inbound topic ${inboundTopicId} for request ID ${connectionRequestId}`\n );\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n this.logger.info(\n `Attempt ${attempt + 1}/${maxAttempts} to find connection confirmation`\n );\n const messages = await this.mirrorNode.getTopicMessages(inboundTopicId);\n\n const connectionCreatedMessages = messages.filter(\n (m) => m.op === 'connection_created'\n );\n\n this.logger.info(\n `Found ${connectionCreatedMessages.length} connection_created messages`\n );\n\n if (connectionCreatedMessages.length > 0) {\n for (const message of connectionCreatedMessages) {\n if (Number(message.connection_id) === Number(connectionRequestId)) {\n const confirmationResult = {\n connectionTopicId: message.connection_topic_id,\n sequence_number: Number(message.sequence_number),\n confirmedBy: message.operator_id,\n memo: message.m,\n };\n\n const confirmedByAccountId = this.extractAccountFromOperatorId(\n confirmationResult.confirmedBy\n );\n\n const account = this.getAccountAndSigner();\n const confirmedByConnectionTopics =\n await this.retrieveCommunicationTopics(confirmedByAccountId);\n\n const agentConnectionTopics =\n await this.retrieveCommunicationTopics(account.accountId);\n\n this.logger.info(\n 'Connection confirmation found',\n confirmationResult\n );\n\n if (recordConfirmation) {\n /**\n * Record's the confirmation of the connection request from the\n * confirmedBy account to the agent account.\n */\n await this.recordOutboundConnectionConfirmation({\n requestorOutboundTopicId:\n confirmedByConnectionTopics.outboundTopic,\n outboundTopicId: agentConnectionTopics.outboundTopic,\n connectionRequestId,\n confirmedRequestId: confirmationResult.sequence_number,\n connectionTopicId: confirmationResult.connectionTopicId,\n operatorId: confirmationResult.confirmedBy,\n memo: confirmationResult.memo || 'Connection confirmed',\n });\n }\n\n return confirmationResult;\n }\n }\n }\n\n if (attempt < maxAttempts - 1) {\n this.logger.info(\n `No matching confirmation found, waiting ${delayMs}ms before retrying...`\n );\n await new Promise((resolve) => setTimeout(resolve, delayMs));\n }\n }\n\n throw new Error(\n `Connection confirmation not found after ${maxAttempts} attempts for request ID ${connectionRequestId}`\n );\n }\n\n getAccountAndSigner(): GetAccountAndSignerResponse {\n return {\n accountId: this.client.operatorAccountId!.toString()!,\n signer: this.operatorPrivateKey,\n };\n }\n\n /**\n * Creates and registers an agent with a Guarded registry.\n *\n * This function performs the following steps:\n * 1. Creates a new account if no existing account is provided.\n * 2. Initializes an HCS10 client with the new account.\n * 3. Creates an agent on the client.\n * 4. Registers the agent with the Hashgraph Online Guarded Registry.\n *\n * @param builder The agent builder object\n * @param options Optional configuration including progress callback and state management\n * @returns Agent registration result\n */\n async createAndRegisterAgent(\n builder: AgentBuilder,\n options?: {\n baseUrl?: string;\n progressCallback?: RegistrationProgressCallback;\n existingState?: AgentCreationState;\n }\n ): Promise<AgentRegistrationResult> {\n try {\n const config = builder.build();\n const progressCallback = options?.progressCallback;\n const baseUrl = options?.baseUrl || this.guardedRegistryBaseUrl;\n let state = options?.existingState || undefined;\n\n if (progressCallback) {\n progressCallback({\n stage: 'preparing',\n message: 'Preparing agent registration',\n progressPercent: 10,\n details: { state },\n });\n }\n\n const account = config.existingAccount || (await this.createAccount());\n\n if (progressCallback) {\n progressCallback({\n stage: 'preparing',\n message: 'Created account or using existing account',\n progressPercent: 20,\n details: { state, account },\n });\n }\n\n const agentClient = new HCS10Client({\n network: config.network,\n operatorId: account.accountId,\n operatorPrivateKey: account.privateKey,\n operatorPublicKey: PrivateKey.fromString(\n account.privateKey\n ).publicKey.toString(),\n logLevel: 'info' as LogLevel,\n guardedRegistryBaseUrl: baseUrl,\n });\n\n if (progressCallback) {\n progressCallback({\n stage: 'preparing',\n message: 'Initialized agent client',\n progressPercent: 30,\n details: { state },\n });\n }\n\n const { outboundTopicId, inboundTopicId, pfpTopicId, profileTopicId } =\n await agentClient.createAgent(builder);\n\n if (progressCallback) {\n progressCallback({\n stage: 'submitting',\n message: 'Created agent with topics and profile',\n progressPercent: 60,\n details: {\n state,\n outboundTopicId,\n inboundTopicId,\n pfpTopicId,\n profileTopicId,\n },\n });\n }\n\n const operatorId = `${inboundTopicId}@${account.accountId}`;\n\n const registrationResult =\n await agentClient.registerAgentWithGuardedRegistry(\n account.accountId,\n config.network,\n {\n progressCallback: (data) => {\n const adjustedPercent = 60 + (data.progressPercent || 0) * 0.4;\n if (progressCallback) {\n progressCallback({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: {\n ...data.details,\n outboundTopicId,\n inboundTopicId,\n pfpTopicId,\n profileTopicId,\n operatorId,\n state: data.details?.state || state,\n },\n });\n }\n },\n existingState: state,\n }\n );\n\n if (!registrationResult.success) {\n return registrationResult;\n }\n\n if (progressCallback) {\n progressCallback({\n stage: 'completed',\n message: 'Agent creation and registration complete',\n progressPercent: 100,\n details: {\n outboundTopicId,\n inboundTopicId,\n pfpTopicId,\n profileTopicId,\n operatorId,\n state: registrationResult.state,\n },\n });\n }\n\n return {\n ...registrationResult,\n metadata: {\n accountId: account.accountId,\n privateKey: account.privateKey,\n operatorId,\n inboundTopicId,\n outboundTopicId,\n profileTopicId,\n pfpTopicId,\n },\n };\n } catch (error: any) {\n this.logger.error(\n `Failed to create and register agent: ${error.message}`\n );\n return {\n error: error.message,\n success: false,\n };\n }\n }\n\n /**\n * Registers an agent with the guarded registry\n * @param accountId Account ID to register\n * @param inboundTopicId Inbound topic ID for the agent\n * @param network Network type ('mainnet' or 'testnet')\n * @param options Optional configuration including progress callback and confirmation settings\n * @returns Registration result\n */\n async registerAgentWithGuardedRegistry(\n accountId: string,\n network: string = this.network,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n maxAttempts?: number;\n delayMs?: number;\n existingState?: AgentCreationState;\n }\n ): Promise<AgentRegistrationResult> {\n try {\n this.logger.info('Registering agent with guarded registry');\n\n const maxAttempts = options?.maxAttempts ?? 60;\n const delayMs = options?.delayMs ?? 2000;\n const progressCallback = options?.progressCallback;\n let state =\n options?.existingState ||\n ({\n currentStage: 'registration',\n completedPercentage: 0,\n createdResources: [],\n } as AgentCreationState);\n\n if (progressCallback) {\n progressCallback({\n stage: 'preparing',\n message: 'Preparing agent registration',\n progressPercent: 10,\n details: {\n state,\n },\n });\n }\n\n const registrationResult = await this.executeRegistration(\n accountId,\n network,\n this.guardedRegistryBaseUrl,\n this.logger\n );\n\n if (!registrationResult.success) {\n return {\n ...registrationResult,\n state,\n };\n }\n\n if (progressCallback) {\n progressCallback({\n stage: 'submitting',\n message: 'Submitting registration to registry',\n progressPercent: 30,\n details: {\n transactionId: registrationResult.transactionId,\n state,\n },\n });\n }\n\n if (registrationResult.transaction) {\n const transaction = Transaction.fromBytes(\n Buffer.from(registrationResult.transaction, 'base64')\n );\n\n this.logger.info(`Processing registration transaction`);\n await transaction.execute(this.client);\n this.logger.info(`Successfully processed registration transaction`);\n }\n\n if (progressCallback) {\n progressCallback({\n stage: 'confirming',\n message: 'Confirming registration transaction',\n progressPercent: 60,\n details: {\n accountId,\n transactionId: registrationResult.transactionId,\n state,\n },\n });\n }\n\n const confirmed = await this.waitForRegistrationConfirmation(\n registrationResult.transactionId!,\n network,\n this.guardedRegistryBaseUrl,\n maxAttempts,\n delayMs,\n this.logger\n );\n\n state.currentStage = 'complete';\n state.completedPercentage = 100;\n if (!state.createdResources) {\n state.createdResources = [];\n }\n if (registrationResult.transactionId) {\n state.createdResources.push(\n `registration:${registrationResult.transactionId}`\n );\n }\n\n if (progressCallback) {\n progressCallback({\n stage: 'completed',\n message: 'Agent registration complete',\n progressPercent: 100,\n details: {\n confirmed,\n transactionId: registrationResult.transactionId,\n state,\n },\n });\n }\n\n return {\n ...registrationResult,\n confirmed,\n state,\n };\n } catch (error: any) {\n this.logger.error(`Failed to register agent: ${error.message}`);\n return {\n error: error.message,\n success: false,\n };\n }\n }\n\n /**\n * Registers an agent with the guarded registry. Should be called by a registry.\n * @param registryTopicId - The topic ID of the guarded registry.\n * @param accountId - The account ID of the agent\n * @param inboundTopicId - The topic ID of the inbound topic\n * @param memo - The memo of the agent\n * @param submitKey - The submit key of the agent\n */\n async registerAgent(\n registryTopicId: string,\n accountId: string,\n inboundTopicId: string,\n memo: string,\n submitKey?: PrivateKey\n ): Promise<void> {\n this.logger.info('Registering agent');\n const payload = {\n p: 'hcs-10',\n op: 'register',\n account_id: accountId,\n inbound_topic_id: inboundTopicId,\n m: memo,\n };\n\n await this.submitPayload(registryTopicId, payload, submitKey);\n }\n\n async getInboundTopicType(topicId: string): Promise<InboundTopicType> {\n try {\n const topicInfo = await this.mirrorNode.getTopicInfo(topicId);\n\n if (!topicInfo) {\n throw new Error('Topic does not exist');\n }\n\n const hasSubmitKey = topicInfo.submit_key && topicInfo.submit_key.key;\n\n if (!hasSubmitKey) {\n return InboundTopicType.PUBLIC;\n }\n\n const hasFeeScheduleKey =\n topicInfo.fee_schedule_key && topicInfo.fee_schedule_key.key;\n\n if (hasFeeScheduleKey && topicInfo.custom_fees) {\n const customFees = topicInfo.custom_fees;\n\n if (\n customFees &&\n customFees.fixed_fees &&\n customFees.fixed_fees.length > 0\n ) {\n this.logger.info(\n `Topic ${topicId} is fee-based with ${customFees.fixed_fees.length} custom fees`\n );\n return InboundTopicType.FEE_BASED;\n }\n }\n\n return InboundTopicType.CONTROLLED;\n } catch (error: any) {\n this.logger.error(`Error determining topic type: ${error.message}`);\n throw new Error(`Failed to determine topic type: ${error.message}`);\n }\n }\n\n getNetwork(): string {\n return this.network;\n }\n\n getLogger(): Logger {\n return this.logger;\n }\n}\n"],"names":["mime.lookup"],"mappings":";;;;;;;;;;;AAwDO,MAAM,oBAAoB,gBAAgB;AAAA,EAQ/C,YAAY,QAAyB;AAC7B,UAAA;AAAA,MACJ,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,MACjB,aAAa,OAAO;AAAA,MACpB,WAAW,OAAO;AAAA,IAAA,CACnB;AACI,SAAA,SACH,OAAO,YAAY,YAAY,OAAO,WAAW,IAAI,OAAO,WAAW;AACzE,SAAK,qBAAqB,WAAW,WAAW,OAAO,kBAAkB;AACzE,SAAK,UAAU,OAAO;AACtB,SAAK,OAAO;AAAA,MACV,OAAO;AAAA,MACP,KAAK,mBAAmB,SAAS;AAAA,IACnC;AACK,SAAA,SAAS,OAAO,YAAY;AAAA,MAC/B,OAAO,OAAO,YAAY;AAAA,MAC1B,QAAQ;AAAA,IAAA,CACT;AACI,SAAA,yBACH,OAAO,0BAA0B;AAE9B,SAAA,cAAc,IAAI,YAAY;AAAA,MACjC,SAAS,OAAO;AAAA,MAChB,MAAM;AAAA,QACJ,YAAY,OAAO;AAAA,QACnB,YAAY,OAAO;AAAA,MACrB;AAAA,MACA,UAAU,OAAO;AAAA,IAAA,CAClB;AAAA,EAAA;AAAA,EAGI,YAAY;AACjB,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOd,MAAM,gBAAgD;AAC/C,SAAA,OAAO,KAAK,sBAAsB;AACjC,UAAA,SAAS,WAAW,SAAS;AAEnC,UAAM,qBAAqB,IAAI,yBAAyB,EACrD,OAAO,OAAO,SAAS,EACvB,kBAAkB,IAAI,KAAK,EAAE,CAAC;AAE5B,SAAA,OAAO,MAAM,wCAAwC;AAC1D,UAAM,kBAAkB,MAA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AA;AAAA;AAAA,EAWF,MAAM,cACJ,iBACA,WACA,gBACA,MACA,WACe;AACV,SAAA,OAAO,KAAK,mBAAmB;AACpC,UAAM,UAAU;AAAA,MACd,GAAG;AAAA,MACH,IAAI;AAAA,MACJ,YAAY;AAAA,MACZ,kBAAkB;AAAA,MAClB,GAAG;AAAA,IACL;AAEA,UAAM,KAAK,cAAc,iBAAiB,SAAS,SAAS;AAAA,EAAA;AAAA,EAG9D,MAAM,oBAAoB,SAA4C;AAChE,QAAA;AACF,YAAM,YAAY,MAAM,KAAK,WAAW,aAAa,OAAO;AAE5D,UAAI,CAAC,WAAW;AACR,cAAA,IAAI,MAAM,sBAAsB;AAAA,MAAA;AAGxC,YAAM,eAAe,UAAU,cAAc,UAAU,WAAW;AAElE,UAAI,CAAC,cAAc;AACjB,eAAO,iBAAiB;AAAA,MAAA;AAG1B,YAAM,oBACJ,UAAU,oBAAoB,UAAU,iBAAiB;AAEvD,UAAA,qBAAqB,UAAU,aAAa;AAC9C,cAAM,aAAa,UAAU;AAE7B,YACE,cACA,WAAW,cACX,WAAW,WAAW,SAAS,GAC/B;AACA,eAAK,OAAO;AAAA,YACV,SAAS,OAAO,sBAAsB,WAAW,WAAW,MAAM;AAAA,UACpE;AACA,iBAAO,iBAAiB;AAAA,QAAA;AAAA,MAC1B;AAGF,aAAO,iBAAiB;AAAA,aACjB,OAAY;AACnB,WAAK,OAAO,MAAM,iCAAiC,MAAM,OAAO,EAAE;AAClE,YAAM,IAAI,MAAM,mCAAmC,MAAM,OAAO,EAAE;AAAA,IAAA;AAAA,EACpE;AAAA,EAGF,aAAqB;AACnB,WAAO,KAAK;AAAA,EAAA;AAAA,EAGd,YAAoB;AAClB,WAAO,KAAK;AAAA,EAAA;AAEhB;"}
1
+ {"version":3,"file":"standards-sdk.es7.js","sources":["../../src/hcs-10/sdk.ts"],"sourcesContent":["import {\n Client,\n AccountCreateTransaction,\n PrivateKey,\n Hbar,\n KeyList,\n TopicCreateTransaction,\n TopicMessageSubmitTransaction,\n TopicId,\n Transaction,\n TransactionResponse,\n TransactionReceipt,\n PublicKey,\n AccountId,\n CustomFixedFee,\n TokenId,\n} from '@hashgraph/sdk';\nimport {\n PayloadSizeError,\n AccountCreationError,\n TopicCreationError,\n ConnectionConfirmationError,\n} from './errors';\nimport {\n InscriptionSDK,\n RetrievedInscriptionResult,\n} from '@kiloscribe/inscription-sdk';\nimport { Logger, LogLevel } from '../utils/logger';\nimport { HCS10BaseClient } from './base-client';\nimport * as mime from 'mime-types';\nimport {\n HCSClientConfig,\n CreateAccountResponse,\n CreateAgentResponse,\n StoreHCS11ProfileResponse,\n AgentRegistrationResult,\n HandleConnectionRequestResponse,\n WaitForConnectionConfirmationResponse,\n GetAccountAndSignerResponse,\n AgentCreationState,\n RegistrationProgressCallback,\n InscribePfpResponse,\n} from './types';\nimport {\n HCS11Client,\n AgentMetadata as HCS11AgentMetadata,\n SocialLink,\n SocialPlatform,\n InboundTopicType,\n AgentMetadata,\n} from '../hcs-11';\nimport { FeeConfigBuilderInterface, TopicFeeConfig } from '../fees';\nimport { TopicResponse } from '../services/types';\nimport { accountIdsToExemptKeys } from '../utils/topic-fee-utils';\nimport { Hcs10MemoType } from './base-client';\nimport { AgentBuilder } from '../hcs-11/agent-builder';\nimport { inscribe } from '../inscribe/inscriber';\nimport { TokenFeeConfig } from '../fees/types';\n\nexport class HCS10Client extends HCS10BaseClient {\n private client: Client;\n private operatorPrivateKey: PrivateKey;\n protected declare network: string;\n protected declare logger: Logger;\n protected guardedRegistryBaseUrl: string;\n private hcs11Client: HCS11Client;\n\n constructor(config: HCSClientConfig) {\n super({\n network: config.network,\n logLevel: config.logLevel,\n prettyPrint: config.prettyPrint,\n feeAmount: config.feeAmount,\n });\n this.client =\n config.network === 'mainnet' ? Client.forMainnet() : Client.forTestnet();\n this.operatorPrivateKey = PrivateKey.fromString(config.operatorPrivateKey);\n this.network = config.network;\n this.client.setOperator(\n config.operatorId,\n this.operatorPrivateKey.toString()\n );\n this.logger = Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS-SDK',\n });\n this.guardedRegistryBaseUrl =\n config.guardedRegistryBaseUrl || 'https://moonscape.tech';\n\n this.hcs11Client = new HCS11Client({\n network: config.network,\n auth: {\n operatorId: config.operatorId,\n privateKey: config.operatorPrivateKey,\n },\n logLevel: config.logLevel,\n });\n }\n\n public getClient() {\n return this.client;\n }\n\n /**\n * Creates a new Hedera account\n * @param initialBalance Optional initial balance in HBAR (default: 50)\n * @returns Object with account ID and private key\n */\n async createAccount(\n initialBalance: number = 50\n ): Promise<CreateAccountResponse> {\n this.logger.info(\n `Creating new account with ${initialBalance} HBAR initial balance`\n );\n const newKey = PrivateKey.generate();\n\n const accountTransaction = new AccountCreateTransaction()\n .setKey(newKey.publicKey)\n .setInitialBalance(new Hbar(initialBalance));\n\n this.logger.debug('Executing account creation transaction');\n const accountResponse = await accountTransaction.execute(this.client);\n const accountReceipt = await accountResponse.getReceipt(this.client);\n const newAccountId = accountReceipt.accountId;\n\n if (!newAccountId) {\n this.logger.error('Account creation failed: accountId is null');\n throw new AccountCreationError(\n 'Failed to create account: accountId is null'\n );\n }\n\n this.logger.info(\n `Account created successfully: ${newAccountId.toString()}`\n );\n return {\n accountId: newAccountId.toString(),\n privateKey: newKey.toString(),\n };\n }\n\n /**\n * Creates an inbound topic for an agent\n * @param accountId The account ID associated with the inbound topic\n * @param topicType Type of inbound topic (public, controlled, or fee-based)\n * @param ttl Optional Time-To-Live for the topic memo, defaults to 60\n * @param feeConfigBuilder Optional fee configuration builder for fee-based topics\n * @returns The topic ID of the created inbound topic\n */\n async createInboundTopic(\n accountId: string,\n topicType: InboundTopicType,\n ttl: number = 60,\n feeConfigBuilder?: FeeConfigBuilderInterface\n ): Promise<string> {\n const memo = this._generateHcs10Memo(Hcs10MemoType.INBOUND, {\n accountId,\n ttl,\n });\n\n let submitKey: boolean | PublicKey | KeyList | undefined;\n let finalFeeConfig: TopicFeeConfig | undefined;\n\n switch (topicType) {\n case InboundTopicType.PUBLIC:\n submitKey = false;\n break;\n case InboundTopicType.CONTROLLED:\n submitKey = true;\n break;\n case InboundTopicType.FEE_BASED:\n submitKey = false;\n if (!feeConfigBuilder) {\n throw new Error(\n 'Fee configuration builder is required for fee-based topics'\n );\n }\n\n const internalFees = (feeConfigBuilder as any)\n .customFees as TokenFeeConfig[];\n internalFees.forEach((fee) => {\n if (!fee.feeCollectorAccountId) {\n this.logger.debug(\n `Defaulting fee collector for token ${\n fee.feeTokenId || 'HBAR'\n } to agent ${accountId}`\n );\n fee.feeCollectorAccountId = accountId;\n }\n });\n\n finalFeeConfig = feeConfigBuilder.build();\n break;\n default:\n throw new Error(`Unsupported inbound topic type: ${topicType}`);\n }\n\n return this.createTopic(memo, true, submitKey, finalFeeConfig);\n }\n\n /**\n * Creates a new agent with inbound and outbound topics\n * @param builder The agent builder object\n * @param ttl Optional Time-To-Live for the topic memos, defaults to 60\n * @returns Object with topic IDs\n */\n async createAgent(\n builder: AgentBuilder,\n ttl: number = 60\n ): Promise<CreateAgentResponse> {\n const config = builder.build();\n const outboundMemo = this._generateHcs10Memo(Hcs10MemoType.OUTBOUND, {\n ttl,\n });\n const outboundTopicId = await this.createTopic(outboundMemo, true, true);\n this.logger.info(`Created new outbound topic ID: ${outboundTopicId}`);\n\n const accountId = this.client.operatorAccountId?.toString();\n if (!accountId) {\n throw new Error('Failed to retrieve operator account ID');\n }\n\n const inboundTopicId = await this.createInboundTopic(\n accountId,\n config.inboundTopicType,\n ttl,\n config.inboundTopicType === InboundTopicType.FEE_BASED\n ? config.feeConfig\n : undefined\n );\n\n let pfpTopicId = config.existingPfpTopicId || '';\n\n if (!pfpTopicId && config.pfpBuffer && config.pfpBuffer.length > 0) {\n this.logger.info('Inscribing new profile picture');\n const pfpResult = await this.inscribePfp(\n config.pfpBuffer,\n config.pfpFileName\n );\n pfpTopicId = pfpResult.pfpTopicId;\n this.logger.info(\n `Profile picture inscribed with topic ID: ${pfpTopicId}`\n );\n } else if (config.existingPfpTopicId) {\n this.logger.info(\n `Using existing profile picture with topic ID: ${config.existingPfpTopicId}`\n );\n }\n\n const profileResult = await this.storeHCS11Profile(\n config.name,\n config.bio,\n inboundTopicId,\n outboundTopicId,\n config.capabilities,\n config.metadata,\n config.pfpBuffer && config.pfpBuffer.length > 0\n ? config.pfpBuffer\n : undefined,\n config.pfpFileName,\n config.existingPfpTopicId\n );\n const profileTopicId = profileResult.profileTopicId;\n this.logger.info(`Profile stored with topic ID: ${profileTopicId}`);\n\n return {\n inboundTopicId,\n outboundTopicId,\n pfpTopicId,\n profileTopicId,\n };\n }\n\n /**\n * Inscribes a profile picture to Hedera\n * @param buffer Profile picture buffer\n * @param fileName Filename\n * @returns Response with topic ID and transaction ID\n */\n async inscribePfp(\n buffer: Buffer,\n fileName: string\n ): Promise<InscribePfpResponse> {\n try {\n this.logger.info('Inscribing profile picture using HCS-11 client');\n\n const imageResult = await this.hcs11Client.inscribeImage(\n buffer,\n fileName\n );\n\n if (!imageResult.success) {\n this.logger.error(\n `Failed to inscribe profile picture: ${imageResult.error}`\n );\n throw new Error(\n imageResult?.error || 'Failed to inscribe profile picture'\n );\n }\n\n this.logger.info(\n `Successfully inscribed profile picture with topic ID: ${imageResult.imageTopicId}`\n );\n return {\n pfpTopicId: imageResult.imageTopicId,\n transactionId: imageResult.transactionId,\n success: true,\n };\n } catch (error: any) {\n this.logger.error(`Error inscribing profile picture: ${error.message}`);\n return {\n pfpTopicId: '',\n transactionId: '',\n success: false,\n error: error.message,\n };\n }\n }\n\n /**\n * Stores an HCS-11 profile for an agent\n * @param agentName Agent name\n * @param agentBio Agent description\n * @param inboundTopicId Inbound topic ID\n * @param outboundTopicId Outbound topic ID\n * @param capabilities Agent capability tags\n * @param metadata Additional metadata\n * @param pfpBuffer Optional profile picture buffer\n * @param pfpFileName Optional profile picture filename\n * @returns Response with topic IDs and transaction ID\n */\n async storeHCS11Profile(\n agentName: string,\n agentBio: string,\n inboundTopicId: string,\n outboundTopicId: string,\n capabilities: number[] = [],\n metadata: AgentMetadata,\n pfpBuffer?: Buffer,\n pfpFileName?: string,\n existingPfpTopicId?: string\n ): Promise<StoreHCS11ProfileResponse> {\n try {\n let pfpTopicId = existingPfpTopicId || '';\n\n if (!pfpTopicId && pfpBuffer && pfpFileName) {\n this.logger.info('Inscribing profile picture for HCS-11 profile');\n const pfpResult = await this.inscribePfp(pfpBuffer, pfpFileName);\n if (!pfpResult.success) {\n this.logger.warn(\n `Failed to inscribe profile picture: ${pfpResult.error}, proceeding without pfp`\n );\n } else {\n pfpTopicId = pfpResult.pfpTopicId;\n }\n } else if (existingPfpTopicId) {\n this.logger.info(\n `Using existing profile picture with topic ID: ${existingPfpTopicId} for HCS-11 profile`\n );\n pfpTopicId = existingPfpTopicId;\n }\n\n const agentType = this.hcs11Client.getAgentTypeFromMetadata({\n type: metadata.type || 'autonomous',\n } as HCS11AgentMetadata);\n\n const formattedSocials: SocialLink[] | undefined = metadata.socials\n ? (Object.entries(metadata.socials)\n .filter(([_, handle]) => handle)\n .map(([platform, handle]) => ({\n platform: platform as SocialPlatform,\n handle: handle as string,\n })) as SocialLink[])\n : undefined;\n\n const profile = this.hcs11Client.createAIAgentProfile(\n agentName,\n agentType,\n capabilities,\n metadata.model || 'unknown',\n {\n alias: agentName.toLowerCase().replace(/\\s+/g, '_'),\n bio: agentBio,\n profileImage: pfpTopicId ? `hcs://1/${pfpTopicId}` : undefined,\n socials: formattedSocials,\n properties: metadata.properties,\n inboundTopicId,\n outboundTopicId,\n creator: metadata.creator,\n }\n );\n\n const profileResult = await this.hcs11Client.createAndInscribeProfile(\n profile,\n true\n );\n\n if (!profileResult.success) {\n this.logger.error(`Failed to inscribe profile: ${profileResult.error}`);\n throw new Error(profileResult.error || 'Failed to inscribe profile');\n }\n\n this.logger.info(\n `Profile inscribed with topic ID: ${profileResult.profileTopicId}, transaction ID: ${profileResult.transactionId}`\n );\n\n return {\n profileTopicId: profileResult.profileTopicId,\n pfpTopicId,\n transactionId: profileResult.transactionId,\n success: true,\n };\n } catch (error: any) {\n this.logger.error(`Error storing HCS-11 profile: ${error.message}`);\n return {\n profileTopicId: '',\n pfpTopicId: '',\n transactionId: '',\n success: false,\n error: error.message,\n };\n }\n }\n\n private async setupFees(\n transaction: TopicCreateTransaction,\n feeConfig: TopicFeeConfig,\n additionalExemptAccounts: string[] = []\n ): Promise<TopicCreateTransaction> {\n let modifiedTransaction = transaction;\n if (!this.client.operatorPublicKey) {\n return modifiedTransaction;\n }\n\n if (!feeConfig.customFees || feeConfig.customFees.length === 0) {\n this.logger.warn('No custom fees provided in fee config for setupFees');\n return modifiedTransaction;\n }\n\n if (feeConfig.customFees.length > 10) {\n this.logger.warn(\n 'More than 10 custom fees provided, only the first 10 will be used'\n );\n feeConfig.customFees = feeConfig.customFees.slice(0, 10);\n }\n\n const customFees = feeConfig.customFees\n .map((fee) => {\n if (!fee.feeCollectorAccountId) {\n this.logger.error(\n 'Internal Error: Fee collector ID missing in setupFees'\n );\n return null;\n }\n if (fee.type === 'FIXED_FEE') {\n const customFee = new CustomFixedFee()\n .setAmount(Number(fee.feeAmount.amount))\n .setFeeCollectorAccountId(\n AccountId.fromString(fee.feeCollectorAccountId)\n );\n\n if (fee.feeTokenId) {\n customFee.setDenominatingTokenId(\n TokenId.fromString(fee.feeTokenId)\n );\n }\n\n return customFee;\n }\n return null;\n })\n .filter(Boolean) as CustomFixedFee[];\n\n if (customFees.length === 0) {\n this.logger.warn('No valid custom fees to apply in setupFees');\n return modifiedTransaction;\n }\n\n const exemptAccountIds = [\n ...(feeConfig.exemptAccounts || []),\n ...additionalExemptAccounts,\n ];\n\n if (exemptAccountIds.length > 0) {\n modifiedTransaction = await this.setupExemptKeys(\n transaction,\n exemptAccountIds\n );\n }\n\n return modifiedTransaction\n .setFeeScheduleKey(this.client.operatorPublicKey)\n .setCustomFees(customFees);\n }\n\n private async setupExemptKeys(\n transaction: TopicCreateTransaction,\n exemptAccountIds: string[]\n ): Promise<TopicCreateTransaction> {\n let modifiedTransaction = transaction;\n const uniqueExemptAccountIds = Array.from(new Set(exemptAccountIds));\n const filteredExemptAccounts = uniqueExemptAccountIds.filter(\n (account) => account !== this.client.operatorAccountId?.toString()\n );\n\n let exemptKeys: PublicKey[] = [];\n if (filteredExemptAccounts.length > 0) {\n try {\n exemptKeys = await accountIdsToExemptKeys(\n filteredExemptAccounts,\n this.network,\n this.logger\n );\n } catch (error) {\n this.logger.warn(\n `Error getting exempt keys: ${error}, continuing without exempt keys`\n );\n }\n }\n\n if (exemptKeys.length > 0) {\n modifiedTransaction = modifiedTransaction.setFeeExemptKeys(exemptKeys);\n }\n\n return modifiedTransaction;\n }\n\n /**\n * Handles a connection request from another account\n * @param inboundTopicId Inbound topic ID of your agent\n * @param requestingAccountId Requesting account ID\n * @param connectionRequestId Connection request ID\n * @param connectionFeeConfig Optional fee configuration for the connection topic\n * @param ttl Optional ttl parameter with default\n * @returns Response with connection details\n */\n async handleConnectionRequest(\n inboundTopicId: string,\n requestingAccountId: string,\n connectionRequestId: number,\n connectionFeeConfig?: FeeConfigBuilderInterface,\n ttl: number = 60\n ): Promise<HandleConnectionRequestResponse> {\n const memo = this._generateHcs10Memo(Hcs10MemoType.CONNECTION, {\n ttl,\n inboundTopicId,\n connectionId: connectionRequestId,\n });\n this.logger.info(\n `Handling connection request ${connectionRequestId} from ${requestingAccountId}`\n );\n\n const accountId = this.getClient().operatorAccountId?.toString();\n if (!accountId) {\n throw new Error('Failed to retrieve operator account ID');\n }\n\n let requesterKey = await this.mirrorNode.getPublicKey(requestingAccountId);\n const accountKey = await this.mirrorNode.getPublicKey(accountId);\n\n if (!accountKey) {\n throw new Error('Failed to retrieve public key');\n }\n\n const thresholdKey = new KeyList([accountKey, requesterKey], 1);\n\n let connectionTopicId: string;\n\n try {\n if (connectionFeeConfig) {\n const feeConfig = connectionFeeConfig.build();\n const modifiedFeeConfig = {\n ...feeConfig,\n exemptAccounts: [...(feeConfig.exemptAccounts || [])],\n };\n\n connectionTopicId = await this.createTopic(\n memo,\n thresholdKey,\n thresholdKey,\n modifiedFeeConfig\n );\n } else {\n connectionTopicId = await this.createTopic(\n memo,\n thresholdKey,\n thresholdKey\n );\n }\n\n this.logger.info(`Created new connection topic ID: ${connectionTopicId}`);\n } catch (error) {\n this.logger.error(`Failed to create connection topic: ${error}`);\n throw new TopicCreationError(\n `Failed to create connection topic: ${error}`\n );\n }\n\n const operatorId = `${inboundTopicId}@${accountId}`;\n\n const confirmedConnectionSequenceNumber = await this.confirmConnection(\n inboundTopicId,\n connectionTopicId,\n requestingAccountId,\n connectionRequestId,\n 'Connection accepted. Looking forward to collaborating!'\n );\n\n const accountTopics = await this.retrieveCommunicationTopics(accountId);\n\n const requestingAccountTopics = await this.retrieveCommunicationTopics(\n requestingAccountId\n );\n\n const requestingAccountOperatorId = `${requestingAccountTopics.inboundTopic}@${requestingAccountId}`;\n\n await this.recordOutboundConnectionConfirmation({\n outboundTopicId: accountTopics.outboundTopic,\n requestorOutboundTopicId: requestingAccountTopics.outboundTopic,\n connectionRequestId: connectionRequestId,\n confirmedRequestId: confirmedConnectionSequenceNumber,\n connectionTopicId,\n operatorId: requestingAccountOperatorId,\n memo: `Connection established with ${requestingAccountId}`,\n });\n\n return {\n connectionTopicId,\n confirmedConnectionSequenceNumber,\n operatorId,\n };\n }\n\n /**\n * Confirms a connection request from another account\n * @param inboundTopicId Inbound topic ID\n * @param connectionTopicId Connection topic ID\n * @param connectedAccountId Connected account ID\n * @param connectionId Connection ID\n * @param memo Memo for the connection request\n * @param submitKey Optional submit key\n * @returns Sequence number of the confirmed connection\n */\n async confirmConnection(\n inboundTopicId: string,\n connectionTopicId: string,\n connectedAccountId: string,\n connectionId: number,\n memo: string,\n submitKey?: PrivateKey\n ): Promise<number> {\n const operatorId = await this.getOperatorId();\n this.logger.info(`Confirming connection with ID ${connectionId}`);\n const payload = {\n p: 'hcs-10',\n op: 'connection_created',\n connection_topic_id: connectionTopicId,\n connected_account_id: connectedAccountId,\n operator_id: operatorId,\n connection_id: connectionId,\n m: memo,\n };\n\n const submissionCheck = await this.canSubmitToTopic(\n inboundTopicId,\n this.client.operatorAccountId?.toString() || ''\n );\n\n const result = await this.submitPayload(\n inboundTopicId,\n payload,\n submitKey,\n submissionCheck.requiresFee\n );\n\n const sequenceNumber = result.topicSequenceNumber?.toNumber();\n\n if (!sequenceNumber) {\n throw new ConnectionConfirmationError(\n 'Failed to confirm connection: sequence number is null'\n );\n }\n\n return sequenceNumber;\n }\n\n async sendMessage(\n connectionTopicId: string,\n data: string,\n memo?: string,\n submitKey?: PrivateKey,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n waitMaxAttempts?: number;\n waitIntervalMs?: number;\n }\n ): Promise<TransactionReceipt> {\n const submissionCheck = await this.canSubmitToTopic(\n connectionTopicId,\n this.client.operatorAccountId?.toString() || ''\n );\n\n const operatorId = await this.getOperatorId();\n\n const payload = {\n p: 'hcs-10',\n op: 'message',\n operator_id: operatorId,\n data,\n m: memo,\n };\n\n const payloadString = JSON.stringify(payload);\n const isLargePayload = Buffer.from(payloadString).length > 1000;\n\n if (isLargePayload) {\n this.logger.info(\n 'Message payload exceeds 1000 bytes, storing via inscription'\n );\n try {\n const contentBuffer = Buffer.from(data);\n const fileName = `message-${Date.now()}.json`;\n const inscriptionResult = await this.inscribeFile(\n contentBuffer,\n fileName,\n {\n progressCallback: options?.progressCallback,\n waitMaxAttempts: options?.waitMaxAttempts,\n waitIntervalMs: options?.waitIntervalMs,\n }\n );\n\n if (inscriptionResult?.topic_id) {\n payload.data = `hcs://1/${inscriptionResult.topic_id}`;\n this.logger.info(\n `Large message inscribed with topic ID: ${inscriptionResult.topic_id}`\n );\n } else {\n throw new Error('Failed to inscribe large message content');\n }\n } catch (error) {\n this.logger.error('Error inscribing large message:', error);\n throw new Error(\n `Failed to handle large message: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`\n );\n }\n }\n\n this.logger.info('Submitting message to connection topic', payload);\n return await this.submitPayload(\n connectionTopicId,\n payload,\n submitKey,\n submissionCheck.requiresFee\n );\n }\n\n async createTopic(\n memo: string,\n adminKey?: boolean | PublicKey | KeyList,\n submitKey?: boolean | PublicKey | KeyList,\n feeConfig?: TopicFeeConfig\n ): Promise<string> {\n this.logger.info('Creating topic');\n const transaction = new TopicCreateTransaction().setTopicMemo(memo);\n\n if (adminKey) {\n if (\n typeof adminKey === 'boolean' &&\n adminKey &&\n this.client.operatorPublicKey\n ) {\n transaction.setAdminKey(this.client.operatorPublicKey);\n transaction.setAutoRenewAccountId(this.client.operatorAccountId!);\n } else if (adminKey instanceof PublicKey || adminKey instanceof KeyList) {\n transaction.setAdminKey(adminKey);\n if (this.client.operatorAccountId) {\n transaction.setAutoRenewAccountId(this.client.operatorAccountId);\n }\n }\n }\n\n if (submitKey) {\n if (\n typeof submitKey === 'boolean' &&\n submitKey &&\n this.client.operatorPublicKey\n ) {\n transaction.setSubmitKey(this.client.operatorPublicKey);\n } else if (\n submitKey instanceof PublicKey ||\n submitKey instanceof KeyList\n ) {\n transaction.setSubmitKey(submitKey);\n }\n }\n\n if (feeConfig) {\n await this.setupFees(transaction, feeConfig);\n }\n\n this.logger.debug('Executing topic creation transaction');\n const txResponse = await transaction.execute(this.client);\n const receipt = await txResponse.getReceipt(this.client);\n\n if (!receipt.topicId) {\n this.logger.error('Failed to create topic: topicId is null');\n throw new Error('Failed to create topic: topicId is null');\n }\n\n const topicId = receipt.topicId.toString();\n return topicId;\n }\n\n public async submitPayload(\n topicId: string,\n payload: object | string,\n submitKey?: PrivateKey,\n requiresFee: boolean = false\n ): Promise<TransactionReceipt> {\n const message =\n typeof payload === 'string' ? payload : JSON.stringify(payload);\n\n const payloadSizeInBytes = Buffer.byteLength(message, 'utf8');\n if (payloadSizeInBytes > 1000) {\n throw new PayloadSizeError(\n 'Payload size exceeds 1000 bytes limit',\n payloadSizeInBytes\n );\n }\n\n const transaction = new TopicMessageSubmitTransaction()\n .setTopicId(TopicId.fromString(topicId))\n .setMessage(message);\n\n if (requiresFee) {\n this.logger.info(\n 'Topic requires fee payment, setting max transaction fee'\n );\n transaction.setMaxTransactionFee(new Hbar(this.feeAmount));\n }\n\n let transactionResponse: TransactionResponse;\n if (submitKey) {\n const frozenTransaction = transaction.freezeWith(this.client);\n const signedTransaction = await frozenTransaction.sign(submitKey);\n transactionResponse = await signedTransaction.execute(this.client);\n } else {\n transactionResponse = await transaction.execute(this.client);\n }\n\n const receipt = await transactionResponse.getReceipt(this.client);\n if (!receipt) {\n this.logger.error('Failed to submit message: receipt is null');\n throw new Error('Failed to submit message: receipt is null');\n }\n this.logger.info('Message submitted successfully');\n return receipt;\n }\n\n async submitConnectionRequest(\n inboundTopicId: string,\n memo: string\n ): Promise<TransactionReceipt> {\n const accountResponse = this.getAccountAndSigner();\n if (!accountResponse.accountId) {\n throw new Error('Operator account ID is not set');\n }\n const operatorId = await this.getOperatorId();\n const accountId = accountResponse.accountId;\n\n const submissionCheck = await this.canSubmitToTopic(\n inboundTopicId,\n accountId\n );\n\n if (!submissionCheck.canSubmit) {\n throw new Error(`Cannot submit to topic: ${submissionCheck.reason}`);\n }\n\n const connectionRequestMessage = {\n p: 'hcs-10',\n op: 'connection_request',\n operator_id: operatorId,\n m: memo,\n };\n\n const requiresFee = submissionCheck.requiresFee;\n const response = await this.submitPayload(\n inboundTopicId,\n connectionRequestMessage,\n undefined,\n requiresFee\n );\n\n this.logger.info(\n `Submitted connection request to topic ID: ${inboundTopicId}`\n );\n\n const outboundTopic = await this.retrieveCommunicationTopics(accountId);\n\n const responseSequenceNumber = response.topicSequenceNumber?.toNumber();\n\n if (!responseSequenceNumber) {\n throw new Error('Failed to get response sequence number');\n }\n\n await this.submitPayload(outboundTopic.outboundTopic, {\n ...connectionRequestMessage,\n outbound_topic_id: outboundTopic.outboundTopic,\n connection_request_id: responseSequenceNumber,\n });\n\n return response;\n }\n\n async inscribeFile(\n buffer: Buffer,\n fileName: string,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n waitMaxAttempts?: number;\n waitIntervalMs?: number;\n }\n ): Promise<RetrievedInscriptionResult> {\n this.logger.info('Inscribing file');\n if (!this.client.operatorAccountId) {\n this.logger.error('Operator account ID is not set');\n throw new Error('Operator account ID is not set');\n }\n\n if (!this.operatorPrivateKey) {\n this.logger.error('Operator private key is not set');\n throw new Error('Operator private key is not set');\n }\n\n const mimeType = mime.lookup(fileName) || 'application/octet-stream';\n\n const sdk = await InscriptionSDK.createWithAuth({\n type: 'server',\n accountId: this.client.operatorAccountId.toString(),\n privateKey: this.operatorPrivateKey.toString(),\n network: this.network as 'testnet' | 'mainnet',\n });\n\n const inscriptionOptions = {\n mode: 'file' as const,\n waitForConfirmation: true,\n waitMaxAttempts: options?.waitMaxAttempts || 30,\n waitIntervalMs: options?.waitIntervalMs || 4000,\n progressCallback: options?.progressCallback,\n logging: {\n level: this.logger.getLevel ? this.logger.getLevel() : 'info',\n },\n };\n\n const response = await inscribe(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n {\n accountId: this.client.operatorAccountId.toString(),\n privateKey: this.operatorPrivateKey.toString(),\n network: this.network as 'testnet' | 'mainnet',\n },\n inscriptionOptions,\n sdk\n );\n\n if (!response.confirmed || !response.inscription) {\n throw new Error('Inscription was not confirmed');\n }\n\n return response.inscription;\n }\n\n /**\n * Waits for confirmation of a connection request\n * @param inboundTopicId Inbound topic ID\n * @param connectionRequestId Connection request ID\n * @param maxAttempts Maximum number of attempts\n * @param delayMs Delay between attempts in milliseconds\n * @returns Connection confirmation details\n */\n async waitForConnectionConfirmation(\n inboundTopicId: string,\n connectionRequestId: number,\n maxAttempts = 60,\n delayMs = 2000,\n recordConfirmation = true\n ): Promise<WaitForConnectionConfirmationResponse> {\n this.logger.info(\n `Waiting for connection confirmation on inbound topic ${inboundTopicId} for request ID ${connectionRequestId}`\n );\n\n for (let attempt = 0; attempt < maxAttempts; attempt++) {\n this.logger.info(\n `Attempt ${attempt + 1}/${maxAttempts} to find connection confirmation`\n );\n const messages = await this.mirrorNode.getTopicMessages(inboundTopicId);\n\n const connectionCreatedMessages = messages.filter(\n (m) => m.op === 'connection_created'\n );\n\n this.logger.info(\n `Found ${connectionCreatedMessages.length} connection_created messages`\n );\n\n if (connectionCreatedMessages.length > 0) {\n for (const message of connectionCreatedMessages) {\n if (Number(message.connection_id) === Number(connectionRequestId)) {\n const confirmationResult = {\n connectionTopicId: message.connection_topic_id,\n sequence_number: Number(message.sequence_number),\n confirmedBy: message.operator_id,\n memo: message.m,\n };\n\n const confirmedByAccountId = this.extractAccountFromOperatorId(\n confirmationResult.confirmedBy\n );\n\n const account = this.getAccountAndSigner();\n const confirmedByConnectionTopics =\n await this.retrieveCommunicationTopics(confirmedByAccountId);\n\n const agentConnectionTopics =\n await this.retrieveCommunicationTopics(account.accountId);\n\n this.logger.info(\n 'Connection confirmation found',\n confirmationResult\n );\n\n if (recordConfirmation) {\n /**\n * Record's the confirmation of the connection request from the\n * confirmedBy account to the agent account.\n */\n await this.recordOutboundConnectionConfirmation({\n requestorOutboundTopicId:\n confirmedByConnectionTopics.outboundTopic,\n outboundTopicId: agentConnectionTopics.outboundTopic,\n connectionRequestId,\n confirmedRequestId: confirmationResult.sequence_number,\n connectionTopicId: confirmationResult.connectionTopicId,\n operatorId: confirmationResult.confirmedBy,\n memo: confirmationResult.memo || 'Connection confirmed',\n });\n }\n\n return confirmationResult;\n }\n }\n }\n\n if (attempt < maxAttempts - 1) {\n this.logger.info(\n `No matching confirmation found, waiting ${delayMs}ms before retrying...`\n );\n await new Promise((resolve) => setTimeout(resolve, delayMs));\n }\n }\n\n throw new Error(\n `Connection confirmation not found after ${maxAttempts} attempts for request ID ${connectionRequestId}`\n );\n }\n\n getAccountAndSigner(): GetAccountAndSignerResponse {\n return {\n accountId: this.client.operatorAccountId!.toString()!,\n signer: this.operatorPrivateKey,\n };\n }\n\n /**\n * Creates and registers an agent with a Guarded registry.\n *\n * This function performs the following steps:\n * 1. Creates a new account if no existing account is provided.\n * 2. Initializes an HCS10 client with the new account.\n * 3. Creates an agent on the client.\n * 4. Registers the agent with the Hashgraph Online Guarded Registry.\n *\n * @param builder The agent builder object\n * @param options Optional configuration including progress callback and state management\n * @returns Agent registration result\n */\n async createAndRegisterAgent(\n builder: AgentBuilder,\n options?: {\n baseUrl?: string;\n progressCallback?: RegistrationProgressCallback;\n existingState?: AgentCreationState;\n initialBalance?: number;\n }\n ): Promise<AgentRegistrationResult> {\n try {\n const config = builder.build();\n const progressCallback = options?.progressCallback;\n const baseUrl = options?.baseUrl || this.guardedRegistryBaseUrl;\n let state = options?.existingState || undefined;\n\n if (progressCallback) {\n progressCallback({\n stage: 'preparing',\n message: 'Preparing agent registration',\n progressPercent: 10,\n details: { state },\n });\n }\n\n const account =\n config.existingAccount ||\n (await this.createAccount(options?.initialBalance));\n\n if (progressCallback) {\n progressCallback({\n stage: 'preparing',\n message: 'Created account or using existing account',\n progressPercent: 20,\n details: { state, account },\n });\n }\n\n const agentClient = new HCS10Client({\n network: config.network,\n operatorId: account.accountId,\n operatorPrivateKey: account.privateKey,\n operatorPublicKey: PrivateKey.fromString(\n account.privateKey\n ).publicKey.toString(),\n logLevel: 'info' as LogLevel,\n guardedRegistryBaseUrl: baseUrl,\n });\n\n if (progressCallback) {\n progressCallback({\n stage: 'preparing',\n message: 'Initialized agent client',\n progressPercent: 30,\n details: { state },\n });\n }\n\n const { outboundTopicId, inboundTopicId, pfpTopicId, profileTopicId } =\n await agentClient.createAgent(builder);\n\n if (progressCallback) {\n progressCallback({\n stage: 'submitting',\n message: 'Created agent with topics and profile',\n progressPercent: 60,\n details: {\n state,\n outboundTopicId,\n inboundTopicId,\n pfpTopicId,\n profileTopicId,\n },\n });\n }\n\n const operatorId = `${inboundTopicId}@${account.accountId}`;\n\n const registrationResult =\n await agentClient.registerAgentWithGuardedRegistry(\n account.accountId,\n config.network,\n {\n progressCallback: (data) => {\n const adjustedPercent = 60 + (data.progressPercent || 0) * 0.4;\n if (progressCallback) {\n progressCallback({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: {\n ...data.details,\n outboundTopicId,\n inboundTopicId,\n pfpTopicId,\n profileTopicId,\n operatorId,\n state: data.details?.state || state,\n },\n });\n }\n },\n existingState: state,\n }\n );\n\n if (!registrationResult.success) {\n return registrationResult;\n }\n\n if (progressCallback) {\n progressCallback({\n stage: 'completed',\n message: 'Agent creation and registration complete',\n progressPercent: 100,\n details: {\n outboundTopicId,\n inboundTopicId,\n pfpTopicId,\n profileTopicId,\n operatorId,\n state: registrationResult.state,\n },\n });\n }\n\n return {\n ...registrationResult,\n metadata: {\n accountId: account.accountId,\n privateKey: account.privateKey,\n operatorId,\n inboundTopicId,\n outboundTopicId,\n profileTopicId,\n pfpTopicId,\n },\n };\n } catch (error: any) {\n this.logger.error(\n `Failed to create and register agent: ${error.message}`\n );\n return {\n error: error.message,\n success: false,\n };\n }\n }\n\n /**\n * Registers an agent with the guarded registry\n * @param accountId Account ID to register\n * @param inboundTopicId Inbound topic ID for the agent\n * @param network Network type ('mainnet' or 'testnet')\n * @param options Optional configuration including progress callback and confirmation settings\n * @returns Registration result\n */\n async registerAgentWithGuardedRegistry(\n accountId: string,\n network: string = this.network,\n options?: {\n progressCallback?: RegistrationProgressCallback;\n maxAttempts?: number;\n delayMs?: number;\n existingState?: AgentCreationState;\n }\n ): Promise<AgentRegistrationResult> {\n try {\n this.logger.info('Registering agent with guarded registry');\n\n const maxAttempts = options?.maxAttempts ?? 60;\n const delayMs = options?.delayMs ?? 2000;\n const progressCallback = options?.progressCallback;\n let state =\n options?.existingState ||\n ({\n currentStage: 'registration',\n completedPercentage: 0,\n createdResources: [],\n } as AgentCreationState);\n\n if (progressCallback) {\n progressCallback({\n stage: 'preparing',\n message: 'Preparing agent registration',\n progressPercent: 10,\n details: {\n state,\n },\n });\n }\n\n const registrationResult = await this.executeRegistration(\n accountId,\n network,\n this.guardedRegistryBaseUrl,\n this.logger\n );\n\n if (!registrationResult.success) {\n return {\n ...registrationResult,\n state,\n };\n }\n\n if (progressCallback) {\n progressCallback({\n stage: 'submitting',\n message: 'Submitting registration to registry',\n progressPercent: 30,\n details: {\n transactionId: registrationResult.transactionId,\n state,\n },\n });\n }\n\n if (registrationResult.transaction) {\n const transaction = Transaction.fromBytes(\n Buffer.from(registrationResult.transaction, 'base64')\n );\n\n this.logger.info(`Processing registration transaction`);\n await transaction.execute(this.client);\n this.logger.info(`Successfully processed registration transaction`);\n }\n\n if (progressCallback) {\n progressCallback({\n stage: 'confirming',\n message: 'Confirming registration transaction',\n progressPercent: 60,\n details: {\n accountId,\n transactionId: registrationResult.transactionId,\n state,\n },\n });\n }\n\n const confirmed = await this.waitForRegistrationConfirmation(\n registrationResult.transactionId!,\n network,\n this.guardedRegistryBaseUrl,\n maxAttempts,\n delayMs,\n this.logger\n );\n\n state.currentStage = 'complete';\n state.completedPercentage = 100;\n if (!state.createdResources) {\n state.createdResources = [];\n }\n if (registrationResult.transactionId) {\n state.createdResources.push(\n `registration:${registrationResult.transactionId}`\n );\n }\n\n if (progressCallback) {\n progressCallback({\n stage: 'completed',\n message: 'Agent registration complete',\n progressPercent: 100,\n details: {\n confirmed,\n transactionId: registrationResult.transactionId,\n state,\n },\n });\n }\n\n return {\n ...registrationResult,\n confirmed,\n state,\n };\n } catch (error: any) {\n this.logger.error(`Failed to register agent: ${error.message}`);\n return {\n error: error.message,\n success: false,\n };\n }\n }\n\n /**\n * Registers an agent with the guarded registry. Should be called by a registry.\n * @param registryTopicId - The topic ID of the guarded registry.\n * @param accountId - The account ID of the agent\n * @param inboundTopicId - The topic ID of the inbound topic\n * @param memo - The memo of the agent\n * @param submitKey - The submit key of the agent\n */\n async registerAgent(\n registryTopicId: string,\n accountId: string,\n inboundTopicId: string,\n memo: string,\n submitKey?: PrivateKey\n ): Promise<void> {\n this.logger.info('Registering agent');\n const payload = {\n p: 'hcs-10',\n op: 'register',\n account_id: accountId,\n inbound_topic_id: inboundTopicId,\n m: memo,\n };\n\n await this.submitPayload(registryTopicId, payload, submitKey);\n }\n\n async getInboundTopicType(topicId: string): Promise<InboundTopicType> {\n try {\n const topicInfo = await this.mirrorNode.getTopicInfo(topicId);\n\n if (!topicInfo) {\n throw new Error('Topic does not exist');\n }\n\n const hasSubmitKey = topicInfo.submit_key && topicInfo.submit_key.key;\n\n if (!hasSubmitKey) {\n return InboundTopicType.PUBLIC;\n }\n\n const hasFeeScheduleKey =\n topicInfo.fee_schedule_key && topicInfo.fee_schedule_key.key;\n\n if (hasFeeScheduleKey && topicInfo.custom_fees) {\n const customFees = topicInfo.custom_fees;\n\n if (\n customFees &&\n customFees.fixed_fees &&\n customFees.fixed_fees.length > 0\n ) {\n this.logger.info(\n `Topic ${topicId} is fee-based with ${customFees.fixed_fees.length} custom fees`\n );\n return InboundTopicType.FEE_BASED;\n }\n }\n\n return InboundTopicType.CONTROLLED;\n } catch (error: any) {\n this.logger.error(`Error determining topic type: ${error.message}`);\n throw new Error(`Failed to determine topic type: ${error.message}`);\n }\n }\n\n getNetwork(): string {\n return this.network;\n }\n\n getLogger(): Logger {\n return this.logger;\n }\n\n /**\n * Public method to get the operator account ID configured for this client instance.\n * @returns The operator account ID string, or null if not set.\n */\n getOperatorAccountId(): string | null {\n return this.client.operatorAccountId?.toString() ?? null;\n }\n}\n"],"names":["mime.lookup"],"mappings":";;;;;;;;;;;AA2DO,MAAM,oBAAoB,gBAAgB;AAAA,EAQ/C,YAAY,QAAyB;AAC7B,UAAA;AAAA,MACJ,SAAS,OAAO;AAAA,MAChB,UAAU,OAAO;AAAA,MACjB,aAAa,OAAO;AAAA,MACpB,WAAW,OAAO;AAAA,IAAA,CACnB;AACI,SAAA,SACH,OAAO,YAAY,YAAY,OAAO,WAAW,IAAI,OAAO,WAAW;AACzE,SAAK,qBAAqB,WAAW,WAAW,OAAO,kBAAkB;AACzE,SAAK,UAAU,OAAO;AACtB,SAAK,OAAO;AAAA,MACV,OAAO;AAAA,MACP,KAAK,mBAAmB,SAAS;AAAA,IACnC;AACK,SAAA,SAAS,OAAO,YAAY;AA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ACjB,OAAY;AACnB,WAAK,OAAO,MAAM,iCAAiC,MAAM,OAAO,EAAE;AAClE,YAAM,IAAI,MAAM,mCAAmC,MAAM,OAAO,EAAE;AAAA,IAAA;AAAA,EACpE;AAAA,EAGF,aAAqB;AACnB,WAAO,KAAK;AAAA,EAAA;AAAA,EAGd,YAAoB;AAClB,WAAO,KAAK;AAAA,EAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOd,uBAAsC;AACpC,WAAO,KAAK,OAAO,mBAAmB,SAAc,KAAA;AAAA,EAAA;AAExD;"}
@@ -1,7 +1,16 @@
1
- function isCancel(value) {
2
- return !!(value && value.__CANCEL__);
3
- }
1
+ import URLSearchParams from "./standards-sdk.es82.js";
2
+ import FormData from "./standards-sdk.es83.js";
3
+ import Blob from "./standards-sdk.es84.js";
4
+ const platform = {
5
+ isBrowser: true,
6
+ classes: {
7
+ URLSearchParams,
8
+ FormData,
9
+ Blob
10
+ },
11
+ protocols: ["http", "https", "file", "blob", "url", "data"]
12
+ };
4
13
  export {
5
- isCancel as default
14
+ platform as default
6
15
  };
7
16
  //# sourceMappingURL=standards-sdk.es70.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es70.js","sources":["../../node_modules/axios/lib/cancel/isCancel.js"],"sourcesContent":["'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n"],"names":[],"mappings":"AAEe,SAAS,SAAS,OAAO;AACtC,SAAO,CAAC,EAAE,SAAS,MAAM;AAC3B;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es70.js","sources":["../../node_modules/axios/lib/platform/browser/index.js"],"sourcesContent":["import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n"],"names":[],"mappings":";;;AAIA,MAAe,WAAA;AAAA,EACb,WAAW;AAAA,EACX,SAAS;AAAA,IACP;AAAA,IACA;AAAA,IACA;AAAA,EACD;AAAA,EACD,WAAW,CAAC,QAAQ,SAAS,QAAQ,QAAQ,OAAO,MAAM;AAC5D;","x_google_ignoreList":[0]}
@@ -1,5 +1,16 @@
1
- const VERSION = "1.8.4";
1
+ const hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined";
2
+ const _navigator = typeof navigator === "object" && navigator || void 0;
3
+ const hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0);
4
+ const hasStandardBrowserWebWorkerEnv = (() => {
5
+ return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef
6
+ self instanceof WorkerGlobalScope && typeof self.importScripts === "function";
7
+ })();
8
+ const origin = hasBrowserEnv && window.location.href || "http://localhost";
2
9
  export {
3
- VERSION
10
+ hasBrowserEnv,
11
+ hasStandardBrowserEnv,
12
+ hasStandardBrowserWebWorkerEnv,
13
+ _navigator as navigator,
14
+ origin
4
15
  };
5
16
  //# sourceMappingURL=standards-sdk.es71.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es71.js","sources":["../../node_modules/axios/lib/env/data.js"],"sourcesContent":["export const VERSION = \"1.8.4\";"],"names":[],"mappings":"AAAY,MAAC,UAAU;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"standards-sdk.es71.js","sources":["../../node_modules/axios/lib/platform/common/utils.js"],"sourcesContent":["const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n"],"names":[],"mappings":"AAAK,MAAC,gBAAgB,OAAO,WAAW,eAAe,OAAO,aAAa;AAEtE,MAAC,aAAa,OAAO,cAAc,YAAY,aAAa;AAmB5D,MAAC,wBAAwB,kBAC3B,CAAC,cAAc,CAAC,eAAe,gBAAgB,IAAI,EAAE,QAAQ,WAAW,OAAO,IAAI;AAWjF,MAAC,kCAAkC,MAAM;AAC5C,SACE,OAAO,sBAAsB;AAAA,EAE7B,gBAAgB,qBAChB,OAAO,KAAK,kBAAkB;AAElC,GAAC;AAEI,MAAC,SAAS,iBAAiB,OAAO,SAAS,QAAQ;","x_google_ignoreList":[0]}