@hashgraphonline/standards-sdk 0.1.137 → 0.1.138

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 (229) hide show
  1. package/dist/cjs/hcs-21/base-client.d.ts +31 -0
  2. package/dist/cjs/hcs-21/base-client.d.ts.map +1 -0
  3. package/dist/cjs/hcs-21/browser.d.ts +20 -0
  4. package/dist/cjs/hcs-21/browser.d.ts.map +1 -0
  5. package/dist/cjs/hcs-21/errors.d.ts +6 -0
  6. package/dist/cjs/hcs-21/errors.d.ts.map +1 -0
  7. package/dist/cjs/hcs-21/index.d.ts +7 -0
  8. package/dist/cjs/hcs-21/index.d.ts.map +1 -0
  9. package/dist/cjs/hcs-21/sdk.d.ts +48 -0
  10. package/dist/cjs/hcs-21/sdk.d.ts.map +1 -0
  11. package/dist/cjs/hcs-21/tx.d.ts +20 -0
  12. package/dist/cjs/hcs-21/tx.d.ts.map +1 -0
  13. package/dist/cjs/hcs-21/types.d.ts +72 -0
  14. package/dist/cjs/hcs-21/types.d.ts.map +1 -0
  15. package/dist/cjs/index.d.ts +1 -0
  16. package/dist/cjs/index.d.ts.map +1 -1
  17. package/dist/cjs/services/registry-broker/client.d.ts.map +1 -1
  18. package/dist/cjs/services/types.d.ts +1 -1
  19. package/dist/cjs/services/types.d.ts.map +1 -1
  20. package/dist/cjs/standards-sdk.cjs +2 -2
  21. package/dist/cjs/standards-sdk.cjs.map +1 -1
  22. package/dist/es/hcs-21/base-client.d.ts +31 -0
  23. package/dist/es/hcs-21/base-client.d.ts.map +1 -0
  24. package/dist/es/hcs-21/browser.d.ts +20 -0
  25. package/dist/es/hcs-21/browser.d.ts.map +1 -0
  26. package/dist/es/hcs-21/errors.d.ts +6 -0
  27. package/dist/es/hcs-21/errors.d.ts.map +1 -0
  28. package/dist/es/hcs-21/index.d.ts +7 -0
  29. package/dist/es/hcs-21/index.d.ts.map +1 -0
  30. package/dist/es/hcs-21/sdk.d.ts +48 -0
  31. package/dist/es/hcs-21/sdk.d.ts.map +1 -0
  32. package/dist/es/hcs-21/tx.d.ts +20 -0
  33. package/dist/es/hcs-21/tx.d.ts.map +1 -0
  34. package/dist/es/hcs-21/types.d.ts +72 -0
  35. package/dist/es/hcs-21/types.d.ts.map +1 -0
  36. package/dist/es/index.d.ts +1 -0
  37. package/dist/es/index.d.ts.map +1 -1
  38. package/dist/es/services/registry-broker/client.d.ts.map +1 -1
  39. package/dist/es/services/types.d.ts +1 -1
  40. package/dist/es/services/types.d.ts.map +1 -1
  41. package/dist/es/standards-sdk.es.js +66 -48
  42. package/dist/es/standards-sdk.es.js.map +1 -1
  43. package/dist/es/standards-sdk.es10.js +2 -2
  44. package/dist/es/standards-sdk.es100.js +231 -28
  45. package/dist/es/standards-sdk.es100.js.map +1 -1
  46. package/dist/es/standards-sdk.es101.js +109 -18
  47. package/dist/es/standards-sdk.es101.js.map +1 -1
  48. package/dist/es/standards-sdk.es102.js +32 -158
  49. package/dist/es/standards-sdk.es102.js.map +1 -1
  50. package/dist/es/standards-sdk.es103.js +80 -204
  51. package/dist/es/standards-sdk.es103.js.map +1 -1
  52. package/dist/es/standards-sdk.es104.js +21 -780
  53. package/dist/es/standards-sdk.es104.js.map +1 -1
  54. package/dist/es/standards-sdk.es105.js +140 -11
  55. package/dist/es/standards-sdk.es105.js.map +1 -1
  56. package/dist/es/standards-sdk.es106.js +29 -567
  57. package/dist/es/standards-sdk.es106.js.map +1 -1
  58. package/dist/es/standards-sdk.es107.js +17 -597
  59. package/dist/es/standards-sdk.es107.js.map +1 -1
  60. package/dist/es/standards-sdk.es108.js +159 -12
  61. package/dist/es/standards-sdk.es108.js.map +1 -1
  62. package/dist/es/standards-sdk.es109.js +208 -2
  63. package/dist/es/standards-sdk.es109.js.map +1 -1
  64. package/dist/es/standards-sdk.es110.js +774 -67
  65. package/dist/es/standards-sdk.es110.js.map +1 -1
  66. package/dist/es/standards-sdk.es111.js +11 -37
  67. package/dist/es/standards-sdk.es111.js.map +1 -1
  68. package/dist/es/standards-sdk.es112.js +567 -2
  69. package/dist/es/standards-sdk.es112.js.map +1 -1
  70. package/dist/es/standards-sdk.es113.js +576 -197
  71. package/dist/es/standards-sdk.es113.js.map +1 -1
  72. package/dist/es/standards-sdk.es114.js +12 -1139
  73. package/dist/es/standards-sdk.es114.js.map +1 -1
  74. package/dist/es/standards-sdk.es115.js +2 -306
  75. package/dist/es/standards-sdk.es115.js.map +1 -1
  76. package/dist/es/standards-sdk.es116.js +79 -418
  77. package/dist/es/standards-sdk.es116.js.map +1 -1
  78. package/dist/es/standards-sdk.es117.js +35 -351
  79. package/dist/es/standards-sdk.es117.js.map +1 -1
  80. package/dist/es/standards-sdk.es118.js +2 -761
  81. package/dist/es/standards-sdk.es118.js.map +1 -1
  82. package/dist/es/standards-sdk.es119.js +204 -185
  83. package/dist/es/standards-sdk.es119.js.map +1 -1
  84. package/dist/es/standards-sdk.es12.js +1 -1
  85. package/dist/es/standards-sdk.es120.js +1055 -1482
  86. package/dist/es/standards-sdk.es120.js.map +1 -1
  87. package/dist/es/standards-sdk.es121.js +265 -2024
  88. package/dist/es/standards-sdk.es121.js.map +1 -1
  89. package/dist/es/standards-sdk.es122.js +420 -50
  90. package/dist/es/standards-sdk.es122.js.map +1 -1
  91. package/dist/es/standards-sdk.es123.js +350 -82
  92. package/dist/es/standards-sdk.es123.js.map +1 -1
  93. package/dist/es/standards-sdk.es124.js +741 -139
  94. package/dist/es/standards-sdk.es124.js.map +1 -1
  95. package/dist/es/standards-sdk.es125.js +204 -7
  96. package/dist/es/standards-sdk.es125.js.map +1 -1
  97. package/dist/es/standards-sdk.es126.js +1533 -52
  98. package/dist/es/standards-sdk.es126.js.map +1 -1
  99. package/dist/es/standards-sdk.es127.js +2077 -59
  100. package/dist/es/standards-sdk.es127.js.map +1 -1
  101. package/dist/es/standards-sdk.es128.js +52 -28
  102. package/dist/es/standards-sdk.es128.js.map +1 -1
  103. package/dist/es/standards-sdk.es129.js +80 -131
  104. package/dist/es/standards-sdk.es129.js.map +1 -1
  105. package/dist/es/standards-sdk.es13.js +1 -1
  106. package/dist/es/standards-sdk.es130.js +152 -35
  107. package/dist/es/standards-sdk.es130.js.map +1 -1
  108. package/dist/es/standards-sdk.es131.js +7 -17
  109. package/dist/es/standards-sdk.es131.js.map +1 -1
  110. package/dist/es/standards-sdk.es132.js +53 -12241
  111. package/dist/es/standards-sdk.es132.js.map +1 -1
  112. package/dist/es/standards-sdk.es133.js +65 -694
  113. package/dist/es/standards-sdk.es133.js.map +1 -1
  114. package/dist/es/standards-sdk.es134.js +28 -172
  115. package/dist/es/standards-sdk.es134.js.map +1 -1
  116. package/dist/es/standards-sdk.es135.js +115 -299
  117. package/dist/es/standards-sdk.es135.js.map +1 -1
  118. package/dist/es/standards-sdk.es136.js +36 -340
  119. package/dist/es/standards-sdk.es136.js.map +1 -1
  120. package/dist/es/standards-sdk.es137.js +55 -452
  121. package/dist/es/standards-sdk.es137.js.map +1 -1
  122. package/dist/es/standards-sdk.es138.js +52 -319
  123. package/dist/es/standards-sdk.es138.js.map +1 -1
  124. package/dist/es/standards-sdk.es139.js +694 -76
  125. package/dist/es/standards-sdk.es139.js.map +1 -1
  126. package/dist/es/standards-sdk.es14.js +1 -1
  127. package/dist/es/standards-sdk.es140.js +15 -54
  128. package/dist/es/standards-sdk.es140.js.map +1 -1
  129. package/dist/es/standards-sdk.es141.js +12254 -44
  130. package/dist/es/standards-sdk.es141.js.map +1 -1
  131. package/dist/es/standards-sdk.es142.js +175 -0
  132. package/dist/es/standards-sdk.es142.js.map +1 -0
  133. package/dist/es/standards-sdk.es143.js +325 -0
  134. package/dist/es/standards-sdk.es143.js.map +1 -0
  135. package/dist/es/standards-sdk.es144.js +349 -0
  136. package/dist/es/standards-sdk.es144.js.map +1 -0
  137. package/dist/es/standards-sdk.es145.js +456 -0
  138. package/dist/es/standards-sdk.es145.js.map +1 -0
  139. package/dist/es/standards-sdk.es146.js +334 -0
  140. package/dist/es/standards-sdk.es146.js.map +1 -0
  141. package/dist/es/standards-sdk.es147.js +79 -0
  142. package/dist/es/standards-sdk.es147.js.map +1 -0
  143. package/dist/es/standards-sdk.es15.js +1 -1
  144. package/dist/es/standards-sdk.es16.js +1 -1
  145. package/dist/es/standards-sdk.es17.js +5 -5
  146. package/dist/es/standards-sdk.es19.js +12 -12
  147. package/dist/es/standards-sdk.es20.js +9 -9
  148. package/dist/es/standards-sdk.es21.js +1 -1
  149. package/dist/es/standards-sdk.es22.js +1 -1
  150. package/dist/es/standards-sdk.es23.js +1 -1
  151. package/dist/es/standards-sdk.es24.js +1 -1
  152. package/dist/es/standards-sdk.es25.js +1 -1
  153. package/dist/es/standards-sdk.es26.js +1 -1
  154. package/dist/es/standards-sdk.es27.js +1 -1
  155. package/dist/es/standards-sdk.es28.js +12 -12
  156. package/dist/es/standards-sdk.es3.js +2 -2
  157. package/dist/es/standards-sdk.es31.js +2 -2
  158. package/dist/es/standards-sdk.es32.js +4 -4
  159. package/dist/es/standards-sdk.es33.js +1 -1
  160. package/dist/es/standards-sdk.es36.js +6 -6
  161. package/dist/es/standards-sdk.es37.js +4 -4
  162. package/dist/es/standards-sdk.es38.js +2 -2
  163. package/dist/es/standards-sdk.es39.js +2 -2
  164. package/dist/es/standards-sdk.es40.js +1 -1
  165. package/dist/es/standards-sdk.es41.js +1 -1
  166. package/dist/es/standards-sdk.es42.js +2 -2
  167. package/dist/es/standards-sdk.es47.js +1 -1
  168. package/dist/es/standards-sdk.es5.js +2 -2
  169. package/dist/es/standards-sdk.es52.js +1 -1
  170. package/dist/es/standards-sdk.es54.js +1 -1
  171. package/dist/es/standards-sdk.es57.js +2 -2
  172. package/dist/es/standards-sdk.es59.js +1 -1
  173. package/dist/es/standards-sdk.es6.js +2 -2
  174. package/dist/es/standards-sdk.es60.js +1 -1
  175. package/dist/es/standards-sdk.es61.js +7 -7
  176. package/dist/es/standards-sdk.es63.js +1 -1
  177. package/dist/es/standards-sdk.es65.js +2 -2
  178. package/dist/es/standards-sdk.es66.js +3 -3
  179. package/dist/es/standards-sdk.es69.js +2 -2
  180. package/dist/es/standards-sdk.es7.js +2 -2
  181. package/dist/es/standards-sdk.es70.js +3 -3
  182. package/dist/es/standards-sdk.es71.js +2 -2
  183. package/dist/es/standards-sdk.es72.js +1 -1
  184. package/dist/es/standards-sdk.es75.js +2 -2
  185. package/dist/es/standards-sdk.es77.js +2 -2
  186. package/dist/es/standards-sdk.es78.js +4 -4
  187. package/dist/es/standards-sdk.es79.js +1 -1
  188. package/dist/es/standards-sdk.es8.js +1 -1
  189. package/dist/es/standards-sdk.es80.js +25 -27
  190. package/dist/es/standards-sdk.es80.js.map +1 -1
  191. package/dist/es/standards-sdk.es81.js +6 -78
  192. package/dist/es/standards-sdk.es81.js.map +1 -1
  193. package/dist/es/standards-sdk.es82.js +27 -64
  194. package/dist/es/standards-sdk.es82.js.map +1 -1
  195. package/dist/es/standards-sdk.es83.js +67 -23
  196. package/dist/es/standards-sdk.es83.js.map +1 -1
  197. package/dist/es/standards-sdk.es84.js +165 -23
  198. package/dist/es/standards-sdk.es84.js.map +1 -1
  199. package/dist/es/standards-sdk.es85.js +31 -166
  200. package/dist/es/standards-sdk.es85.js.map +1 -1
  201. package/dist/es/standards-sdk.es86.js +24 -127
  202. package/dist/es/standards-sdk.es86.js.map +1 -1
  203. package/dist/es/standards-sdk.es87.js +65 -142
  204. package/dist/es/standards-sdk.es87.js.map +1 -1
  205. package/dist/es/standards-sdk.es88.js +52 -127
  206. package/dist/es/standards-sdk.es88.js.map +1 -1
  207. package/dist/es/standards-sdk.es89.js +26 -41
  208. package/dist/es/standards-sdk.es89.js.map +1 -1
  209. package/dist/es/standards-sdk.es90.js +23 -261
  210. package/dist/es/standards-sdk.es90.js.map +1 -1
  211. package/dist/es/standards-sdk.es91.js +162 -93
  212. package/dist/es/standards-sdk.es91.js.map +1 -1
  213. package/dist/es/standards-sdk.es92.js +112 -83
  214. package/dist/es/standards-sdk.es92.js.map +1 -1
  215. package/dist/es/standards-sdk.es93.js +156 -28
  216. package/dist/es/standards-sdk.es93.js.map +1 -1
  217. package/dist/es/standards-sdk.es94.js +133 -225
  218. package/dist/es/standards-sdk.es94.js.map +1 -1
  219. package/dist/es/standards-sdk.es95.js +40 -108
  220. package/dist/es/standards-sdk.es95.js.map +1 -1
  221. package/dist/es/standards-sdk.es96.js +253 -24
  222. package/dist/es/standards-sdk.es96.js.map +1 -1
  223. package/dist/es/standards-sdk.es97.js +96 -80
  224. package/dist/es/standards-sdk.es97.js.map +1 -1
  225. package/dist/es/standards-sdk.es98.js +91 -21
  226. package/dist/es/standards-sdk.es98.js.map +1 -1
  227. package/dist/es/standards-sdk.es99.js +28 -141
  228. package/dist/es/standards-sdk.es99.js.map +1 -1
  229. package/package.json +2 -1
