@hashgraphonline/standards-agent-kit 0.2.148 → 0.2.149

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 (51) hide show
  1. package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +1 -7
  2. package/dist/cjs/standards-agent-kit.cjs +1 -1
  3. package/dist/cjs/standards-agent-kit.cjs.map +1 -1
  4. package/dist/cjs/types/inscription-response.d.ts +5 -0
  5. package/dist/es/builders/inscriber/inscriber-builder.d.ts +1 -7
  6. package/dist/es/standards-agent-kit.es24.js +1 -1
  7. package/dist/es/standards-agent-kit.es25.js +1 -1
  8. package/dist/es/standards-agent-kit.es26.js +1 -1
  9. package/dist/es/standards-agent-kit.es27.js +1 -1
  10. package/dist/es/standards-agent-kit.es28.js +1 -1
  11. package/dist/es/standards-agent-kit.es31.js +1 -1
  12. package/dist/es/standards-agent-kit.es32.js +1 -1
  13. package/dist/es/standards-agent-kit.es33.js +1 -1
  14. package/dist/es/standards-agent-kit.es36.js +1 -1
  15. package/dist/es/standards-agent-kit.es37.js +1 -1
  16. package/dist/es/standards-agent-kit.es38.js +3 -3
  17. package/dist/es/standards-agent-kit.es39.js +7 -5
  18. package/dist/es/standards-agent-kit.es39.js.map +1 -1
  19. package/dist/es/standards-agent-kit.es48.js +7 -3
  20. package/dist/es/standards-agent-kit.es48.js.map +1 -1
  21. package/dist/es/standards-agent-kit.es49.js +3 -7
  22. package/dist/es/standards-agent-kit.es49.js.map +1 -1
  23. package/dist/es/standards-agent-kit.es50.js +20 -3
  24. package/dist/es/standards-agent-kit.es50.js.map +1 -1
  25. package/dist/es/standards-agent-kit.es51.js +50 -17
  26. package/dist/es/standards-agent-kit.es51.js.map +1 -1
  27. package/dist/es/standards-agent-kit.es52.js +3 -54
  28. package/dist/es/standards-agent-kit.es52.js.map +1 -1
  29. package/dist/es/standards-agent-kit.es53.js +39 -2
  30. package/dist/es/standards-agent-kit.es53.js.map +1 -1
  31. package/dist/es/standards-agent-kit.es54.js +17 -38
  32. package/dist/es/standards-agent-kit.es54.js.map +1 -1
  33. package/dist/es/standards-agent-kit.es55.js +81 -16
  34. package/dist/es/standards-agent-kit.es55.js.map +1 -1
  35. package/dist/es/standards-agent-kit.es56.js +3 -73
  36. package/dist/es/standards-agent-kit.es56.js.map +1 -1
  37. package/dist/es/standards-agent-kit.es6.js +1 -1
  38. package/dist/es/standards-agent-kit.es7.js +1 -1
  39. package/dist/es/standards-agent-kit.es8.js +1 -1
  40. package/dist/es/standards-agent-kit.es8.js.map +1 -1
  41. package/dist/es/standards-agent-kit.es9.js +1 -1
  42. package/dist/es/types/inscription-response.d.ts +5 -0
  43. package/dist/umd/builders/inscriber/inscriber-builder.d.ts +1 -7
  44. package/dist/umd/standards-agent-kit.umd.js +1 -1
  45. package/dist/umd/standards-agent-kit.umd.js.map +1 -1
  46. package/dist/umd/types/inscription-response.d.ts +5 -0
  47. package/package.json +1 -1
  48. package/src/builders/inscriber/inscriber-builder.ts +2 -8
  49. package/src/tools/inscriber/InscribeHashinalTool.ts +2 -0
  50. package/src/types/inscription-response.ts +16 -1
  51. package/src/utils/inscription-utils.ts +3 -1
