@hashgraphonline/standards-agent-kit 0.2.131 → 0.2.134

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 (168) hide show
  1. package/dist/cjs/builders/hcs10/hcs10-builder.d.ts +0 -2
  2. package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +4 -10
  3. package/dist/cjs/index.d.ts +2 -0
  4. package/dist/cjs/interfaces/FormValidatable.d.ts +45 -0
  5. package/dist/cjs/interfaces/index.d.ts +1 -0
  6. package/dist/cjs/lib/index.d.ts +1 -0
  7. package/dist/cjs/lib/zod-render/config-extractor.d.ts +50 -0
  8. package/dist/cjs/lib/zod-render/index.d.ts +6 -0
  9. package/dist/cjs/lib/zod-render/schema-extension.d.ts +94 -0
  10. package/dist/cjs/lib/zod-render/types.d.ts +286 -0
  11. package/dist/cjs/standards-agent-kit.cjs +1 -1
  12. package/dist/cjs/standards-agent-kit.cjs.map +1 -1
  13. package/dist/cjs/tools/hcs10/natural-language-mapper.d.ts +6 -1
  14. package/dist/cjs/tools/hcs2/CreateRegistryTool.d.ts +1 -16
  15. package/dist/cjs/tools/hcs2/DeleteEntryTool.d.ts +1 -13
  16. package/dist/cjs/tools/hcs2/RegisterEntryTool.d.ts +1 -16
  17. package/dist/cjs/tools/hcs2/UpdateEntryTool.d.ts +1 -19
  18. package/dist/cjs/tools/hcs6/CreateDynamicRegistryTool.d.ts +1 -10
  19. package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +82 -132
  20. package/dist/cjs/tools/inscriber/RetrieveInscriptionTool.d.ts +20 -1
  21. package/dist/cjs/types/inscription-response.d.ts +172 -0
  22. package/dist/cjs/validation/hip412-schemas.d.ts +1 -1
  23. package/dist/es/builders/hcs10/hcs10-builder.d.ts +0 -2
  24. package/dist/es/builders/inscriber/inscriber-builder.d.ts +4 -10
  25. package/dist/es/index.d.ts +2 -0
  26. package/dist/es/interfaces/FormValidatable.d.ts +45 -0
  27. package/dist/es/interfaces/index.d.ts +1 -0
  28. package/dist/es/lib/index.d.ts +1 -0
  29. package/dist/es/lib/zod-render/config-extractor.d.ts +50 -0
  30. package/dist/es/lib/zod-render/index.d.ts +6 -0
  31. package/dist/es/lib/zod-render/schema-extension.d.ts +94 -0
  32. package/dist/es/lib/zod-render/types.d.ts +286 -0
  33. package/dist/es/standards-agent-kit.es.js +24 -1
  34. package/dist/es/standards-agent-kit.es.js.map +1 -1
  35. package/dist/es/standards-agent-kit.es10.js +3 -1
  36. package/dist/es/standards-agent-kit.es10.js.map +1 -1
  37. package/dist/es/standards-agent-kit.es14.js +3 -1
  38. package/dist/es/standards-agent-kit.es14.js.map +1 -1
  39. package/dist/es/standards-agent-kit.es20.js +3 -20
  40. package/dist/es/standards-agent-kit.es20.js.map +1 -1
  41. package/dist/es/standards-agent-kit.es22.js.map +1 -1
  42. package/dist/es/standards-agent-kit.es23.js.map +1 -1
  43. package/dist/es/standards-agent-kit.es24.js.map +1 -1
  44. package/dist/es/standards-agent-kit.es25.js.map +1 -1
  45. package/dist/es/standards-agent-kit.es29.js.map +1 -1
  46. package/dist/es/standards-agent-kit.es3.js +0 -4
  47. package/dist/es/standards-agent-kit.es3.js.map +1 -1
  48. package/dist/es/standards-agent-kit.es30.js.map +1 -1
  49. package/dist/es/standards-agent-kit.es31.js.map +1 -1
  50. package/dist/es/standards-agent-kit.es32.js.map +1 -1
  51. package/dist/es/standards-agent-kit.es33.js +0 -4
  52. package/dist/es/standards-agent-kit.es33.js.map +1 -1
  53. package/dist/es/standards-agent-kit.es34.js +13 -17
  54. package/dist/es/standards-agent-kit.es34.js.map +1 -1
  55. package/dist/es/standards-agent-kit.es35.js +2 -8
  56. package/dist/es/standards-agent-kit.es35.js.map +1 -1
  57. package/dist/es/standards-agent-kit.es36.js +2 -2
  58. package/dist/es/standards-agent-kit.es37.js +451 -92
  59. package/dist/es/standards-agent-kit.es37.js.map +1 -1
  60. package/dist/es/standards-agent-kit.es38.js +12 -11
  61. package/dist/es/standards-agent-kit.es38.js.map +1 -1
  62. package/dist/es/standards-agent-kit.es39.js +1 -1
  63. package/dist/es/standards-agent-kit.es39.js.map +1 -1
  64. package/dist/es/standards-agent-kit.es40.js +7 -7
  65. package/dist/es/standards-agent-kit.es40.js.map +1 -1
  66. package/dist/es/standards-agent-kit.es41.js.map +1 -1
  67. package/dist/es/standards-agent-kit.es42.js +423 -24
  68. package/dist/es/standards-agent-kit.es42.js.map +1 -1
  69. package/dist/es/standards-agent-kit.es43.js +185 -3
  70. package/dist/es/standards-agent-kit.es43.js.map +1 -1
  71. package/dist/es/standards-agent-kit.es44.js +3 -53
  72. package/dist/es/standards-agent-kit.es44.js.map +1 -1
  73. package/dist/es/standards-agent-kit.es45.js +25 -3
  74. package/dist/es/standards-agent-kit.es45.js.map +1 -1
  75. package/dist/es/standards-agent-kit.es46.js +3 -39
  76. package/dist/es/standards-agent-kit.es46.js.map +1 -1
  77. package/dist/es/standards-agent-kit.es47.js +51 -9
  78. package/dist/es/standards-agent-kit.es47.js.map +1 -1
  79. package/dist/es/standards-agent-kit.es48.js +6 -0
  80. package/dist/es/standards-agent-kit.es48.js.map +1 -0
  81. package/dist/es/standards-agent-kit.es49.js +43 -0
  82. package/dist/es/standards-agent-kit.es49.js.map +1 -0
  83. package/dist/es/standards-agent-kit.es50.js +22 -0
  84. package/dist/es/standards-agent-kit.es50.js.map +1 -0
  85. package/dist/es/standards-agent-kit.es51.js +57 -0
  86. package/dist/es/standards-agent-kit.es51.js.map +1 -0
  87. package/dist/es/standards-agent-kit.es6.js +1 -1
  88. package/dist/es/standards-agent-kit.es6.js.map +1 -1
  89. package/dist/es/standards-agent-kit.es7.js +1 -1
  90. package/dist/es/standards-agent-kit.es7.js.map +1 -1
  91. package/dist/es/standards-agent-kit.es9.js +6 -2
  92. package/dist/es/standards-agent-kit.es9.js.map +1 -1
  93. package/dist/es/tools/hcs10/natural-language-mapper.d.ts +6 -1
  94. package/dist/es/tools/hcs2/CreateRegistryTool.d.ts +1 -16
  95. package/dist/es/tools/hcs2/DeleteEntryTool.d.ts +1 -13
  96. package/dist/es/tools/hcs2/RegisterEntryTool.d.ts +1 -16
  97. package/dist/es/tools/hcs2/UpdateEntryTool.d.ts +1 -19
  98. package/dist/es/tools/hcs6/CreateDynamicRegistryTool.d.ts +1 -10
  99. package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +82 -132
  100. package/dist/es/tools/inscriber/RetrieveInscriptionTool.d.ts +20 -1
  101. package/dist/es/types/inscription-response.d.ts +172 -0
  102. package/dist/es/validation/hip412-schemas.d.ts +1 -1
  103. package/dist/umd/builders/hcs10/hcs10-builder.d.ts +0 -2
  104. package/dist/umd/builders/inscriber/inscriber-builder.d.ts +4 -10
  105. package/dist/umd/index.d.ts +2 -0
  106. package/dist/umd/interfaces/FormValidatable.d.ts +45 -0
  107. package/dist/umd/interfaces/index.d.ts +1 -0
  108. package/dist/umd/lib/index.d.ts +1 -0
  109. package/dist/umd/lib/zod-render/config-extractor.d.ts +50 -0
  110. package/dist/umd/lib/zod-render/index.d.ts +6 -0
  111. package/dist/umd/lib/zod-render/schema-extension.d.ts +94 -0
  112. package/dist/umd/lib/zod-render/types.d.ts +286 -0
  113. package/dist/umd/standards-agent-kit.umd.js +1 -1
  114. package/dist/umd/standards-agent-kit.umd.js.map +1 -1
  115. package/dist/umd/tools/hcs10/natural-language-mapper.d.ts +6 -1
  116. package/dist/umd/tools/hcs2/CreateRegistryTool.d.ts +1 -16
  117. package/dist/umd/tools/hcs2/DeleteEntryTool.d.ts +1 -13
  118. package/dist/umd/tools/hcs2/RegisterEntryTool.d.ts +1 -16
  119. package/dist/umd/tools/hcs2/UpdateEntryTool.d.ts +1 -19
  120. package/dist/umd/tools/hcs6/CreateDynamicRegistryTool.d.ts +1 -10
  121. package/dist/umd/tools/inscriber/InscribeHashinalTool.d.ts +82 -132
  122. package/dist/umd/tools/inscriber/RetrieveInscriptionTool.d.ts +20 -1
  123. package/dist/umd/types/inscription-response.d.ts +172 -0
  124. package/dist/umd/validation/hip412-schemas.d.ts +1 -1
  125. package/package.json +5 -4
  126. package/src/builders/hcs10/hcs10-builder.ts +0 -4
  127. package/src/builders/inscriber/inscriber-builder.ts +5 -12
  128. package/src/hcs10/HCS10Client.ts +2 -5
  129. package/src/hcs10/types.ts +1 -15
  130. package/src/index.ts +2 -0
  131. package/src/init/init.ts +7 -10
  132. package/src/interfaces/FormValidatable.ts +57 -0
  133. package/src/interfaces/index.ts +1 -0
  134. package/src/lib/index.ts +1 -0
  135. package/src/lib/zod-render/config-extractor.ts +351 -0
  136. package/src/lib/zod-render/index.ts +36 -0
  137. package/src/lib/zod-render/schema-extension.ts +544 -0
  138. package/src/lib/zod-render/types.ts +333 -0
  139. package/src/plugins/PluginInterface.ts +1 -2
  140. package/src/plugins/PluginRegistry.ts +1 -1
  141. package/src/plugins/hedera/HbarPricePlugin.ts +1 -1
  142. package/src/plugins/weather/index.ts +15 -4
  143. package/src/state/open-convai-state.ts +1 -11
  144. package/src/tools/hcs10/FindRegistrationsTool.ts +1 -1
  145. package/src/tools/hcs10/RegisterAgentTool.ts +3 -3
  146. package/src/tools/hcs10/SendMessageToConnectionTool.ts +4 -1
  147. package/src/tools/hcs10/natural-language-mapper.ts +35 -53
  148. package/src/tools/hcs2/CreateRegistryTool.ts +1 -1
  149. package/src/tools/hcs2/DeleteEntryTool.ts +1 -1
  150. package/src/tools/hcs2/RegisterEntryTool.ts +1 -1
  151. package/src/tools/hcs2/UpdateEntryTool.ts +1 -1
  152. package/src/tools/hcs6/CreateDynamicRegistryTool.ts +2 -2
  153. package/src/tools/hcs6/QueryDynamicRegistryTool.ts +1 -1
  154. package/src/tools/hcs6/RegisterDynamicHashinalTool.ts +1 -1
  155. package/src/tools/hcs6/UpdateDynamicHashinalTool.ts +2 -2
  156. package/src/tools/inscriber/InscribeFromFileTool.ts +2 -11
  157. package/src/tools/inscriber/InscribeFromUrlTool.ts +15 -19
  158. package/src/tools/inscriber/InscribeHashinalTool.ts +681 -153
  159. package/src/tools/inscriber/RetrieveInscriptionTool.ts +34 -12
  160. package/src/tools/inscriber/base-inscriber-tools.ts +2 -24
  161. package/src/types/content-resolver.ts +3 -3
  162. package/src/types/inscription-response.ts +234 -0
  163. package/src/utils/Encryption.ts +1 -1
  164. package/src/utils/HederaClient.ts +1 -2
  165. package/src/utils/metadata-defaults.ts +15 -4
  166. package/src/utils/state-tools.ts +1 -2
  167. package/src/validation/content-ref-schemas.ts +2 -2
  168. package/src/validation/hip412-schemas.ts +1 -1
