@hashgraphonline/standards-agent-kit 0.2.1 → 0.2.102
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/hcs10/hcs10-builder.d.ts +4 -0
- package/dist/cjs/builders/hcs2/hcs2-builder.d.ts +50 -0
- package/dist/cjs/builders/hcs2/index.d.ts +1 -0
- package/dist/cjs/builders/index.d.ts +2 -0
- package/dist/cjs/builders/inscriber/index.d.ts +1 -0
- package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +46 -0
- package/dist/cjs/index.d.ts +1 -1
- package/dist/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/tools/hcs10/FindRegistrationsTool.d.ts +4 -4
- package/dist/cjs/tools/hcs10/RegisterAgentTool.d.ts +24 -8
- package/dist/cjs/tools/hcs10/index.d.ts +1 -0
- package/dist/cjs/tools/hcs10/natural-language-mapper.d.ts +19 -0
- package/dist/cjs/tools/hcs2/CreateRegistryTool.d.ts +48 -0
- package/dist/cjs/tools/hcs2/DeleteEntryTool.d.ts +41 -0
- package/dist/cjs/tools/hcs2/MigrateRegistryTool.d.ts +47 -0
- package/dist/cjs/tools/hcs2/QueryRegistryTool.d.ts +47 -0
- package/dist/cjs/tools/hcs2/RegisterEntryTool.d.ts +47 -0
- package/dist/cjs/tools/hcs2/UpdateEntryTool.d.ts +53 -0
- package/dist/cjs/tools/hcs2/base-hcs2-tools.d.ts +28 -0
- package/dist/cjs/tools/hcs2/hcs2-tool-params.d.ts +18 -0
- package/dist/cjs/tools/hcs2/index.d.ts +8 -0
- package/dist/cjs/tools/index.d.ts +2 -0
- package/dist/cjs/tools/inscriber/InscribeFromBufferTool.d.ts +77 -0
- package/dist/cjs/tools/inscriber/InscribeFromFileTool.d.ts +65 -0
- package/dist/cjs/tools/inscriber/InscribeFromUrlTool.d.ts +65 -0
- package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +125 -0
- package/dist/cjs/tools/inscriber/RetrieveInscriptionTool.d.ts +35 -0
- package/dist/cjs/tools/inscriber/base-inscriber-tools.d.ts +28 -0
- package/dist/cjs/tools/inscriber/index.d.ts +7 -0
- package/dist/cjs/tools/inscriber/inscriber-tool-params.d.ts +18 -0
- package/dist/es/builders/hcs10/hcs10-builder.d.ts +4 -0
- package/dist/es/builders/hcs2/hcs2-builder.d.ts +50 -0
- package/dist/es/builders/hcs2/index.d.ts +1 -0
- package/dist/es/builders/index.d.ts +2 -0
- package/dist/es/builders/inscriber/index.d.ts +1 -0
- package/dist/es/builders/inscriber/inscriber-builder.d.ts +46 -0
- package/dist/es/index.d.ts +1 -1
- package/dist/es/standards-agent-kit.es.js +50 -16
- package/dist/es/standards-agent-kit.es.js.map +1 -1
- package/dist/es/standards-agent-kit.es10.js +17 -23
- package/dist/es/standards-agent-kit.es10.js.map +1 -1
- package/dist/es/standards-agent-kit.es11.js +36 -58
- package/dist/es/standards-agent-kit.es11.js.map +1 -1
- package/dist/es/standards-agent-kit.es12.js +43 -18
- package/dist/es/standards-agent-kit.es12.js.map +1 -1
- package/dist/es/standards-agent-kit.es13.js +53 -16
- package/dist/es/standards-agent-kit.es13.js.map +1 -1
- package/dist/es/standards-agent-kit.es14.js +18 -28
- package/dist/es/standards-agent-kit.es14.js.map +1 -1
- package/dist/es/standards-agent-kit.es15.js +26 -12
- package/dist/es/standards-agent-kit.es15.js.map +1 -1
- package/dist/es/standards-agent-kit.es16.js +37 -241
- package/dist/es/standards-agent-kit.es16.js.map +1 -1
- package/dist/es/standards-agent-kit.es17.js +16 -136
- package/dist/es/standards-agent-kit.es17.js.map +1 -1
- package/dist/es/standards-agent-kit.es18.js +154 -27
- package/dist/es/standards-agent-kit.es18.js.map +1 -1
- package/dist/es/standards-agent-kit.es19.js +26 -22
- package/dist/es/standards-agent-kit.es19.js.map +1 -1
- package/dist/es/standards-agent-kit.es2.js +27 -13
- package/dist/es/standards-agent-kit.es2.js.map +1 -1
- package/dist/es/standards-agent-kit.es20.js +42 -3
- package/dist/es/standards-agent-kit.es20.js.map +1 -1
- package/dist/es/standards-agent-kit.es21.js +48 -0
- package/dist/es/standards-agent-kit.es21.js.map +1 -0
- package/dist/es/standards-agent-kit.es22.js +51 -0
- package/dist/es/standards-agent-kit.es22.js.map +1 -0
- package/dist/es/standards-agent-kit.es23.js +45 -0
- package/dist/es/standards-agent-kit.es23.js.map +1 -0
- package/dist/es/standards-agent-kit.es24.js +48 -0
- package/dist/es/standards-agent-kit.es24.js.map +1 -0
- package/dist/es/standards-agent-kit.es25.js +45 -0
- package/dist/es/standards-agent-kit.es25.js.map +1 -0
- package/dist/es/standards-agent-kit.es26.js +32 -0
- package/dist/es/standards-agent-kit.es26.js.map +1 -0
- package/dist/es/standards-agent-kit.es27.js +71 -0
- package/dist/es/standards-agent-kit.es27.js.map +1 -0
- package/dist/es/standards-agent-kit.es28.js +71 -0
- package/dist/es/standards-agent-kit.es28.js.map +1 -0
- package/dist/es/standards-agent-kit.es29.js +79 -0
- package/dist/es/standards-agent-kit.es29.js.map +1 -0
- package/dist/es/standards-agent-kit.es3.js +59 -296
- package/dist/es/standards-agent-kit.es3.js.map +1 -1
- package/dist/es/standards-agent-kit.es30.js +90 -0
- package/dist/es/standards-agent-kit.es30.js.map +1 -0
- package/dist/es/standards-agent-kit.es31.js +45 -0
- package/dist/es/standards-agent-kit.es31.js.map +1 -0
- package/dist/es/standards-agent-kit.es32.js +249 -0
- package/dist/es/standards-agent-kit.es32.js.map +1 -0
- package/dist/es/standards-agent-kit.es33.js +141 -0
- package/dist/es/standards-agent-kit.es33.js.map +1 -0
- package/dist/es/standards-agent-kit.es34.js +33 -0
- package/dist/es/standards-agent-kit.es34.js.map +1 -0
- package/dist/es/standards-agent-kit.es35.js +28 -0
- package/dist/es/standards-agent-kit.es35.js.map +1 -0
- package/dist/es/standards-agent-kit.es36.js +7 -0
- package/dist/es/standards-agent-kit.es36.js.map +1 -0
- package/dist/es/standards-agent-kit.es4.js +44 -20
- package/dist/es/standards-agent-kit.es4.js.map +1 -1
- package/dist/es/standards-agent-kit.es5.js +312 -121
- package/dist/es/standards-agent-kit.es5.js.map +1 -1
- package/dist/es/standards-agent-kit.es6.js +24 -23
- package/dist/es/standards-agent-kit.es6.js.map +1 -1
- package/dist/es/standards-agent-kit.es7.js +220 -20
- package/dist/es/standards-agent-kit.es7.js.map +1 -1
- package/dist/es/standards-agent-kit.es8.js +20 -29
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/es/standards-agent-kit.es9.js +26 -36
- package/dist/es/standards-agent-kit.es9.js.map +1 -1
- package/dist/es/tools/hcs10/FindRegistrationsTool.d.ts +4 -4
- package/dist/es/tools/hcs10/RegisterAgentTool.d.ts +24 -8
- package/dist/es/tools/hcs10/index.d.ts +1 -0
- package/dist/es/tools/hcs10/natural-language-mapper.d.ts +19 -0
- package/dist/es/tools/hcs2/CreateRegistryTool.d.ts +48 -0
- package/dist/es/tools/hcs2/DeleteEntryTool.d.ts +41 -0
- package/dist/es/tools/hcs2/MigrateRegistryTool.d.ts +47 -0
- package/dist/es/tools/hcs2/QueryRegistryTool.d.ts +47 -0
- package/dist/es/tools/hcs2/RegisterEntryTool.d.ts +47 -0
- package/dist/es/tools/hcs2/UpdateEntryTool.d.ts +53 -0
- package/dist/es/tools/hcs2/base-hcs2-tools.d.ts +28 -0
- package/dist/es/tools/hcs2/hcs2-tool-params.d.ts +18 -0
- package/dist/es/tools/hcs2/index.d.ts +8 -0
- package/dist/es/tools/index.d.ts +2 -0
- package/dist/es/tools/inscriber/InscribeFromBufferTool.d.ts +77 -0
- package/dist/es/tools/inscriber/InscribeFromFileTool.d.ts +65 -0
- package/dist/es/tools/inscriber/InscribeFromUrlTool.d.ts +65 -0
- package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +125 -0
- package/dist/es/tools/inscriber/RetrieveInscriptionTool.d.ts +35 -0
- package/dist/es/tools/inscriber/base-inscriber-tools.d.ts +28 -0
- package/dist/es/tools/inscriber/index.d.ts +7 -0
- package/dist/es/tools/inscriber/inscriber-tool-params.d.ts +18 -0
- package/dist/umd/builders/hcs10/hcs10-builder.d.ts +4 -0
- package/dist/umd/builders/hcs2/hcs2-builder.d.ts +50 -0
- package/dist/umd/builders/hcs2/index.d.ts +1 -0
- package/dist/umd/builders/index.d.ts +2 -0
- package/dist/umd/builders/inscriber/index.d.ts +1 -0
- package/dist/umd/builders/inscriber/inscriber-builder.d.ts +46 -0
- package/dist/umd/index.d.ts +1 -1
- package/dist/umd/standards-agent-kit.umd.js +1 -1
- package/dist/umd/standards-agent-kit.umd.js.map +1 -1
- package/dist/umd/tools/hcs10/FindRegistrationsTool.d.ts +4 -4
- package/dist/umd/tools/hcs10/RegisterAgentTool.d.ts +24 -8
- package/dist/umd/tools/hcs10/index.d.ts +1 -0
- package/dist/umd/tools/hcs10/natural-language-mapper.d.ts +19 -0
- package/dist/umd/tools/hcs2/CreateRegistryTool.d.ts +48 -0
- package/dist/umd/tools/hcs2/DeleteEntryTool.d.ts +41 -0
- package/dist/umd/tools/hcs2/MigrateRegistryTool.d.ts +47 -0
- package/dist/umd/tools/hcs2/QueryRegistryTool.d.ts +47 -0
- package/dist/umd/tools/hcs2/RegisterEntryTool.d.ts +47 -0
- package/dist/umd/tools/hcs2/UpdateEntryTool.d.ts +53 -0
- package/dist/umd/tools/hcs2/base-hcs2-tools.d.ts +28 -0
- package/dist/umd/tools/hcs2/hcs2-tool-params.d.ts +18 -0
- package/dist/umd/tools/hcs2/index.d.ts +8 -0
- package/dist/umd/tools/index.d.ts +2 -0
- package/dist/umd/tools/inscriber/InscribeFromBufferTool.d.ts +77 -0
- package/dist/umd/tools/inscriber/InscribeFromFileTool.d.ts +65 -0
- package/dist/umd/tools/inscriber/InscribeFromUrlTool.d.ts +65 -0
- package/dist/umd/tools/inscriber/InscribeHashinalTool.d.ts +125 -0
- package/dist/umd/tools/inscriber/RetrieveInscriptionTool.d.ts +35 -0
- package/dist/umd/tools/inscriber/base-inscriber-tools.d.ts +28 -0
- package/dist/umd/tools/inscriber/index.d.ts +7 -0
- package/dist/umd/tools/inscriber/inscriber-tool-params.d.ts +18 -0
- package/package.json +32 -30
- package/src/builders/hcs10/hcs10-builder.ts +37 -16
- package/src/builders/hcs2/hcs2-builder.ts +148 -0
- package/src/builders/hcs2/index.ts +1 -0
- package/src/builders/index.ts +3 -1
- package/src/builders/inscriber/index.ts +1 -0
- package/src/builders/inscriber/inscriber-builder.ts +112 -0
- package/src/index.ts +1 -1
- package/src/tools/hcs10/FindRegistrationsTool.ts +19 -4
- package/src/tools/hcs10/RegisterAgentTool.ts +147 -9
- package/src/tools/hcs10/index.ts +2 -1
- package/src/tools/hcs10/natural-language-mapper.ts +194 -0
- package/src/tools/hcs2/CreateRegistryTool.ts +63 -0
- package/src/tools/hcs2/DeleteEntryTool.ts +58 -0
- package/src/tools/hcs2/MigrateRegistryTool.ts +64 -0
- package/src/tools/hcs2/QueryRegistryTool.ts +70 -0
- package/src/tools/hcs2/RegisterEntryTool.ts +63 -0
- package/src/tools/hcs2/UpdateEntryTool.ts +68 -0
- package/src/tools/hcs2/base-hcs2-tools.ts +65 -0
- package/src/tools/hcs2/hcs2-tool-params.ts +21 -0
- package/src/tools/hcs2/index.ts +8 -0
- package/src/tools/index.ts +3 -2
- package/src/tools/inscriber/InscribeFromBufferTool.ts +105 -0
- package/src/tools/inscriber/InscribeFromFileTool.ts +93 -0
- package/src/tools/inscriber/InscribeFromUrlTool.ts +93 -0
- package/src/tools/inscriber/InscribeHashinalTool.ts +117 -0
- package/src/tools/inscriber/RetrieveInscriptionTool.ts +59 -0
- package/src/tools/inscriber/base-inscriber-tools.ts +65 -0
- package/src/tools/inscriber/index.ts +7 -0
- package/src/tools/inscriber/inscriber-tool-params.ts +21 -0
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseInscriberQueryTool } from './base-inscriber-tools';
|
|
3
|
+
import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
4
|
+
/**
|
|
5
|
+
* Schema for inscribing from URL
|
|
6
|
+
*/
|
|
7
|
+
declare const inscribeFromUrlSchema: z.ZodObject<{
|
|
8
|
+
url: z.ZodString;
|
|
9
|
+
mode: z.ZodOptional<z.ZodEnum<["file", "hashinal"]>>;
|
|
10
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
11
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
12
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
waitForConfirmation: z.ZodOptional<z.ZodBoolean>;
|
|
14
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
url: string;
|
|
17
|
+
tags?: string[] | undefined;
|
|
18
|
+
metadata?: Record<string, unknown> | undefined;
|
|
19
|
+
mode?: "file" | "hashinal" | undefined;
|
|
20
|
+
chunkSize?: number | undefined;
|
|
21
|
+
waitForConfirmation?: boolean | undefined;
|
|
22
|
+
apiKey?: string | undefined;
|
|
23
|
+
}, {
|
|
24
|
+
url: string;
|
|
25
|
+
tags?: string[] | undefined;
|
|
26
|
+
metadata?: Record<string, unknown> | undefined;
|
|
27
|
+
mode?: "file" | "hashinal" | undefined;
|
|
28
|
+
chunkSize?: number | undefined;
|
|
29
|
+
waitForConfirmation?: boolean | undefined;
|
|
30
|
+
apiKey?: string | undefined;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Tool for inscribing content from URL
|
|
34
|
+
*/
|
|
35
|
+
export declare class InscribeFromUrlTool extends BaseInscriberQueryTool<typeof inscribeFromUrlSchema> {
|
|
36
|
+
name: string;
|
|
37
|
+
description: string;
|
|
38
|
+
get specificInputSchema(): z.ZodObject<{
|
|
39
|
+
url: z.ZodString;
|
|
40
|
+
mode: z.ZodOptional<z.ZodEnum<["file", "hashinal"]>>;
|
|
41
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
42
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
43
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
44
|
+
waitForConfirmation: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
46
|
+
}, "strip", z.ZodTypeAny, {
|
|
47
|
+
url: string;
|
|
48
|
+
tags?: string[] | undefined;
|
|
49
|
+
metadata?: Record<string, unknown> | undefined;
|
|
50
|
+
mode?: "file" | "hashinal" | undefined;
|
|
51
|
+
chunkSize?: number | undefined;
|
|
52
|
+
waitForConfirmation?: boolean | undefined;
|
|
53
|
+
apiKey?: string | undefined;
|
|
54
|
+
}, {
|
|
55
|
+
url: string;
|
|
56
|
+
tags?: string[] | undefined;
|
|
57
|
+
metadata?: Record<string, unknown> | undefined;
|
|
58
|
+
mode?: "file" | "hashinal" | undefined;
|
|
59
|
+
chunkSize?: number | undefined;
|
|
60
|
+
waitForConfirmation?: boolean | undefined;
|
|
61
|
+
apiKey?: string | undefined;
|
|
62
|
+
}>;
|
|
63
|
+
protected executeQuery(params: z.infer<typeof inscribeFromUrlSchema>, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseInscriberQueryTool } from './base-inscriber-tools';
|
|
3
|
+
import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
4
|
+
/**
|
|
5
|
+
* Schema for inscribing Hashinal NFT
|
|
6
|
+
*/
|
|
7
|
+
declare const inscribeHashinalSchema: z.ZodObject<{
|
|
8
|
+
url: z.ZodString;
|
|
9
|
+
name: z.ZodString;
|
|
10
|
+
creator: z.ZodString;
|
|
11
|
+
description: z.ZodString;
|
|
12
|
+
type: z.ZodString;
|
|
13
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
14
|
+
trait_type: z.ZodString;
|
|
15
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
value: string | number;
|
|
18
|
+
trait_type: string;
|
|
19
|
+
}, {
|
|
20
|
+
value: string | number;
|
|
21
|
+
trait_type: string;
|
|
22
|
+
}>, "many">>;
|
|
23
|
+
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
24
|
+
jsonFileURL: z.ZodOptional<z.ZodString>;
|
|
25
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
26
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
27
|
+
waitForConfirmation: z.ZodOptional<z.ZodBoolean>;
|
|
28
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
29
|
+
}, "strip", z.ZodTypeAny, {
|
|
30
|
+
url: string;
|
|
31
|
+
type: string;
|
|
32
|
+
name: string;
|
|
33
|
+
description: string;
|
|
34
|
+
creator: string;
|
|
35
|
+
tags?: string[] | undefined;
|
|
36
|
+
properties?: Record<string, unknown> | undefined;
|
|
37
|
+
chunkSize?: number | undefined;
|
|
38
|
+
waitForConfirmation?: boolean | undefined;
|
|
39
|
+
apiKey?: string | undefined;
|
|
40
|
+
attributes?: {
|
|
41
|
+
value: string | number;
|
|
42
|
+
trait_type: string;
|
|
43
|
+
}[] | undefined;
|
|
44
|
+
jsonFileURL?: string | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
url: string;
|
|
47
|
+
type: string;
|
|
48
|
+
name: string;
|
|
49
|
+
description: string;
|
|
50
|
+
creator: string;
|
|
51
|
+
tags?: string[] | undefined;
|
|
52
|
+
properties?: Record<string, unknown> | undefined;
|
|
53
|
+
chunkSize?: number | undefined;
|
|
54
|
+
waitForConfirmation?: boolean | undefined;
|
|
55
|
+
apiKey?: string | undefined;
|
|
56
|
+
attributes?: {
|
|
57
|
+
value: string | number;
|
|
58
|
+
trait_type: string;
|
|
59
|
+
}[] | undefined;
|
|
60
|
+
jsonFileURL?: string | undefined;
|
|
61
|
+
}>;
|
|
62
|
+
/**
|
|
63
|
+
* Tool for inscribing Hashinal NFTs
|
|
64
|
+
*/
|
|
65
|
+
export declare class InscribeHashinalTool extends BaseInscriberQueryTool<typeof inscribeHashinalSchema> {
|
|
66
|
+
name: string;
|
|
67
|
+
description: string;
|
|
68
|
+
get specificInputSchema(): z.ZodObject<{
|
|
69
|
+
url: z.ZodString;
|
|
70
|
+
name: z.ZodString;
|
|
71
|
+
creator: z.ZodString;
|
|
72
|
+
description: z.ZodString;
|
|
73
|
+
type: z.ZodString;
|
|
74
|
+
attributes: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
75
|
+
trait_type: z.ZodString;
|
|
76
|
+
value: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
77
|
+
}, "strip", z.ZodTypeAny, {
|
|
78
|
+
value: string | number;
|
|
79
|
+
trait_type: string;
|
|
80
|
+
}, {
|
|
81
|
+
value: string | number;
|
|
82
|
+
trait_type: string;
|
|
83
|
+
}>, "many">>;
|
|
84
|
+
properties: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
85
|
+
jsonFileURL: z.ZodOptional<z.ZodString>;
|
|
86
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
87
|
+
chunkSize: z.ZodOptional<z.ZodNumber>;
|
|
88
|
+
waitForConfirmation: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
90
|
+
}, "strip", z.ZodTypeAny, {
|
|
91
|
+
url: string;
|
|
92
|
+
type: string;
|
|
93
|
+
name: string;
|
|
94
|
+
description: string;
|
|
95
|
+
creator: string;
|
|
96
|
+
tags?: string[] | undefined;
|
|
97
|
+
properties?: Record<string, unknown> | undefined;
|
|
98
|
+
chunkSize?: number | undefined;
|
|
99
|
+
waitForConfirmation?: boolean | undefined;
|
|
100
|
+
apiKey?: string | undefined;
|
|
101
|
+
attributes?: {
|
|
102
|
+
value: string | number;
|
|
103
|
+
trait_type: string;
|
|
104
|
+
}[] | undefined;
|
|
105
|
+
jsonFileURL?: string | undefined;
|
|
106
|
+
}, {
|
|
107
|
+
url: string;
|
|
108
|
+
type: string;
|
|
109
|
+
name: string;
|
|
110
|
+
description: string;
|
|
111
|
+
creator: string;
|
|
112
|
+
tags?: string[] | undefined;
|
|
113
|
+
properties?: Record<string, unknown> | undefined;
|
|
114
|
+
chunkSize?: number | undefined;
|
|
115
|
+
waitForConfirmation?: boolean | undefined;
|
|
116
|
+
apiKey?: string | undefined;
|
|
117
|
+
attributes?: {
|
|
118
|
+
value: string | number;
|
|
119
|
+
trait_type: string;
|
|
120
|
+
}[] | undefined;
|
|
121
|
+
jsonFileURL?: string | undefined;
|
|
122
|
+
}>;
|
|
123
|
+
protected executeQuery(params: z.infer<typeof inscribeHashinalSchema>, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
124
|
+
}
|
|
125
|
+
export {};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseInscriberQueryTool } from './base-inscriber-tools';
|
|
3
|
+
import { CallbackManagerForToolRun } from '@langchain/core/callbacks/manager';
|
|
4
|
+
/**
|
|
5
|
+
* Schema for retrieving inscription
|
|
6
|
+
*/
|
|
7
|
+
declare const retrieveInscriptionSchema: z.ZodObject<{
|
|
8
|
+
transactionId: z.ZodString;
|
|
9
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
10
|
+
}, "strip", z.ZodTypeAny, {
|
|
11
|
+
transactionId: string;
|
|
12
|
+
apiKey?: string | undefined;
|
|
13
|
+
}, {
|
|
14
|
+
transactionId: string;
|
|
15
|
+
apiKey?: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
/**
|
|
18
|
+
* Tool for retrieving inscriptions
|
|
19
|
+
*/
|
|
20
|
+
export declare class RetrieveInscriptionTool extends BaseInscriberQueryTool<typeof retrieveInscriptionSchema> {
|
|
21
|
+
name: string;
|
|
22
|
+
description: string;
|
|
23
|
+
get specificInputSchema(): z.ZodObject<{
|
|
24
|
+
transactionId: z.ZodString;
|
|
25
|
+
apiKey: z.ZodOptional<z.ZodString>;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
transactionId: string;
|
|
28
|
+
apiKey?: string | undefined;
|
|
29
|
+
}, {
|
|
30
|
+
transactionId: string;
|
|
31
|
+
apiKey?: string | undefined;
|
|
32
|
+
}>;
|
|
33
|
+
protected executeQuery(params: z.infer<typeof retrieveInscriptionSchema>, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
34
|
+
}
|
|
35
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseHederaTransactionTool, BaseHederaQueryTool, BaseServiceBuilder } from 'hedera-agent-kit';
|
|
2
|
+
import { InscriberBuilder } from '../../builders/inscriber/inscriber-builder';
|
|
3
|
+
import { InscriberTransactionToolParams, InscriberQueryToolParams } from './inscriber-tool-params';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/**
|
|
6
|
+
* Base class for Inscriber transaction tools
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class BaseInscriberTransactionTool<T extends z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny> = z.ZodObject<z.ZodRawShape>> extends BaseHederaTransactionTool<T> {
|
|
9
|
+
protected inscriberBuilder: InscriberBuilder;
|
|
10
|
+
namespace: "inscriber";
|
|
11
|
+
constructor(params: InscriberTransactionToolParams);
|
|
12
|
+
/**
|
|
13
|
+
* Override to return the InscriberBuilder
|
|
14
|
+
*/
|
|
15
|
+
protected getServiceBuilder(): BaseServiceBuilder;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Base class for Inscriber query tools
|
|
19
|
+
*/
|
|
20
|
+
export declare abstract class BaseInscriberQueryTool<T extends z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny, Record<string, unknown>, Record<string, unknown>> = z.ZodObject<z.ZodRawShape>> extends BaseHederaQueryTool<T> {
|
|
21
|
+
protected inscriberBuilder: InscriberBuilder;
|
|
22
|
+
namespace: "inscriber";
|
|
23
|
+
constructor(params: InscriberQueryToolParams);
|
|
24
|
+
/**
|
|
25
|
+
* Override to return the InscriberBuilder
|
|
26
|
+
*/
|
|
27
|
+
protected getServiceBuilder(): BaseServiceBuilder;
|
|
28
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './base-inscriber-tools';
|
|
2
|
+
export * from './inscriber-tool-params';
|
|
3
|
+
export * from './InscribeFromUrlTool';
|
|
4
|
+
export * from './InscribeFromFileTool';
|
|
5
|
+
export * from './InscribeFromBufferTool';
|
|
6
|
+
export * from './InscribeHashinalTool';
|
|
7
|
+
export * from './RetrieveInscriptionTool';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HederaAgentKit, BasePluginContext } from 'hedera-agent-kit';
|
|
2
|
+
import { InscriberBuilder } from '../../builders/inscriber/inscriber-builder';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for Inscriber transaction tools
|
|
5
|
+
*/
|
|
6
|
+
export interface InscriberTransactionToolParams {
|
|
7
|
+
hederaKit: HederaAgentKit;
|
|
8
|
+
inscriberBuilder: InscriberBuilder;
|
|
9
|
+
logger?: BasePluginContext['logger'];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parameters for Inscriber query tools
|
|
13
|
+
*/
|
|
14
|
+
export interface InscriberQueryToolParams {
|
|
15
|
+
hederaKit: HederaAgentKit;
|
|
16
|
+
inscriberBuilder: InscriberBuilder;
|
|
17
|
+
logger?: BasePluginContext['logger'];
|
|
18
|
+
}
|
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.102",
|
|
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",
|
|
@@ -21,6 +21,32 @@
|
|
|
21
21
|
"LICENSE",
|
|
22
22
|
"README.md"
|
|
23
23
|
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"clean": "rimraf dist",
|
|
26
|
+
"build:es": "BUILD_FORMAT=es vite build",
|
|
27
|
+
"build:cjs": "BUILD_FORMAT=cjs vite build",
|
|
28
|
+
"build:umd": "BUILD_FORMAT=umd vite build",
|
|
29
|
+
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && pnpm run build:umd",
|
|
30
|
+
"test": "jest",
|
|
31
|
+
"lint": "eslint . --ext .ts",
|
|
32
|
+
"lint:fix": "eslint . --ext .ts --fix",
|
|
33
|
+
"prepare": "pnpm run build",
|
|
34
|
+
"prepublishOnly": "pnpm run build",
|
|
35
|
+
"release": "pnpm publish --access public",
|
|
36
|
+
"release:canary": "pnpm run prepublishOnly && pnpm publish --tag canary --access public",
|
|
37
|
+
"version:canary": "pnpm version prerelease --preid canary --no-git-tag-version",
|
|
38
|
+
"publish:canary": "pnpm run version:canary && pnpm run release:canary",
|
|
39
|
+
"demo:cli": "tsx examples/cli-demo.ts",
|
|
40
|
+
"demo:interactive": "tsx examples/interactive-demo.ts",
|
|
41
|
+
"demo:langchain": "tsx examples/langchain-demo.ts",
|
|
42
|
+
"demo:plugin": "tsx examples/plugin-system-example.ts",
|
|
43
|
+
"demo:plugin:weather": "tsx examples/plugins/weather/index.ts",
|
|
44
|
+
"demo:plugin:defi": "tsx examples/plugins/defi/index.ts",
|
|
45
|
+
"demo:plugin:openconvai": "tsx examples/openconvai-plugin-example.ts",
|
|
46
|
+
"standards-agent:start": "tsx examples/standards-expert/cli.ts -- start",
|
|
47
|
+
"standards-agent:process-docs": "tsx examples/standards-expert/cli.ts -- process-docs --all-repos",
|
|
48
|
+
"typecheck": "tsc --noEmit"
|
|
49
|
+
},
|
|
24
50
|
"keywords": [
|
|
25
51
|
"hedera",
|
|
26
52
|
"hcs10",
|
|
@@ -43,7 +69,7 @@
|
|
|
43
69
|
"license": "Apache-2.0",
|
|
44
70
|
"repository": {
|
|
45
71
|
"type": "git",
|
|
46
|
-
"url": "https://github.com/hashgraph-online/standards-agent-kit"
|
|
72
|
+
"url": "git+https://github.com/hashgraph-online/standards-agent-kit.git"
|
|
47
73
|
},
|
|
48
74
|
"bugs": {
|
|
49
75
|
"url": "https://github.com/hashgraph-online/standards-agent-kit/issues"
|
|
@@ -63,7 +89,7 @@
|
|
|
63
89
|
},
|
|
64
90
|
"dependencies": {
|
|
65
91
|
"@hashgraph/sdk": "^2.67.0",
|
|
66
|
-
"@hashgraphonline/standards-sdk": "^0.0.
|
|
92
|
+
"@hashgraphonline/standards-sdk": "^0.0.149",
|
|
67
93
|
"@langchain/community": "^0.3.48",
|
|
68
94
|
"@langchain/core": "^0.3.62",
|
|
69
95
|
"@langchain/openai": "^0.5.18",
|
|
@@ -79,8 +105,7 @@
|
|
|
79
105
|
"zod": "^3.25.28"
|
|
80
106
|
},
|
|
81
107
|
"devDependencies": {
|
|
82
|
-
"@hashgraphonline/standards-agent-
|
|
83
|
-
"@hashgraphonline/standards-agent-plugin": "^0.0.1",
|
|
108
|
+
"@hashgraphonline/standards-agent-plugin": "^0.0.3",
|
|
84
109
|
"@rollup/plugin-commonjs": "^28.0.6",
|
|
85
110
|
"@swc/core": "^1.11.21",
|
|
86
111
|
"@swc/jest": "^0.2.36",
|
|
@@ -102,28 +127,5 @@
|
|
|
102
127
|
"vite-plugin-node-polyfills": "^0.23.0",
|
|
103
128
|
"vite-plugin-string-replace": "^1.1.3"
|
|
104
129
|
},
|
|
105
|
-
"
|
|
106
|
-
|
|
107
|
-
"build:es": "BUILD_FORMAT=es vite build",
|
|
108
|
-
"build:cjs": "BUILD_FORMAT=cjs vite build",
|
|
109
|
-
"build:umd": "BUILD_FORMAT=umd vite build",
|
|
110
|
-
"build": "pnpm run clean && pnpm run build:es && pnpm run build:cjs && pnpm run build:umd",
|
|
111
|
-
"test": "jest",
|
|
112
|
-
"lint": "eslint . --ext .ts",
|
|
113
|
-
"lint:fix": "eslint . --ext .ts --fix",
|
|
114
|
-
"release": "pnpm publish --access public",
|
|
115
|
-
"release:canary": "pnpm run prepublishOnly && pnpm publish --tag canary --access public",
|
|
116
|
-
"version:canary": "pnpm version prerelease --preid canary --no-git-tag-version",
|
|
117
|
-
"publish:canary": "pnpm run version:canary && pnpm run release:canary",
|
|
118
|
-
"demo:cli": "tsx examples/cli-demo.ts",
|
|
119
|
-
"demo:interactive": "tsx examples/interactive-demo.ts",
|
|
120
|
-
"demo:langchain": "tsx examples/langchain-demo.ts",
|
|
121
|
-
"demo:plugin": "tsx examples/plugin-system-example.ts",
|
|
122
|
-
"demo:plugin:weather": "tsx examples/plugins/weather/index.ts",
|
|
123
|
-
"demo:plugin:defi": "tsx examples/plugins/defi/index.ts",
|
|
124
|
-
"demo:plugin:openconvai": "tsx examples/openconvai-plugin-example.ts",
|
|
125
|
-
"standards-agent:start": "tsx examples/standards-expert/cli.ts -- start",
|
|
126
|
-
"standards-agent:process-docs": "tsx examples/standards-expert/cli.ts -- process-docs --all-repos",
|
|
127
|
-
"typecheck": "tsc --noEmit"
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
+
"packageManager": "pnpm@10.11.1+sha512.e519b9f7639869dc8d5c3c5dfef73b3f091094b0a006d7317353c72b124e80e1afd429732e28705ad6bfa1ee879c1fce46c128ccebd3192101f43dd67c667912"
|
|
131
|
+
}
|
|
@@ -202,6 +202,13 @@ export class HCS10Builder extends BaseServiceBuilder {
|
|
|
202
202
|
return this.network;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
+
/**
|
|
206
|
+
* Get state manager instance
|
|
207
|
+
*/
|
|
208
|
+
public getStateManager(): IStateManager | undefined {
|
|
209
|
+
return this.stateManager;
|
|
210
|
+
}
|
|
211
|
+
|
|
205
212
|
/**
|
|
206
213
|
* Get account and signer information
|
|
207
214
|
*/
|
|
@@ -392,17 +399,19 @@ export class HCS10Builder extends BaseServiceBuilder {
|
|
|
392
399
|
try {
|
|
393
400
|
const result = await this.standardClient.getMessages(topicId);
|
|
394
401
|
|
|
395
|
-
const mappedMessages: HCSMessageWithTimestamp[] = result.messages.map(
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
402
|
+
const mappedMessages: HCSMessageWithTimestamp[] = result.messages.map(
|
|
403
|
+
(sdkMessage) => {
|
|
404
|
+
const timestamp = sdkMessage?.created?.getTime() || 0;
|
|
405
|
+
|
|
406
|
+
return {
|
|
407
|
+
...sdkMessage,
|
|
408
|
+
timestamp: timestamp,
|
|
409
|
+
data: sdkMessage.data || '',
|
|
410
|
+
sequence_number: sdkMessage.sequence_number,
|
|
411
|
+
p: 'hcs-10' as const,
|
|
412
|
+
} as HCSMessageWithTimestamp;
|
|
413
|
+
}
|
|
414
|
+
);
|
|
406
415
|
mappedMessages.sort(
|
|
407
416
|
(a: { timestamp: number }, b: { timestamp: number }) =>
|
|
408
417
|
a.timestamp - b.timestamp
|
|
@@ -432,7 +441,9 @@ export class HCS10Builder extends BaseServiceBuilder {
|
|
|
432
441
|
);
|
|
433
442
|
}
|
|
434
443
|
|
|
435
|
-
return this.standardClient.getMessageStream(topicId) as Promise<{
|
|
444
|
+
return this.standardClient.getMessageStream(topicId) as Promise<{
|
|
445
|
+
messages: HCSMessage[];
|
|
446
|
+
}>;
|
|
436
447
|
}
|
|
437
448
|
|
|
438
449
|
/**
|
|
@@ -630,7 +641,8 @@ export class HCS10Builder extends BaseServiceBuilder {
|
|
|
630
641
|
}
|
|
631
642
|
|
|
632
643
|
try {
|
|
633
|
-
let profilePictureData: { buffer: Buffer; filename: string } | null =
|
|
644
|
+
let profilePictureData: { buffer: Buffer; filename: string } | null =
|
|
645
|
+
null;
|
|
634
646
|
if (params.profilePicture) {
|
|
635
647
|
profilePictureData = await this.loadProfilePicture(
|
|
636
648
|
params.profilePicture
|
|
@@ -1509,7 +1521,10 @@ export class HCS10Builder extends BaseServiceBuilder {
|
|
|
1509
1521
|
const messages = await this.getMessages(inboundTopicId);
|
|
1510
1522
|
|
|
1511
1523
|
const unapprovedRequests = messages.messages
|
|
1512
|
-
.filter(
|
|
1524
|
+
.filter(
|
|
1525
|
+
(msg): msg is HCSMessageWithTimestamp & { op: string } =>
|
|
1526
|
+
msg.op === 'connection_request'
|
|
1527
|
+
)
|
|
1513
1528
|
.map((msg) => ({
|
|
1514
1529
|
requestId: msg.sequence_number,
|
|
1515
1530
|
fromAccountId: msg.operator_id?.split('@')[1] || 'unknown',
|
|
@@ -1517,7 +1532,10 @@ export class HCS10Builder extends BaseServiceBuilder {
|
|
|
1517
1532
|
memo: msg.m || '',
|
|
1518
1533
|
data: msg.data,
|
|
1519
1534
|
}))
|
|
1520
|
-
.filter(
|
|
1535
|
+
.filter(
|
|
1536
|
+
(req): req is typeof req & { fromAccountId: string } =>
|
|
1537
|
+
req.fromAccountId !== 'unknown'
|
|
1538
|
+
);
|
|
1521
1539
|
|
|
1522
1540
|
this.executeResult = {
|
|
1523
1541
|
success: true,
|
|
@@ -2053,7 +2071,10 @@ export class HCS10Builder extends BaseServiceBuilder {
|
|
|
2053
2071
|
|
|
2054
2072
|
if (profile.social && Object.keys(profile.social).length > 0) {
|
|
2055
2073
|
profileDetails += `Social: ${Object.entries(profile.social)
|
|
2056
|
-
.map(
|
|
2074
|
+
.map(
|
|
2075
|
+
([platform, handle]: [string, unknown]): string =>
|
|
2076
|
+
`${platform}: ${handle}`
|
|
2077
|
+
)
|
|
2057
2078
|
.join(', ')}\n`;
|
|
2058
2079
|
}
|
|
2059
2080
|
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import { BaseServiceBuilder } from 'hedera-agent-kit';
|
|
2
|
+
import type { HederaAgentKit } from 'hedera-agent-kit';
|
|
3
|
+
import {
|
|
4
|
+
HCS2Client,
|
|
5
|
+
SDKHCS2ClientConfig,
|
|
6
|
+
CreateRegistryOptions,
|
|
7
|
+
RegisterEntryOptions,
|
|
8
|
+
UpdateEntryOptions,
|
|
9
|
+
DeleteEntryOptions,
|
|
10
|
+
MigrateTopicOptions,
|
|
11
|
+
QueryRegistryOptions,
|
|
12
|
+
TopicRegistrationResponse,
|
|
13
|
+
RegistryOperationResponse,
|
|
14
|
+
TopicRegistry,
|
|
15
|
+
NetworkType,
|
|
16
|
+
} from '@hashgraphonline/standards-sdk';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Builder for HCS-2 operations that delegates to HCS2Client
|
|
20
|
+
*/
|
|
21
|
+
export class HCS2Builder extends BaseServiceBuilder {
|
|
22
|
+
protected hcs2Client?: HCS2Client;
|
|
23
|
+
|
|
24
|
+
constructor(hederaKit: HederaAgentKit) {
|
|
25
|
+
super(hederaKit);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get or create HCS-2 client
|
|
30
|
+
*/
|
|
31
|
+
protected async getHCS2Client(): Promise<HCS2Client> {
|
|
32
|
+
if (!this.hcs2Client) {
|
|
33
|
+
const operatorId = this.hederaKit.signer.getAccountId().toString();
|
|
34
|
+
const operatorPrivateKey = this.hederaKit.signer?.getOperatorPrivateKey()
|
|
35
|
+
? this.hederaKit.signer.getOperatorPrivateKey().toStringRaw()
|
|
36
|
+
: '';
|
|
37
|
+
|
|
38
|
+
const network = this.hederaKit.client.network;
|
|
39
|
+
const networkType: NetworkType = network.toString().includes('mainnet')
|
|
40
|
+
? 'mainnet'
|
|
41
|
+
: 'testnet';
|
|
42
|
+
|
|
43
|
+
const config: SDKHCS2ClientConfig = {
|
|
44
|
+
network: networkType,
|
|
45
|
+
operatorId: operatorId,
|
|
46
|
+
operatorKey: operatorPrivateKey,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
this.hcs2Client = new HCS2Client(config);
|
|
50
|
+
}
|
|
51
|
+
return this.hcs2Client;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Create a new HCS-2 registry
|
|
56
|
+
* Note: This executes the transaction directly via HCS2Client
|
|
57
|
+
*/
|
|
58
|
+
async createRegistry(
|
|
59
|
+
options: CreateRegistryOptions = {}
|
|
60
|
+
): Promise<TopicRegistrationResponse> {
|
|
61
|
+
const client = await this.getHCS2Client();
|
|
62
|
+
return await client.createRegistry(options);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Register a new entry in an HCS-2 registry
|
|
67
|
+
*/
|
|
68
|
+
async registerEntry(
|
|
69
|
+
registryTopicId: string,
|
|
70
|
+
options: RegisterEntryOptions
|
|
71
|
+
): Promise<RegistryOperationResponse> {
|
|
72
|
+
const client = await this.getHCS2Client();
|
|
73
|
+
return await client.registerEntry(registryTopicId, options);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Update an existing entry in an HCS-2 registry
|
|
78
|
+
*/
|
|
79
|
+
async updateEntry(
|
|
80
|
+
registryTopicId: string,
|
|
81
|
+
options: UpdateEntryOptions
|
|
82
|
+
): Promise<RegistryOperationResponse> {
|
|
83
|
+
const client = await this.getHCS2Client();
|
|
84
|
+
return await client.updateEntry(registryTopicId, options);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Delete an entry from an HCS-2 registry
|
|
89
|
+
*/
|
|
90
|
+
async deleteEntry(
|
|
91
|
+
registryTopicId: string,
|
|
92
|
+
options: DeleteEntryOptions
|
|
93
|
+
): Promise<RegistryOperationResponse> {
|
|
94
|
+
const client = await this.getHCS2Client();
|
|
95
|
+
return await client.deleteEntry(registryTopicId, options);
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/**
|
|
99
|
+
* Migrate an HCS-2 registry to a new topic
|
|
100
|
+
*/
|
|
101
|
+
async migrateRegistry(
|
|
102
|
+
registryTopicId: string,
|
|
103
|
+
options: MigrateTopicOptions
|
|
104
|
+
): Promise<RegistryOperationResponse> {
|
|
105
|
+
const client = await this.getHCS2Client();
|
|
106
|
+
return await client.migrateRegistry(registryTopicId, options);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/**
|
|
110
|
+
* Query entries from an HCS-2 registry
|
|
111
|
+
*/
|
|
112
|
+
async getRegistry(
|
|
113
|
+
topicId: string,
|
|
114
|
+
options: QueryRegistryOptions = {}
|
|
115
|
+
): Promise<TopicRegistry> {
|
|
116
|
+
const client = await this.getHCS2Client();
|
|
117
|
+
return await client.getRegistry(topicId, options);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Submit a raw message to an HCS-2 topic
|
|
122
|
+
*/
|
|
123
|
+
async submitMessage(
|
|
124
|
+
topicId: string,
|
|
125
|
+
payload: any
|
|
126
|
+
): Promise<any> {
|
|
127
|
+
const client = await this.getHCS2Client();
|
|
128
|
+
return await client.submitMessage(topicId, payload);
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/**
|
|
132
|
+
* Get topic info from mirror node
|
|
133
|
+
*/
|
|
134
|
+
async getTopicInfo(topicId: string): Promise<any> {
|
|
135
|
+
const client = await this.getHCS2Client();
|
|
136
|
+
return await client.getTopicInfo(topicId);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Close the HCS-2 client
|
|
141
|
+
*/
|
|
142
|
+
async close(): Promise<void> {
|
|
143
|
+
if (this.hcs2Client) {
|
|
144
|
+
this.hcs2Client.close();
|
|
145
|
+
this.hcs2Client = undefined;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hcs2-builder';
|
package/src/builders/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './inscriber-builder';
|