@@ -12,6 +12,8 @@ export interface InscriptionSuccessResponse {
12
12
  hrl: string;
13
13
  /** Topic ID where the inscription was stored */
14
14
  topicId: string;
15
+ /** Topic ID containing the JSON metadata when available */
16
+ jsonTopicId?: string;
15
17
  /** Type of Hashinal - Static (HCS-5) or Dynamic (HCS-6) */
16
18
  standard: 'Static' | 'Dynamic';
17
19
  /** CDN URL for direct access to the inscribed content */
@@ -19,6 +21,8 @@ export interface InscriptionSuccessResponse {
19
21
  /** Transaction ID of the inscription */
20
22
  transactionId?: string;
21
23
  };
24
+ /** Topic ID used for metadata lookups */
25
+ jsonTopicId?: string;
22
26
  metadata: {
23
27
  /** Name/title of the inscribed content */
24
28
  name?: string;
@@ -97,6 +101,7 @@ export type InscriptionResponse = InscriptionSuccessResponse | InscriptionQuoteR
97
101
  export declare function createInscriptionSuccess(params: {
98
102
  hrl: string;
99
103
  topicId: string;
104
+ jsonTopicId?: string;
100
105
  standard: 'Static' | 'Dynamic';
101
106
  cdnUrl?: string;
102
107
  transactionId?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hashgraphonline/standards-agent-kit",
3
- "version": "0.2.148",
3
+ "version": "0.2.149",
4
4
  "description": "A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication.",
5
5
  "type": "module",
6
6
  "main": "./dist/cjs/standards-agent-kit.cjs",
@@ -90,13 +90,7 @@ export class InscriberBuilder extends BaseServiceBuilder {
90
90
  delegate: (
91
91
  request: Record<string, unknown>,
92
92
  network: 'mainnet' | 'testnet'
93
- ) => Promise<{
94
- transactionBytes: string;
95
- tx_id?: string;
96
- topic_id?: string;
97
- status?: string;
98
- completed?: boolean;
99
- }>
93
+ ) => Promise<PendingInscriptionResponse | CompletedInscriptionResponse>
100
94
  ): void {
101
95
  InscriberBuilder.startInscriptionDelegate = delegate;
102
96
  }
@@ -280,7 +274,7 @@ export class InscriberBuilder extends BaseServiceBuilder {
280
274
 
281
275
  const completedStart = start as CompletedInscriptionResponse;
282
276
  const isCompletedResponse =
283
- completedStart?.inscription && completedStart?.confirmed;
277
+ Boolean(completedStart?.inscription) && completedStart?.confirmed;
284
278
 
285
279
  if (isCompletedResponse) {
286
280
  const completed = start as {
@@ -551,6 +551,7 @@ export class InscribeHashinalTool
551
551
  const successResponse = createInscriptionSuccess({
552
552
  hrl: hrl || 'hcs://1/unknown',
553
553
  topicId: topicId || 'unknown',
554
+ jsonTopicId: ids.jsonTopicId,
554
555
  standard: fileStandard === '6' ? 'Dynamic' : 'Static',
555
556
  cdnUrl,
556
557
  transactionId: txId,
@@ -680,6 +681,7 @@ export class InscribeHashinalTool
680
681
  name: response.metadata.name || 'Untitled Content',
681
682
  creator: response.metadata.creator || '',
682
683
  topicId: response.inscription.topicId,
684
+ jsonTopicId: response.inscription.jsonTopicId || response.jsonTopicId,
683
685
  hrl: response.inscription.hrl,
684
686
  network: network,
685
687
  },
@@ -13,6 +13,8 @@ export interface InscriptionSuccessResponse {
13
13
  hrl: string;
14
14
  /** Topic ID where the inscription was stored */
15
15
  topicId: string;
16
+ /** Topic ID containing the JSON metadata when available */
17
+ jsonTopicId?: string;
16
18
  /** Type of Hashinal - Static (HCS-5) or Dynamic (HCS-6) */
17
19
  standard: 'Static' | 'Dynamic';
18
20
  /** CDN URL for direct access to the inscribed content */
@@ -20,6 +22,8 @@ export interface InscriptionSuccessResponse {
20
22
  /** Transaction ID of the inscription */
21
23
  transactionId?: string;
22
24
  };
25
+ /** Topic ID used for metadata lookups */
26
+ jsonTopicId?: string;
23
27
  metadata: {
24
28
  /** Name/title of the inscribed content */
25
29
  name?: string;
@@ -102,6 +106,7 @@ export type InscriptionResponse =
102
106
  export function createInscriptionSuccess(params: {
103
107
  hrl: string;
104
108
  topicId: string;
109
+ jsonTopicId?: string;
105
110
  standard: 'Static' | 'Dynamic';
106
111
  cdnUrl?: string;
107
112
  transactionId?: string;
@@ -113,7 +118,15 @@ export function createInscriptionSuccess(params: {
113
118
  attributes?: Array<{ trait_type: string; value: string | number }>;
114
119
  };
115
120
  }): InscriptionSuccessResponse {
116
- const { hrl, topicId, standard, cdnUrl, transactionId, metadata } = params;
121
+ const {
122
+ hrl,
123
+ topicId,
124
+ jsonTopicId,
125
+ standard,
126
+ cdnUrl,
127
+ transactionId,
128
+ metadata,
129
+ } = params;
117
130
 
118
131
  return {
119
132
  success: true,
@@ -125,10 +138,12 @@ export function createInscriptionSuccess(params: {
125
138
  inscription: {
126
139
  hrl,
127
140
  topicId,
141
+ jsonTopicId,
128
142
  standard,
129
143
  cdnUrl,
130
144
  transactionId,
131
145
  },
146
+ jsonTopicId,
132
147
  metadata,
133
148
  nextSteps: {
134
149
  primary: 'CRITICAL: When minting NFTs, use ONLY the mintingMetadata value as a single string in the metadata array. Do NOT create JSON objects.',
@@ -23,7 +23,9 @@ export function extractTopicIds(
23
23
  result?: unknown
24
24
  ): TopicIds {
25
25
  const jsonTopicId =
26
- inscription?.jsonTopicId || getStringProp(inscription, 'json_topic_id');
26
+ inscription?.jsonTopicId ||
27
+ getStringProp(inscription, 'json_topic_id') ||
28
+ getStringProp(result, 'jsonTopicId');
27
29
 
28
30
  const imageTopicId =
29
31
  getStringProp(inscription, 'topic_id') ||