@@ -15,6 +15,26 @@ const retrieveInscriptionSchema = z.object({
15
15
  .describe('API key for inscription service'),
16
16
  });
17
17
 
18
+ /**
19
+ * Type definition for inscription retrieval result
20
+ */
21
+ interface InscriptionRetrievalResult {
22
+ inscriptionId?: string;
23
+ transactionId: string;
24
+ topicId?: string;
25
+ status?: string;
26
+ holderId?: string;
27
+ metadata?: unknown;
28
+ tags?: unknown;
29
+ mode?: string;
30
+ chunks?: unknown;
31
+ createdAt?: string;
32
+ completedAt?: string;
33
+ fileUrl?: string;
34
+ mimeType?: string;
35
+ fileSize?: number;
36
+ }
37
+
18
38
 
19
39
  /**
20
40
  * Tool for retrieving inscriptions
@@ -30,7 +50,7 @@ export class RetrieveInscriptionTool extends BaseInscriberQueryTool<typeof retri
30
50
  protected async executeQuery(
31
51
  params: z.infer<typeof retrieveInscriptionSchema>,
32
52
  _runManager?: CallbackManagerForToolRun
33
- ): Promise<unknown> {
53
+ ): Promise<InscriptionRetrievalResult> {
34
54
  const result = await this.inscriberBuilder.retrieveInscription(
35
55
  params.transactionId,
36
56
  {
@@ -39,21 +59,23 @@ export class RetrieveInscriptionTool extends BaseInscriberQueryTool<typeof retri
39
59
  }
40
60
  );
41
61
 
62
+ const typedResult = result as unknown as Record<string, unknown>;
63
+
42
64
  return {
43
- inscriptionId: (result as any).inscriptionId,
44
- transactionId: result.transactionId,
45
- topicId: (result as any).topic_id,
46
- status: result.status,
47
- holderId: (result as any).holderId,
65
+ inscriptionId: typedResult.inscriptionId as string | undefined,
66
+ transactionId: result.transactionId || 'unknown',
67
+ topicId: typedResult.topic_id as string | undefined,
68
+ status: result.status || 'unknown',
69
+ holderId: typedResult.holderId as string | undefined,
48
70
  metadata: result.metadata,
49
- tags: (result as any).tags,
71
+ tags: typedResult.tags,
50
72
  mode: result.mode,
51
- chunks: (result as any).chunks,
52
- createdAt: (result as any).createdAt,
53
- completedAt: (result as any).completed || (result as any).completedAt,
73
+ chunks: typedResult.chunks,
74
+ createdAt: typedResult.createdAt as string | undefined,
75
+ completedAt: (typedResult.completed || typedResult.completedAt) as string | undefined,
54
76
  fileUrl: result.fileUrl,
55
- mimeType: (result as any).mimeType,
56
- fileSize: (result as any).fileSize,
77
+ mimeType: typedResult.mimeType as string | undefined,
78
+ fileSize: typedResult.fileSize as number | undefined,
57
79
  };
58
80
  }
59
81
  }
@@ -60,22 +60,11 @@ export abstract class BaseInscriberTransactionTool<
60
60
  input: InscriptionInput,
61
61
  options: InscriptionOptions
62
62
  ): Promise<QuoteResult> {
63
- const operatorId = this.inscriberBuilder['hederaKit'].signer.getAccountId().toString();
64
- const operatorPrivateKey = this.inscriberBuilder['hederaKit'].signer?.getOperatorPrivateKey()
65
- ? this.inscriberBuilder['hederaKit'].signer.getOperatorPrivateKey().toStringRaw()
66
- : '';
67
-
68
63
  const network = this.inscriberBuilder['hederaKit'].client.network;
69
64
  const networkType = network.toString().includes('mainnet')
70
65
  ? 'mainnet'
71
66
  : 'testnet';
72
67
 
73
- const clientConfig = {
74
- accountId: operatorId,
75
- privateKey: operatorPrivateKey,
76
- network: networkType as 'mainnet' | 'testnet',
77
- };
78
-
79
68
  const quoteOptions = {
80
69
  ...options,
81
70
  quoteOnly: true,
@@ -83,7 +72,7 @@ export abstract class BaseInscriberTransactionTool<
83
72
  };
84
73
 
85
74
  const result = await this.inscriberBuilder.inscribe(input, quoteOptions);
86
-
75
+
87
76
  if (!result.quote || result.confirmed) {
88
77
  throw new Error('Failed to generate quote - unexpected response type');
89
78
  }
@@ -136,22 +125,11 @@ export abstract class BaseInscriberQueryTool<
136
125
  input: InscriptionInput,
137
126
  options: InscriptionOptions
138
127
  ): Promise<QuoteResult> {
139
- const operatorId = this.inscriberBuilder['hederaKit'].signer.getAccountId().toString();
140
- const operatorPrivateKey = this.inscriberBuilder['hederaKit'].signer?.getOperatorPrivateKey()
141
- ? this.inscriberBuilder['hederaKit'].signer.getOperatorPrivateKey().toStringRaw()
142
- : '';
143
-
144
128
  const network = this.inscriberBuilder['hederaKit'].client.network;
145
129
  const networkType = network.toString().includes('mainnet')
146
130
  ? 'mainnet'
147
131
  : 'testnet';
148
132
 
149
- const clientConfig = {
150
- accountId: operatorId,
151
- privateKey: operatorPrivateKey,
152
- network: networkType as 'mainnet' | 'testnet',
153
- };
154
-
155
133
  const quoteOptions = {
156
134
  ...options,
157
135
  quoteOnly: true,
@@ -159,7 +137,7 @@ export abstract class BaseInscriberQueryTool<
159
137
  };
160
138
 
161
139
  const result = await this.inscriberBuilder.inscribe(input, quoteOptions);
162
-
140
+
163
141
  if (!result.quote || result.confirmed) {
164
142
  throw new Error('Failed to generate quote - unexpected response type');
165
143
  }
@@ -1,11 +1,11 @@
1
1
  /**
2
2
  * Content Resolver Types
3
- *
3
+ *
4
4
  * Re-export types from standards-sdk for content resolution.
5
5
  */
