@hashgraphonline/standards-agent-kit 0.2.148 → 0.2.151
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.
- package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +1 -7
- package/dist/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/utils/inscription-utils.d.ts +1 -1
- package/dist/es/builders/inscriber/inscriber-builder.d.ts +1 -7
- package/dist/es/standards-agent-kit.es48.js +7 -3
- package/dist/es/standards-agent-kit.es48.js.map +1 -1
- package/dist/es/standards-agent-kit.es49.js +3 -7
- package/dist/es/standards-agent-kit.es49.js.map +1 -1
- package/dist/es/standards-agent-kit.es51.js +1 -1
- package/dist/es/standards-agent-kit.es51.js.map +1 -1
- package/dist/es/standards-agent-kit.es6.js +1 -1
- package/dist/es/standards-agent-kit.es7.js +1 -1
- package/dist/es/standards-agent-kit.es8.js +11 -1
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/es/standards-agent-kit.es9.js +1 -1
- package/dist/es/utils/inscription-utils.d.ts +1 -1
- package/dist/umd/builders/inscriber/inscriber-builder.d.ts +1 -7
- package/dist/umd/standards-agent-kit.umd.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js.map +1 -1
- package/dist/umd/utils/inscription-utils.d.ts +1 -1
- package/package.json +1 -1
- package/src/builders/inscriber/inscriber-builder.ts +12 -8
- package/src/utils/inscription-utils.ts +2 -2
|
@@ -9,7 +9,7 @@ export interface TopicIds {
|
|
|
9
9
|
* - Prefers jsonTopicId when present (for CDN linking)
|
|
10
10
|
* - Collects topic_id/topicId from either inscription or result
|
|
11
11
|
*/
|
|
12
|
-
export declare function extractTopicIds(inscription
|
|
12
|
+
export declare function extractTopicIds(inscription: RetrievedInscriptionResult, result?: unknown): TopicIds;
|
|
13
13
|
/**
|
|
14
14
|
* Build HRL/CDN URLs from extracted topic ids.
|
|
15
15
|
* - HRL prefers jsonTopicId, falls back to topicId
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hashgraphonline/standards-agent-kit",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.151",
|
|
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 {
|
|
@@ -288,6 +282,10 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
288
282
|
result?: unknown;
|
|
289
283
|
inscription?: unknown;
|
|
290
284
|
};
|
|
285
|
+
this.logger.info(
|
|
286
|
+
'inscription already completed, short circuiting',
|
|
287
|
+
start
|
|
288
|
+
);
|
|
291
289
|
return {
|
|
292
290
|
quote: false,
|
|
293
291
|
confirmed: completed.confirmed === true,
|
|
@@ -319,6 +317,7 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
319
317
|
? false
|
|
320
318
|
: options.waitForConfirmation ?? true;
|
|
321
319
|
if (shouldWait) {
|
|
320
|
+
this.logger.debug('Will be retrieving inscription');
|
|
322
321
|
const maxAttempts =
|
|
323
322
|
(options as { waitMaxAttempts?: number }).waitMaxAttempts ?? 60;
|
|
324
323
|
const intervalMs =
|
|
@@ -348,6 +347,11 @@ export class InscriberBuilder extends BaseServiceBuilder {
|
|
|
348
347
|
},
|
|
349
348
|
inscription: retrieved,
|
|
350
349
|
} as unknown as InscriptionResponse;
|
|
350
|
+
this.logger.debug(
|
|
351
|
+
'retrieved inscription',
|
|
352
|
+
resultConfirmed,
|
|
353
|
+
retrieved
|
|
354
|
+
);
|
|
351
355
|
return resultConfirmed;
|
|
352
356
|
}
|
|
353
357
|
} catch {}
|
|
@@ -19,11 +19,11 @@ function getStringProp(obj: unknown, key: string): string | undefined {
|
|
|
19
19
|
* - Collects topic_id/topicId from either inscription or result
|
|
20
20
|
*/
|
|
21
21
|
export function extractTopicIds(
|
|
22
|
-
inscription
|
|
22
|
+
inscription: RetrievedInscriptionResult,
|
|
23
23
|
result?: unknown
|
|
24
24
|
): TopicIds {
|
|
25
25
|
const jsonTopicId =
|
|
26
|
-
inscription
|
|
26
|
+
inscription.jsonTopicId || getStringProp(inscription, 'json_topic_id');
|
|
27
27
|
|
|
28
28
|
const imageTopicId =
|
|
29
29
|
getStringProp(inscription, 'topic_id') ||
|