@@ -1,162 +1,764 @@
1
- import { CustomFeeType } from "./standards-sdk.es125.js";
2
- import { HederaMirrorNode } from "./standards-sdk.es120.js";
3
- class FeeConfigBuilder {
4
- constructor(options) {
5
- this.customFees = [];
6
- this.logger = options.logger;
7
- this.mirrorNode = new HederaMirrorNode(options.network, options.logger);
8
- this.defaultCollectorAccountId = options.defaultCollectorAccountId || "";
1
+ import { InscriptionSDK } from "./standards-sdk.es141.js";
2
+ import { Logger } from "./standards-sdk.es105.js";
3
+ import { ProgressReporter } from "./standards-sdk.es108.js";
4
+ import { TransactionParser } from "./standards-sdk.es110.js";
5
+ import { isBrowser } from "./standards-sdk.es118.js";
6
+ import { fileTypeFromBuffer } from "file-type";
7
+ import { validateQuoteParameters, getCachedQuote, getOrCreateSDK, cacheQuote } from "./standards-sdk.es125.js";
8
+ let nodeModules = {};
9
+ async function loadNodeModules() {
10
+ if (isBrowser || nodeModules.readFileSync) {
11
+ return;
9
12
  }
10
- /**
11
- * Static factory method to create a FeeConfigBuilder with a single HBAR fee.
12
- * @param hbarAmount Amount in HBAR.
13
- * @param collectorAccountId Optional account ID to collect the fee. If omitted or undefined, defaults to the agent's own account ID during topic creation.
14
- * @param network Network type ('mainnet' or 'testnet').
15
- * @param logger Logger instance.
16
- * @param exemptAccounts Optional array of account IDs exempt from this fee.
17
- * @returns A configured FeeConfigBuilder instance.
18
- */
19
- static forHbar(hbarAmount, collectorAccountId, network, logger, exemptAccounts = []) {
20
- const builder = new FeeConfigBuilder({
21
- network,
22
- logger,
23
- defaultCollectorAccountId: collectorAccountId
24
- });
25
- return builder.addHbarFee(hbarAmount, collectorAccountId, exemptAccounts);
13
+ try {
14
+ const globalObj = typeof global !== "undefined" ? global : globalThis;
15
+ const req = globalObj.process?.mainModule?.require || globalObj.require;
16
+ if (typeof req === "function") {
17
+ const fs = req("fs");
18
+ const path = req("path");
19
+ nodeModules.readFileSync = fs.readFileSync;
20
+ nodeModules.basename = path.basename;
21
+ nodeModules.extname = path.extname;
22
+ } else {
23
+ throw new Error("require function not available");
24
+ }
25
+ } catch (error) {
26
+ console.warn(
27
+ "Node.js modules not available, file path operations will be disabled"
28
+ );
29
+ }
30
+ }
31
+ async function convertFileToBase64(filePath) {
32
+ if (isBrowser) {
33
+ throw new Error(
34
+ "File path operations are not supported in browser environment. Use buffer input type instead."
35
+ );
26
36
  }
27
- /**
28
- * Static factory method to create a FeeConfigBuilder with a single token fee.
29
- * Automatically fetches token decimals if not provided.
30
- * @param tokenAmount Amount of tokens.
31
- * @param feeTokenId Token ID for the fee.
32
- * @param collectorAccountId Optional account ID to collect the fee. If omitted or undefined, defaults to the agent's own account ID during topic creation.
33
- * @param network Network type ('mainnet' or 'testnet').
34
- * @param logger Logger instance.
35
- * @param exemptAccounts Optional array of account IDs exempt from this fee.
36
- * @param decimals Optional decimals for the token (fetched if omitted).
37
- * @returns A Promise resolving to a configured FeeConfigBuilder instance.
38
- */
39
- static async forToken(tokenAmount, feeTokenId, collectorAccountId, network, logger, exemptAccounts = [], decimals) {
40
- const builder = new FeeConfigBuilder({
41
- network,
42
- logger,
43
- defaultCollectorAccountId: collectorAccountId
44
- });
45
- await builder.addTokenFee(
46
- tokenAmount,
47
- feeTokenId,
48
- collectorAccountId,
49
- decimals,
50
- exemptAccounts
37
+ await loadNodeModules();
38
+ if (!nodeModules.readFileSync || !nodeModules.basename || !nodeModules.extname) {
39
+ throw new Error(
40
+ "Node.js file system modules are not available. Cannot read file from path."
51
41
  );
52
- return builder;
53
42
  }
54
- /**
55
- * Adds an HBAR fee configuration to the builder.
56
- * Allows chaining multiple fee additions.
57
- * @param hbarAmount The amount in HBAR (e.g., 0.5).
58
- * @param collectorAccountId Optional. The account ID to collect this fee. If omitted, defaults to the agent's own account ID during topic creation.
59
- * @param exemptAccountIds Optional. Accounts specifically exempt from *this* HBAR fee.
60
- * @returns This FeeConfigBuilder instance for chaining.
61
- */
62
- addHbarFee(hbarAmount, collectorAccountId, exemptAccountIds = []) {
63
- if (hbarAmount <= 0) {
64
- throw new Error("HBAR amount must be greater than zero");
65
- }
66
- this.customFees.push({
67
- feeAmount: {
68
- amount: hbarAmount * 1e8,
69
- decimals: 0
43
+ try {
44
+ const buffer = nodeModules.readFileSync(filePath);
45
+ const base64 = buffer.toString("base64");
46
+ const fileName = nodeModules.basename(filePath);
47
+ let mimeType = "application/octet-stream";
48
+ try {
49
+ const fileTypeResult = await fileTypeFromBuffer(buffer);
50
+ if (fileTypeResult) {
51
+ mimeType = fileTypeResult.mime;
52
+ }
53
+ } catch (error) {
54
+ const ext = nodeModules.extname(filePath).toLowerCase();
55
+ const mimeMap = {
56
+ ".txt": "text/plain",
57
+ ".json": "application/json",
58
+ ".html": "text/html",
59
+ ".css": "text/css",
60
+ ".js": "application/javascript",
61
+ ".png": "image/png",
62
+ ".jpg": "image/jpeg",
63
+ ".jpeg": "image/jpeg",
64
+ ".gif": "image/gif",
65
+ ".svg": "image/svg+xml",
66
+ ".pdf": "application/pdf"
67
+ };
68
+ mimeType = mimeMap[ext] || "application/octet-stream";
69
+ }
70
+ return { base64, fileName, mimeType };
71
+ } catch (error) {
72
+ throw new Error(
73
+ `Failed to read file ${filePath}: ${error.message}`
74
+ );
75
+ }
76
+ }
77
+ function normalizeClientConfig(cfg) {
78
+ return {
79
+ accountId: cfg.accountId,
80
+ privateKey: typeof cfg.privateKey === "string" ? cfg.privateKey : cfg.privateKey.toString(),
81
+ network: cfg.network
82
+ };
83
+ }
84
+ async function inscribe(input, clientConfig, options, existingSDK) {
85
+ const logger = Logger.getInstance({
86
+ module: "Inscriber",
87
+ ...options.logging
88
+ });
89
+ logger.info("Starting inscription process", {
90
+ type: input.type,
91
+ mode: options.mode || "file",
92
+ quoteOnly: options.quoteOnly || false,
93
+ ...input.type === "url" ? { url: input.url } : {},
94
+ ...input.type === "file" ? { path: input.path } : {},
95
+ ...input.type === "buffer" ? { fileName: input.fileName, bufferSize: input.buffer.byteLength } : {}
96
+ });
97
+ try {
98
+ if (options.quoteOnly) {
99
+ logger.debug("Quote-only mode requested, generating quote");
100
+ return await generateQuote(input, clientConfig, options, existingSDK);
101
+ }
102
+ if (options.mode === "hashinal" && options.metadata) {
103
+ validateHashinalMetadata(options.metadata, logger);
104
+ }
105
+ let sdk;
106
+ if (existingSDK) {
107
+ logger.debug("Using existing InscriptionSDK instance");
108
+ sdk = existingSDK;
109
+ } else if (options.apiKey) {
110
+ logger.debug("Initializing InscriptionSDK with API key");
111
+ sdk = new InscriptionSDK({
112
+ apiKey: options.apiKey,
113
+ network: clientConfig.network || "mainnet"
114
+ });
115
+ } else {
116
+ logger.debug("Initializing InscriptionSDK with server auth");
117
+ const normalized = normalizeClientConfig(clientConfig);
118
+ sdk = await InscriptionSDK.createWithAuth({
119
+ type: "server",
120
+ accountId: normalized.accountId,
121
+ privateKey: normalized.privateKey,
122
+ network: normalized.network || "mainnet"
123
+ });
124
+ }
125
+ const baseRequest = {
126
+ holderId: clientConfig.accountId,
127
+ metadata: options.metadata || {},
128
+ tags: options.tags || [],
129
+ mode: options.mode || "file",
130
+ fileStandard: options.fileStandard,
131
+ chunkSize: options.chunkSize
132
+ };
133
+ let request;
134
+ switch (input.type) {
135
+ case "url":
136
+ request = {
137
+ ...baseRequest,
138
+ file: {
139
+ type: "url",
140
+ url: input.url
141
+ }
142
+ };
143
+ break;
144
+ case "file": {
145
+ const fileData = await convertFileToBase64(input.path);
146
+ request = {
147
+ ...baseRequest,
148
+ file: {
149
+ type: "base64",
150
+ base64: fileData.base64,
151
+ fileName: fileData.fileName,
152
+ mimeType: fileData.mimeType
153
+ }
154
+ };
155
+ break;
156
+ }
157
+ case "buffer":
158
+ request = {
159
+ ...baseRequest,
160
+ file: {
161
+ type: "base64",
162
+ base64: Buffer.from(
163
+ input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
164
+ ).toString("base64"),
165
+ fileName: input.fileName,
166
+ mimeType: input.mimeType
167
+ }
168
+ };
169
+ break;
170
+ }
171
+ if (options.mode === "hashinal") {
172
+ request.metadataObject = options.metadata;
173
+ request.creator = options.metadata?.creator || clientConfig.accountId;
174
+ request.description = options.metadata?.description;
175
+ if (options.jsonFileURL) {
176
+ request.jsonFileURL = options.jsonFileURL;
177
+ }
178
+ }
179
+ logger.debug("Preparing to inscribe content", {
180
+ type: input.type,
181
+ mode: options.mode || "file",
182
+ holderId: clientConfig.accountId
183
+ });
184
+ const normalizedCfg = normalizeClientConfig(clientConfig);
185
+ const result = await sdk.inscribeAndExecute(request, normalizedCfg);
186
+ logger.info("Starting to inscribe.", {
187
+ type: input.type,
188
+ mode: options.mode || "file",
189
+ transactionId: result.jobId
190
+ });
191
+ if (options.waitForConfirmation) {
192
+ logger.debug("Waiting for inscription confirmation", {
193
+ transactionId: result.jobId,
194
+ maxAttempts: options.waitMaxAttempts,
195
+ intervalMs: options.waitIntervalMs
196
+ });
197
+ const inscription = await waitForInscriptionConfirmation(
198
+ sdk,
199
+ result.jobId,
200
+ options.waitMaxAttempts,
201
+ options.waitIntervalMs,
202
+ options.progressCallback
203
+ );
204
+ logger.info("Inscription confirmation received", {
205
+ transactionId: result.jobId
206
+ });
207
+ return {
208
+ confirmed: true,
209
+ result,
210
+ inscription,
211
+ sdk
212
+ };
213
+ }
214
+ return {
215
+ confirmed: false,
216
+ result,
217
+ sdk
218
+ };
219
+ } catch (error) {
220
+ logger.error("Error during inscription process", error);
221
+ throw error;
222
+ }
223
+ }
224
+ async function inscribeWithSigner(input, signer, options, existingSDK) {
225
+ const logger = Logger.getInstance({
226
+ module: "Inscriber",
227
+ ...options.logging
228
+ });
229
+ logger.info("Starting inscription process with signer", {
230
+ type: input.type,
231
+ mode: options.mode || "file",
232
+ quoteOnly: options.quoteOnly || false,
233
+ ...input.type === "url" ? { url: input.url } : {},
234
+ ...input.type === "file" ? { path: input.path } : {},
235
+ ...input.type === "buffer" ? { fileName: input.fileName, bufferSize: input.buffer.byteLength } : {}
236
+ });
237
+ try {
238
+ if (options.quoteOnly) {
239
+ logger.debug("Quote-only mode requested with signer, generating quote");
240
+ const clientConfig = {
241
+ accountId: signer.getAccountId().toString(),
242
+ privateKey: "",
243
+ network: options.network || "mainnet"
244
+ };
245
+ return await generateQuote(input, clientConfig, options, existingSDK);
246
+ }
247
+ if (options.mode === "hashinal" && options.metadata) {
248
+ validateHashinalMetadata(options.metadata, logger);
249
+ }
250
+ const accountId = signer.getAccountId().toString();
251
+ logger.debug("Using account ID from signer", { accountId });
252
+ let sdk;
253
+ if (existingSDK) {
254
+ logger.debug("Using existing InscriptionSDK instance");
255
+ sdk = existingSDK;
256
+ } else if (options.apiKey) {
257
+ logger.debug("Initializing InscriptionSDK with API key");
258
+ sdk = new InscriptionSDK({
259
+ apiKey: options.apiKey,
260
+ network: options.network || "mainnet",
261
+ connectionMode: "websocket"
262
+ });
263
+ } else {
264
+ logger.debug("Initializing InscriptionSDK with client auth (websocket)");
265
+ sdk = await InscriptionSDK.createWithAuth({
266
+ type: "client",
267
+ accountId,
268
+ signer,
269
+ network: options.network || "mainnet",
270
+ connectionMode: "websocket"
271
+ });
272
+ }
273
+ const baseRequest = {
274
+ holderId: accountId,
275
+ metadata: options.metadata || {},
276
+ tags: options.tags || [],
277
+ mode: options.mode || "file",
278
+ fileStandard: options.fileStandard,
279
+ chunkSize: options.chunkSize
280
+ };
281
+ let request;
282
+ switch (input.type) {
283
+ case "url":
284
+ request = {
285
+ ...baseRequest,
286
+ file: {
287
+ type: "url",
288
+ url: input.url
289
+ }
290
+ };
291
+ break;
292
+ case "file": {
293
+ const fileData = await convertFileToBase64(input.path);
294
+ request = {
295
+ ...baseRequest,
296
+ file: {
297
+ type: "base64",
298
+ base64: fileData.base64,
299
+ fileName: fileData.fileName,
300
+ mimeType: fileData.mimeType
301
+ }
302
+ };
303
+ break;
304
+ }
305
+ case "buffer":
306
+ request = {
307
+ ...baseRequest,
308
+ file: {
309
+ type: "base64",
310
+ base64: Buffer.from(
311
+ input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
312
+ ).toString("base64"),
313
+ fileName: input.fileName,
314
+ mimeType: input.mimeType
315
+ }
316
+ };
317
+ break;
318
+ }
319
+ if (options.mode === "hashinal") {
320
+ request.metadataObject = options.metadata;
321
+ request.creator = options.metadata?.creator || accountId;
322
+ request.description = options.metadata?.description;
323
+ if (options.jsonFileURL) {
324
+ request.jsonFileURL = options.jsonFileURL;
325
+ }
326
+ }
327
+ logger.debug("Starting inscription via startInscription (websocket)", {
328
+ type: input.type,
329
+ mode: options.mode || "file",
330
+ holderId: accountId,
331
+ usesStartInscription: true
332
+ });
333
+ const startResult = await sdk.startInscription({
334
+ ...request,
335
+ holderId: accountId,
336
+ network: options.network || "mainnet"
337
+ });
338
+ logger.info("about to start inscription", {
339
+ type: input.type,
340
+ mode: options.mode || "file",
341
+ jobId: startResult.id || startResult.tx_id,
342
+ ...startResult
343
+ });
344
+ if (typeof startResult?.transactionBytes === "string") {
345
+ logger.debug("Executing inscription transaction with signer from bytes");
346
+ await sdk.executeTransactionWithSigner(
347
+ startResult.transactionBytes,
348
+ signer
349
+ );
350
+ } else if (startResult?.transactionBytes?.type === "Buffer") {
351
+ logger.debug("Executing inscription transaction with signer from buffer");
352
+ await sdk.executeTransactionWithSigner(
353
+ Buffer.from(startResult.transactionBytes.data).toString("base64"),
354
+ signer
355
+ );
356
+ }
357
+ if (options.waitForConfirmation) {
358
+ logger.debug("Waiting for inscription confirmation (websocket)", {
359
+ jobId: startResult.id || startResult.tx_id,
360
+ maxAttempts: options.waitMaxAttempts,
361
+ intervalMs: options.waitIntervalMs
362
+ });
363
+ const trackingId = startResult.tx_id || startResult.id;
364
+ const inscription = await waitForInscriptionConfirmation(
365
+ sdk,
366
+ trackingId,
367
+ options.waitMaxAttempts,
368
+ options.waitIntervalMs,
369
+ options.progressCallback
370
+ );
371
+ logger.info("Inscription confirmation received", {
372
+ jobId: trackingId
373
+ });
374
+ return {
375
+ confirmed: true,
376
+ result: {
377
+ jobId: startResult.id || startResult.tx_id,
378
+ transactionId: startResult.tx_id || "",
379
+ topic_id: startResult.topic_id,
380
+ status: startResult.status,
381
+ completed: startResult.completed
382
+ },
383
+ inscription,
384
+ sdk
385
+ };
386
+ }
387
+ return {
388
+ confirmed: false,
389
+ result: {
390
+ jobId: startResult.id || startResult.tx_id,
391
+ transactionId: startResult.tx_id || "",
392
+ topic_id: startResult.topic_id,
393
+ status: startResult.status,
394
+ completed: startResult.completed
70
395
  },
71
- feeCollectorAccountId: collectorAccountId || this.defaultCollectorAccountId,
72
- feeTokenId: void 0,
73
- exemptAccounts: [...exemptAccountIds],
74
- type: CustomFeeType.FIXED_FEE
396
+ sdk
397
+ };
398
+ } catch (error) {
399
+ logger.error("Error during inscription process", error);
400
+ throw error;
401
+ }
402
+ }
403
+ async function retrieveInscription(transactionId, options) {
404
+ const logger = Logger.getInstance({
405
+ module: "Inscriber",
406
+ ...options?.logging || {}
407
+ });
408
+ const formattedTransactionId = transactionId.includes("@") ? `${transactionId.split("@")[0]}-${transactionId.split("@")[1].replace(/\./g, "-")}` : transactionId;
409
+ logger.info("Retrieving inscription", {
410
+ originalTransactionId: transactionId,
411
+ formattedTransactionId
412
+ });
413
+ try {
414
+ let sdk;
415
+ if (options?.apiKey) {
416
+ logger.debug("Initializing InscriptionSDK with API key");
417
+ sdk = new InscriptionSDK({
418
+ apiKey: options.apiKey,
419
+ network: options.network || "mainnet"
420
+ });
421
+ } else if (options?.accountId && options?.privateKey) {
422
+ logger.debug("Initializing InscriptionSDK with server auth");
423
+ sdk = await InscriptionSDK.createWithAuth({
424
+ type: "server",
425
+ accountId: options.accountId,
426
+ privateKey: options.privateKey,
427
+ network: options.network || "mainnet"
428
+ });
429
+ } else {
430
+ const error = new Error(
431
+ "Either API key or account ID and private key are required for retrieving inscriptions"
432
+ );
433
+ logger.error("Missing authentication credentials", {
434
+ hasApiKey: Boolean(options?.apiKey),
435
+ hasAccountId: Boolean(options?.accountId),
436
+ hasPrivateKey: Boolean(options?.privateKey)
437
+ });
438
+ throw error;
439
+ }
440
+ logger.debug("Initialized SDK for inscription retrieval", {
441
+ formattedTransactionId,
442
+ network: options.network || "mainnet"
443
+ });
444
+ const result = await sdk.retrieveInscription(formattedTransactionId);
445
+ logger.info("Successfully retrieved inscription", {
446
+ formattedTransactionId
447
+ });
448
+ return result;
449
+ } catch (error) {
450
+ logger.error("Error retrieving inscription", {
451
+ formattedTransactionId,
452
+ error
453
+ });
454
+ throw error;
455
+ }
456
+ }
457
+ function validateHashinalMetadata(metadata, logger) {
458
+ const requiredFields = ["name", "creator", "description", "type"];
459
+ const missingFields = requiredFields.filter((field) => !metadata[field]);
460
+ if (missingFields.length > 0) {
461
+ const error = new Error(
462
+ `Missing required Hashinal metadata fields: ${missingFields.join(", ")}`
463
+ );
464
+ logger.error("Hashinal metadata validation failed", { missingFields });
465
+ throw error;
466
+ }
467
+ logger.debug("Hashinal metadata validation passed", {
468
+ name: metadata.name,
469
+ creator: metadata.creator,
470
+ description: metadata.description,
471
+ type: metadata.type,
472
+ hasAttributes: !!metadata.attributes,
473
+ hasProperties: !!metadata.properties
474
+ });
475
+ }
476
+ async function generateQuote(input, clientConfig, options, existingSDK) {
477
+ const logger = Logger.getInstance({
478
+ module: "Inscriber",
479
+ ...options.logging
480
+ });
481
+ logger.info("Generating inscription quote", {
482
+ type: input.type,
483
+ mode: options.mode || "file",
484
+ ...input.type === "url" ? { url: input.url } : {},
485
+ ...input.type === "file" ? { path: input.path } : {},
486
+ ...input.type === "buffer" ? { fileName: input.fileName, bufferSize: input.buffer.byteLength } : {}
487
+ });
488
+ try {
489
+ validateQuoteParameters(input, clientConfig, options);
490
+ const cachedQuote = getCachedQuote(input, clientConfig, options);
491
+ if (cachedQuote) {
492
+ logger.debug("Returning cached quote");
493
+ return {
494
+ confirmed: false,
495
+ quote: true,
496
+ result: cachedQuote
497
+ };
498
+ }
499
+ if (options.mode === "hashinal" && options.metadata) {
500
+ validateHashinalMetadata(options.metadata, logger);
501
+ }
502
+ const sdk = await getOrCreateSDK(clientConfig, options, existingSDK);
503
+ const baseRequest = {
504
+ holderId: clientConfig.accountId,
505
+ metadata: options.metadata || {},
506
+ tags: options.tags || [],
507
+ mode: options.mode || "file",
508
+ fileStandard: options.fileStandard,
509
+ chunkSize: options.chunkSize
510
+ };
511
+ let request;
512
+ switch (input.type) {
513
+ case "url":
514
+ request = {
515
+ ...baseRequest,
516
+ file: {
517
+ type: "url",
518
+ url: input.url
519
+ }
520
+ };
521
+ break;
522
+ case "file": {
523
+ const fileData = await convertFileToBase64(input.path);
524
+ request = {
525
+ ...baseRequest,
526
+ file: {
527
+ type: "base64",
528
+ base64: fileData.base64,
529
+ fileName: fileData.fileName,
530
+ mimeType: fileData.mimeType
531
+ }
532
+ };
533
+ break;
534
+ }
535
+ case "buffer":
536
+ request = {
537
+ ...baseRequest,
538
+ file: {
539
+ type: "base64",
540
+ base64: Buffer.from(
541
+ input.buffer instanceof ArrayBuffer ? new Uint8Array(input.buffer) : input.buffer
542
+ ).toString("base64"),
543
+ fileName: input.fileName,
544
+ mimeType: input.mimeType
545
+ }
546
+ };
547
+ break;
548
+ }
549
+ if (options.mode === "hashinal") {
550
+ request.metadataObject = options.metadata;
551
+ request.creator = options.metadata?.creator || clientConfig.accountId;
552
+ request.description = options.metadata?.description;
553
+ if (options.jsonFileURL) {
554
+ request.jsonFileURL = options.jsonFileURL;
555
+ }
556
+ }
557
+ logger.debug("Calling inscription SDK startInscription for quote", {
558
+ type: input.type,
559
+ mode: options.mode || "file",
560
+ holderId: clientConfig.accountId
75
561
  });
76
- return this;
562
+ const inscriptionResponse = await sdk.startInscription(request);
563
+ logger.debug("Received inscription response for quote parsing", {
564
+ hasTransactionBytes: !!inscriptionResponse.transactionBytes,
565
+ bytesLength: inscriptionResponse.transactionBytes?.length || 0,
566
+ transactionBytesType: typeof inscriptionResponse.transactionBytes,
567
+ totalCost: inscriptionResponse.totalCost
568
+ });
569
+ const quote = await parseTransactionForQuote(
570
+ inscriptionResponse,
571
+ logger
572
+ );
573
+ cacheQuote(input, clientConfig, options, quote);
574
+ logger.info("Successfully generated inscription quote", {
575
+ totalCostHbar: quote.totalCostHbar
576
+ });
577
+ return {
578
+ confirmed: false,
579
+ quote: true,
580
+ result: quote
581
+ };
582
+ } catch (error) {
583
+ logger.error("Error generating inscription quote", error);
584
+ throw error;
77
585
  }
78
- /**
79
- * Adds a token fee configuration to the builder.
80
- * Allows chaining multiple fee additions.
81
- * Fetches token decimals automatically if not provided.
82
- * @param tokenAmount The amount of the specified token.
83
- * @param feeTokenId The ID of the token to charge the fee in.
84
- * @param collectorAccountId Optional. The account ID to collect this fee. If omitted, defaults to the agent's own account ID during topic creation.
85
- * @param decimals Optional. The number of decimals for the token. If omitted, it will be fetched from the mirror node.
86
- * @param exemptAccountIds Optional. Accounts specifically exempt from *this* token fee.
87
- * @returns A Promise resolving to this FeeConfigBuilder instance for chaining.
88
- */
89
- async addTokenFee(tokenAmount, feeTokenId, collectorAccountId, decimals, exemptAccountIds = []) {
90
- if (tokenAmount <= 0) {
91
- throw new Error("Token amount must be greater than zero");
92
- }
93
- if (!feeTokenId) {
94
- throw new Error("Fee token ID is required when adding a token fee");
95
- }
96
- let finalDecimals = decimals;
97
- if (finalDecimals === void 0) {
586
+ }
587
+ async function parseTransactionForQuote(inscriptionResponse, logger) {
588
+ try {
589
+ let totalCostHbar = "0.001";
590
+ if (inscriptionResponse.totalCost && typeof inscriptionResponse.totalCost === "number") {
591
+ const hbarAmount = inscriptionResponse.totalCost / 1e8;
592
+ totalCostHbar = hbarAmount.toString();
593
+ logger.debug("Using totalCost from inscription response", {
594
+ totalCostTinybars: inscriptionResponse.totalCost,
595
+ totalCostHbar
596
+ });
597
+ } else if (inscriptionResponse.transactionBytes) {
598
+ logger.debug("Parsing transaction bytes for cost information");
98
599
  try {
99
- const tokenInfo = await this.mirrorNode.getTokenInfo(feeTokenId);
100
- if (tokenInfo?.decimals) {
101
- finalDecimals = parseInt(tokenInfo.decimals, 10);
102
- this.logger.info(
103
- `Fetched decimals for ${feeTokenId}: ${finalDecimals}`
104
- );
600
+ let transactionBytesString;
601
+ if (typeof inscriptionResponse.transactionBytes === "string") {
602
+ transactionBytesString = inscriptionResponse.transactionBytes;
603
+ } else if (inscriptionResponse.transactionBytes && typeof inscriptionResponse.transactionBytes === "object" && "data" in inscriptionResponse.transactionBytes) {
604
+ const buffer = Buffer.from(inscriptionResponse.transactionBytes.data);
605
+ transactionBytesString = buffer.toString("base64");
105
606
  } else {
106
- this.logger.warn(
107
- `Could not fetch decimals for ${feeTokenId}, defaulting to 0.`
108
- );
109
- finalDecimals = 0;
607
+ throw new Error("Invalid transactionBytes format");
110
608
  }
111
- } catch (error) {
112
- this.logger.error(
113
- `Error fetching decimals for ${feeTokenId}, defaulting to 0: ${error}`
609
+ logger.debug("About to parse transaction bytes", {
610
+ bytesLength: transactionBytesString.length,
611
+ bytesPreview: transactionBytesString.slice(0, 100)
612
+ });
613
+ const parsedTransaction = await TransactionParser.parseTransactionBytes(
614
+ transactionBytesString,
615
+ { includeRaw: false }
616
+ );
617
+ logger.debug("Parsed transaction for quote", {
618
+ type: parsedTransaction.type,
619
+ hasTransfers: !!parsedTransaction.transfers,
620
+ transferCount: parsedTransaction.transfers?.length || 0,
621
+ transfers: parsedTransaction.transfers
622
+ });
623
+ let totalTransferAmount = 0;
624
+ if (parsedTransaction.transfers && parsedTransaction.transfers.length > 0) {
625
+ for (const transfer of parsedTransaction.transfers) {
626
+ const transferAmount = typeof transfer.amount === "string" ? parseFloat(transfer.amount) : transfer.amount;
627
+ if (transferAmount < 0) {
628
+ const amountHbar = Math.abs(transferAmount);
629
+ totalTransferAmount += amountHbar;
630
+ logger.debug("Found HBAR transfer", {
631
+ from: transfer.accountId,
632
+ to: "service",
633
+ amount: amountHbar
634
+ });
635
+ }
636
+ }
637
+ }
638
+ if (totalTransferAmount > 0) {
639
+ totalCostHbar = totalTransferAmount.toString();
640
+ logger.debug("Using parsed transaction transfer amount", {
641
+ totalTransferAmount,
642
+ totalCostHbar
643
+ });
644
+ }
645
+ } catch (parseError) {
646
+ logger.warn(
647
+ "Could not parse transaction bytes, using totalCost fallback",
648
+ {
649
+ error: parseError,
650
+ errorMessage: parseError instanceof Error ? parseError.message : String(parseError)
651
+ }
114
652
  );
115
- finalDecimals = 0;
116
653
  }
117
654
  }
118
- this.customFees.push({
119
- feeAmount: {
120
- amount: tokenAmount * 10 ** finalDecimals,
121
- decimals: finalDecimals
122
- },
123
- feeCollectorAccountId: collectorAccountId || this.defaultCollectorAccountId,
124
- feeTokenId,
125
- exemptAccounts: [...exemptAccountIds],
126
- type: CustomFeeType.FIXED_FEE
655
+ const transfers = [
656
+ {
657
+ to: "Inscription Service",
658
+ amount: totalCostHbar,
659
+ description: `Inscription fee (${totalCostHbar} HBAR)`
660
+ }
661
+ ];
662
+ const validUntil = new Date(Date.now() + 15 * 60 * 1e3).toISOString();
663
+ const quote = {
664
+ totalCostHbar,
665
+ validUntil,
666
+ breakdown: {
667
+ transfers
668
+ }
669
+ };
670
+ logger.debug("Successfully parsed transaction for quote", {
671
+ totalCostHbar: quote.totalCostHbar,
672
+ transferCount: transfers.length,
673
+ hasTransactionBytes: !!inscriptionResponse.transactionBytes,
674
+ hasTotalCost: !!inscriptionResponse.totalCost
127
675
  });
128
- return this;
676
+ return quote;
677
+ } catch (error) {
678
+ logger.error("Error parsing transaction for quote", error);
679
+ throw error;
129
680
  }
130
- /**
131
- * Builds the final TopicFeeConfig object.
132
- * @returns The TopicFeeConfig containing all added custom fees and a consolidated list of unique exempt accounts.
133
- * @throws Error if no fees have been added.
134
- * @throws Error if more than 10 fees have been added.
135
- */
136
- build() {
137
- if (this.customFees.length === 0) {
138
- throw new Error(
139
- "At least one fee must be added using addHbarFee/addTokenFee or created using forHbar/forToken"
681
+ }
682
+ async function waitForInscriptionConfirmation(sdk, transactionId, maxAttempts = 30, intervalMs = 4e3, progressCallback) {
683
+ const logger = Logger.getInstance({ module: "Inscriber" });
684
+ const progressReporter = new ProgressReporter({
685
+ module: "Inscriber",
686
+ logger,
687
+ callback: progressCallback
688
+ });
689
+ try {
690
+ logger.debug("Waiting for inscription confirmation", {
691
+ transactionId,
692
+ maxAttempts,
693
+ intervalMs
694
+ });
695
+ progressReporter.preparing("Preparing for inscription confirmation", 5, {
696
+ transactionId,
697
+ maxAttempts,
698
+ intervalMs
699
+ });
700
+ try {
701
+ const waitMethod = sdk.waitForInscription.bind(sdk);
702
+ const wrappedCallback = (data) => {
703
+ const stageRaw = data.stage || "confirming";
704
+ const allowedStages = [
705
+ "preparing",
706
+ "submitting",
707
+ "confirming",
708
+ "verifying",
709
+ "completed",
710
+ "failed"
711
+ ];
712
+ const stage = allowedStages.includes(stageRaw) ? stageRaw : "confirming";
713
+ const message = data.message || "Processing inscription";
714
+ const percent = data.progressPercent || 50;
715
+ progressReporter.report({
716
+ stage,
717
+ message,
718
+ progressPercent: percent,
719
+ details: data.details
720
+ });
721
+ };
722
+ return await waitMethod(
723
+ transactionId,
724
+ maxAttempts,
725
+ intervalMs,
726
+ true,
727
+ wrappedCallback
728
+ );
729
+ } catch (e) {
730
+ logger.debug("Falling back to standard waitForInscription method", {
731
+ error: e
732
+ });
733
+ progressReporter.verifying("Verifying inscription status", 50, {
734
+ error: e
735
+ });
736
+ return await sdk.waitForInscription(
737
+ transactionId,
738
+ maxAttempts,
739
+ intervalMs,
740
+ true
140
741
  );
141
742
  }
142
- if (this.customFees.length > 10) {
143
- throw new Error("Maximum of 10 custom fees per topic allowed");
144
- }
145
- const allExemptAccounts = /* @__PURE__ */ new Set();
146
- this.customFees.forEach((fee) => {
147
- fee.exemptAccounts.forEach((account) => allExemptAccounts.add(account));
743
+ } catch (error) {
744
+ logger.error("Error waiting for inscription confirmation", {
745
+ transactionId,
746
+ maxAttempts,
747
+ intervalMs,
748
+ error
148
749
  });
149
- const resolvedCustomFees = this.customFees.map((fee) => ({
150
- ...fee,
151
- feeCollectorAccountId: fee.feeCollectorAccountId || this.defaultCollectorAccountId
152
- }));
153
- return {
154
- customFees: resolvedCustomFees,
155
- exemptAccounts: Array.from(allExemptAccounts)
156
- };
750
+ progressReporter.failed("Inscription confirmation failed", {
751
+ transactionId,
752
+ error
753
+ });
754
+ throw error;
157
755
  }
158
756
  }
159
757
  export {
160
- FeeConfigBuilder
758
+ generateQuote,
759
+ inscribe,
760
+ inscribeWithSigner,
761
+ retrieveInscription,
762
+ waitForInscriptionConfirmation
161
763
  };
162
764
  //# sourceMappingURL=standards-sdk.es124.js.map