6
6
 
7
- export type {
7
+ export type {
8
8
  ContentResolverInterface,
9
9
  ReferenceResolutionResult,
10
- ContentStoreInterface
10
+ ContentStoreInterface
11
11
  } from '@hashgraphonline/standards-sdk';
@@ -0,0 +1,234 @@
1
+ /**
2
+ * Structured response interface for inscription tools
3
+ * Provides a consistent, user-friendly format for inscription results
4
+ */
5
+
6
+ export interface InscriptionSuccessResponse {
7
+ success: true;
8
+ type: 'inscription';
9
+ title: string;
10
+ message: string;
11
+ inscription: {
12
+ /** The HRL (Hashinal Reference Link) for minting - e.g., "hcs://1/0.0.123456" */
13
+ hrl: string;
14
+ /** Topic ID where the inscription was stored */
15
+ topicId: string;
16
+ /** Type of Hashinal - Static (HCS-5) or Dynamic (HCS-6) */
17
+ standard: 'Static' | 'Dynamic';
18
+ /** CDN URL for direct access to the inscribed content */
19
+ cdnUrl?: string;
20
+ /** Transaction ID of the inscription */
21
+ transactionId?: string;
22
+ };
23
+ metadata: {
24
+ /** Name/title of the inscribed content */
25
+ name?: string;
26
+ /** Creator of the content */
27
+ creator?: string;
28
+ /** Description of the content */
29
+ description?: string;
30
+ /** Content type (image, text, etc.) */
31
+ type?: string;
32
+ /** Additional attributes */
33
+ attributes?: Array<{ trait_type: string; value: string | number }>;
34
+ };
35
+ nextSteps: {
36
+ /** Primary action the user should take next */
37
+ primary: string;
38
+ /** Additional context or options */
39
+ context?: string;
40
+ /** Specific metadata value to use for minting */
41
+ mintingMetadata: string;
42
+ };
43
+ /** HashLink block data (only present when withHashLinkBlocks=true) */
44
+ hashLinkBlock?: {
45
+ /** Block topic ID on HCS */
46
+ blockId: string;
47
+ /** HashLink reference to the block */
48
+ hashLink: string;
49
+ /** Template topic ID */
50
+ template: string;
51
+ /** Block attributes for rendering */
52
+ attributes: BlockAttributes;
53
+ };
54
+ }
55
+
56
+ export interface InscriptionQuoteResponse {
57
+ success: true;
58
+ type: 'quote';
59
+ title: string;
60
+ message: string;
61
+ quote: {
62
+ /** Total cost in HBAR */
63
+ totalCostHbar: string;
64
+ /** When the quote expires */
65
+ validUntil: string;
66
+ /** Cost breakdown details */
67
+ breakdown?: CostBreakdown;
68
+ };
69
+ content: {
70
+ /** Name of the content to be inscribed */
71
+ name?: string;
72
+ /** Creator of the content */
73
+ creator?: string;
74
+ /** Type of content */
75
+ type?: string;
76
+ };
77
+ }
78
+
79
+ export interface InscriptionErrorResponse {
80
+ success: false;
81
+ type: 'error';
82
+ title: string;
83
+ message: string;
84
+ error: {
85
+ /** Error code for programmatic handling */
86
+ code: string;
87
+ /** Detailed error message */
88
+ details: string;
89
+ /** Suggestions for fixing the error */
90
+ suggestions?: string[];
91
+ };
92
+ }
93
+
94
+ export type InscriptionResponse =
95
+ | InscriptionSuccessResponse
96
+ | InscriptionQuoteResponse
97
+ | InscriptionErrorResponse;
98
+
99
+ /**
100
+ * Helper function to create a successful inscription response
101
+ */
102
+ export function createInscriptionSuccess(params: {
103
+ hrl: string;
104
+ topicId: string;
105
+ standard: 'Static' | 'Dynamic';
106
+ cdnUrl?: string;
107
+ transactionId?: string;
108
+ metadata: {
109
+ name?: string;
110
+ creator?: string;
111
+ description?: string;
112
+ type?: string;
113
+ attributes?: Array<{ trait_type: string; value: string | number }>;
114
+ };
115
+ }): InscriptionSuccessResponse {
116
+ const { hrl, topicId, standard, cdnUrl, transactionId, metadata } = params;
117
+
118
+ return {
119
+ success: true,
120
+ type: 'inscription',
121
+ title: `${standard} Hashinal Inscription Complete`,
122
+ message: `Successfully inscribed "${
123
+ metadata.name || 'your content'
124
+ }" as a ${standard} Hashinal. The content is now ready for NFT minting.`,
125
+ inscription: {
126
+ hrl,
127
+ topicId,
128
+ standard,
129
+ cdnUrl,
130
+ transactionId,
131
+ },
132
+ metadata,
133
+ nextSteps: {
134
+ primary: 'Use the HRL below as metadata when minting your NFT',
135
+ context:
136
+ 'The HRL (Hedera Resource Locator) is the standardized way to reference your inscribed content in NFT metadata.',
137
+ mintingMetadata: hrl,
138
+ },
139
+ };
140
+ }
141
+
142
+ /**
143
+ * Block attributes for HashLink rendering
144
+ */
145
+ interface BlockAttributes {
146
+ /** Display name */
147
+ name?: string;
148
+ /** Description text */
149
+ description?: string;
150
+ /** Image URL */
151
+ image?: string;
152
+ /** Content type */
153
+ contentType?: string;
154
+ /** Size in bytes */
155
+ size?: number;
156
+ /** Custom metadata */
157
+ metadata?: Record<string, string | number | boolean>;
158
+ }
159
+
160
+ /**
161
+ * Transfer details in cost breakdown
162
+ */
163
+ interface TransferDetails {
164
+ to: string;
165
+ amount: string;
166
+ description: string;
167
+ }
168
+
169
+ /**
170
+ * Cost breakdown details for inscription quote
171
+ */
172
+ interface CostBreakdown {
173
+ transfers: TransferDetails[];
174
+ baseFee?: number;
175
+ sizeFee?: number;
176
+ networkFee?: number;
177
+ serviceFee?: number;
178
+ totalFee?: number;
179
+ currency?: string;
180
+ }
181
+
182
+ /**
183
+ * Helper function to create a quote response
184
+ */
185
+ export function createInscriptionQuote(params: {
186
+ totalCostHbar: string;
187
+ validUntil: string;
188
+ breakdown?: CostBreakdown;
189
+ content: {
190
+ name?: string;
191
+ creator?: string;
192
+ type?: string;
193
+ };
194
+ }): InscriptionQuoteResponse {
195
+ const { totalCostHbar, validUntil, breakdown, content } = params;
196
+
197
+ return {
198
+ success: true,
199
+ type: 'quote',
200
+ title: 'Inscription Cost Quote',
201
+ message: `Estimated cost to inscribe "${
202
+ content.name || 'your content'
203
+ }" is ${totalCostHbar} HBAR.`,
204
+ quote: {
205
+ totalCostHbar,
206
+ validUntil,
207
+ breakdown,
208
+ },
209
+ content,
210
+ };
211
+ }
212
+
213
+ /**
214
+ * Helper function to create an error response
215
+ */
216
+ export function createInscriptionError(params: {
217
+ code: string;
218
+ details: string;
219
+ suggestions?: string[];
220
+ }): InscriptionErrorResponse {
221
+ const { code, details, suggestions } = params;
222
+
223
+ return {
224
+ success: false,
225
+ type: 'error',
226
+ title: 'Inscription Failed',
227
+ message: `Unable to complete inscription: ${details}`,
228
+ error: {
229
+ code,
230
+ details,
231
+ suggestions,
232
+ },
233
+ };
234
+ }
@@ -1,4 +1,4 @@
1
- // src/utils/Encryption.ts
1
+
2
2
  /**
3
3
  * Placeholder for encryption functionality.
4
4
  * Currently, encryption is disabled. The useEncryption flag is false by default.
@@ -1,9 +1,8 @@
1
- // src/utils/HederaClient.ts
1
+
2
2
  import { Client, AccountId, PrivateKey, TopicMessage, TopicMessageQuery } from '@hashgraph/sdk';
3
3
  import * as dotenv from 'dotenv';
4
4
  import { HCS10Message } from '../hcs10/types';
5
5
 
6
- // Load environment variables from .env file
7
6
  dotenv.config();
8
7
 
9
8
  /**
@@ -9,11 +9,22 @@ export function generateDefaultMetadata(params: {
9
9
  fileName?: string;
10
10
  mimeType?: string;
11
11
  operatorAccount: string;
12
- }) {
12
+ }): {
13
+ name: string;
14
+ creator: string;
15
+ description: string;
16
+ type: string;
17
+ image: string;
18
+ } {
13
19
  const defaultName = params.fileName?.replace(/\.[^/.]+$/, '') || 'Hashinal NFT';
14
- const defaultType = params.mimeType?.startsWith('image/') ? 'image' :
15
- params.mimeType?.startsWith('video/') ? 'video' :
16
- params.mimeType?.startsWith('audio/') ? 'audio' : 'media';
20
+ let defaultType = 'media';
21
+ if (params.mimeType?.startsWith('image/')) {
22
+ defaultType = 'image';
23
+ } else if (params.mimeType?.startsWith('video/')) {
24
+ defaultType = 'video';
25
+ } else if (params.mimeType?.startsWith('audio/')) {
26
+ defaultType = 'audio';
27
+ }
17
28
 
18
29
  return {
19
30
  name: params.name || defaultName,
@@ -125,8 +125,7 @@ export async function createAgent(
125
125
  client,
126
126
  };
127
127
  } catch (error) {
128
- console.log('error', error, baseClient);
129
- logger.error(`Error creating ${agentName} agent:`, error);
128
+ logger.error(`Error creating ${agentName} agent:`, error, { baseClient });
130
129
  return null;
131
130
  }
132
131
  }
@@ -5,7 +5,7 @@ import { z } from 'zod';
5
5
  */
6
6
  export const contentRefSchema = z
7
7
  .string()
8
- .regex(/^content-ref:[a-fA-F0-9]{64}$/, 'Content reference must be in format "content-ref:[64-char hex]"')
8
+ .regex(/^content-ref:[a-zA-Z0-9_-]+$/, 'Content reference must be in format "content-ref:[alphanumeric-id]"')
9
9
  .describe('Content reference in format "content-ref:[id]"');
10
10
 
11
11
  /**
@@ -15,6 +15,6 @@ export function validateContentRef(input: string): string {
15
15
  try {
16
16
  return contentRefSchema.parse(input);
17
17
  } catch (error) {
18
- throw new Error(`Invalid content reference format. Expected "content-ref:[64-character-hash]" but got "${input}"`);
18
+ throw new Error(`Invalid content reference format. Expected "content-ref:[alphanumeric-id]" but got "${input}"`);
19
19
  }
20
20
  }
@@ -39,7 +39,7 @@ export const hip412MetadataSchema = z.object({
39
39
  /**
40
40
  * Validates metadata against HIP-412 standard
41
41
  */
42
- export function validateHIP412Metadata(metadata: any): z.infer<typeof hip412MetadataSchema> {
42
+ export function validateHIP412Metadata(metadata: unknown): z.infer<typeof hip412MetadataSchema> {
43
43
  try {
44
44
  return hip412MetadataSchema.parse(metadata);
45
45
  } catch (error) {