@hashgraphonline/standards-agent-kit 0.2.110 → 0.2.113
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/hcs6/hcs6-builder.d.ts +47 -0
- package/dist/cjs/builders/hcs6/index.d.ts +1 -0
- package/dist/cjs/builders/index.d.ts +1 -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/hcs6/CreateDynamicRegistryTool.d.ts +44 -0
- package/dist/cjs/tools/hcs6/QueryDynamicRegistryTool.d.ts +50 -0
- package/dist/cjs/tools/hcs6/RegisterDynamicHashinalTool.d.ts +102 -0
- package/dist/cjs/tools/hcs6/UpdateDynamicHashinalTool.d.ts +96 -0
- package/dist/cjs/tools/hcs6/base-hcs6-tools.d.ts +28 -0
- package/dist/cjs/tools/hcs6/hcs6-tool-params.d.ts +18 -0
- package/dist/cjs/tools/hcs6/index.d.ts +6 -0
- package/dist/cjs/tools/index.d.ts +1 -0
- package/dist/cjs/tools/inscriber/InscribeFromBufferTool.d.ts +4 -4
- package/dist/es/builders/hcs6/hcs6-builder.d.ts +47 -0
- package/dist/es/builders/hcs6/index.d.ts +1 -0
- package/dist/es/builders/index.d.ts +1 -0
- package/dist/es/index.d.ts +1 -1
- package/dist/es/standards-agent-kit.es.js +44 -31
- package/dist/es/standards-agent-kit.es.js.map +1 -1
- package/dist/es/standards-agent-kit.es10.js +27 -27
- package/dist/es/standards-agent-kit.es10.js.map +1 -1
- package/dist/es/standards-agent-kit.es11.js +20 -30
- package/dist/es/standards-agent-kit.es11.js.map +1 -1
- package/dist/es/standards-agent-kit.es12.js +27 -37
- package/dist/es/standards-agent-kit.es12.js.map +1 -1
- package/dist/es/standards-agent-kit.es13.js +48 -60
- package/dist/es/standards-agent-kit.es13.js.map +1 -1
- package/dist/es/standards-agent-kit.es14.js +60 -23
- package/dist/es/standards-agent-kit.es14.js.map +1 -1
- package/dist/es/standards-agent-kit.es15.js +23 -23
- package/dist/es/standards-agent-kit.es15.js.map +1 -1
- package/dist/es/standards-agent-kit.es16.js +23 -33
- package/dist/es/standards-agent-kit.es16.js.map +1 -1
- package/dist/es/standards-agent-kit.es17.js +34 -10
- package/dist/es/standards-agent-kit.es17.js.map +1 -1
- package/dist/es/standards-agent-kit.es18.js +16 -155
- package/dist/es/standards-agent-kit.es18.js.map +1 -1
- package/dist/es/standards-agent-kit.es19.js +150 -22
- package/dist/es/standards-agent-kit.es19.js.map +1 -1
- package/dist/es/standards-agent-kit.es20.js +25 -39
- package/dist/es/standards-agent-kit.es20.js.map +1 -1
- package/dist/es/standards-agent-kit.es21.js +26 -28
- package/dist/es/standards-agent-kit.es21.js.map +1 -1
- package/dist/es/standards-agent-kit.es22.js +16 -19
- package/dist/es/standards-agent-kit.es22.js.map +1 -1
- package/dist/es/standards-agent-kit.es23.js +21 -15
- package/dist/es/standards-agent-kit.es23.js.map +1 -1
- package/dist/es/standards-agent-kit.es24.js +18 -21
- package/dist/es/standards-agent-kit.es24.js.map +1 -1
- package/dist/es/standards-agent-kit.es25.js +35 -32
- package/dist/es/standards-agent-kit.es25.js.map +1 -1
- package/dist/es/standards-agent-kit.es26.js +38 -25
- package/dist/es/standards-agent-kit.es26.js.map +1 -1
- package/dist/es/standards-agent-kit.es27.js +25 -116
- package/dist/es/standards-agent-kit.es27.js.map +1 -1
- package/dist/es/standards-agent-kit.es28.js +33 -166
- package/dist/es/standards-agent-kit.es28.js.map +1 -1
- package/dist/es/standards-agent-kit.es29.js +42 -121
- package/dist/es/standards-agent-kit.es29.js.map +1 -1
- package/dist/es/standards-agent-kit.es30.js +40 -77
- package/dist/es/standards-agent-kit.es30.js.map +1 -1
- package/dist/es/standards-agent-kit.es31.js +42 -37
- package/dist/es/standards-agent-kit.es31.js.map +1 -1
- package/dist/es/standards-agent-kit.es32.js +20 -237
- package/dist/es/standards-agent-kit.es32.js.map +1 -1
- package/dist/es/standards-agent-kit.es33.js +154 -135
- package/dist/es/standards-agent-kit.es33.js.map +1 -1
- package/dist/es/standards-agent-kit.es34.js +168 -23
- package/dist/es/standards-agent-kit.es34.js.map +1 -1
- package/dist/es/standards-agent-kit.es35.js +126 -21
- package/dist/es/standards-agent-kit.es35.js.map +1 -1
- package/dist/es/standards-agent-kit.es36.js +86 -3
- package/dist/es/standards-agent-kit.es36.js.map +1 -1
- package/dist/es/standards-agent-kit.es37.js +45 -0
- package/dist/es/standards-agent-kit.es37.js.map +1 -0
- package/dist/es/standards-agent-kit.es38.js +249 -0
- package/dist/es/standards-agent-kit.es38.js.map +1 -0
- package/dist/es/standards-agent-kit.es39.js +141 -0
- package/dist/es/standards-agent-kit.es39.js.map +1 -0
- package/dist/es/standards-agent-kit.es4.js +65 -32
- package/dist/es/standards-agent-kit.es4.js.map +1 -1
- package/dist/es/standards-agent-kit.es40.js +33 -0
- package/dist/es/standards-agent-kit.es40.js.map +1 -0
- package/dist/es/standards-agent-kit.es41.js +28 -0
- package/dist/es/standards-agent-kit.es41.js.map +1 -0
- package/dist/es/standards-agent-kit.es42.js +7 -0
- package/dist/es/standards-agent-kit.es42.js.map +1 -0
- package/dist/es/standards-agent-kit.es5.js +35 -311
- package/dist/es/standards-agent-kit.es5.js.map +1 -1
- package/dist/es/standards-agent-kit.es6.js +320 -20
- package/dist/es/standards-agent-kit.es6.js.map +1 -1
- package/dist/es/standards-agent-kit.es7.js +19 -227
- package/dist/es/standards-agent-kit.es7.js.map +1 -1
- package/dist/es/standards-agent-kit.es8.js +216 -65
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/es/standards-agent-kit.es9.js +72 -23
- package/dist/es/standards-agent-kit.es9.js.map +1 -1
- package/dist/es/tools/hcs6/CreateDynamicRegistryTool.d.ts +44 -0
- package/dist/es/tools/hcs6/QueryDynamicRegistryTool.d.ts +50 -0
- package/dist/es/tools/hcs6/RegisterDynamicHashinalTool.d.ts +102 -0
- package/dist/es/tools/hcs6/UpdateDynamicHashinalTool.d.ts +96 -0
- package/dist/es/tools/hcs6/base-hcs6-tools.d.ts +28 -0
- package/dist/es/tools/hcs6/hcs6-tool-params.d.ts +18 -0
- package/dist/es/tools/hcs6/index.d.ts +6 -0
- package/dist/es/tools/index.d.ts +1 -0
- package/dist/es/tools/inscriber/InscribeFromBufferTool.d.ts +4 -4
- package/dist/umd/builders/hcs6/hcs6-builder.d.ts +47 -0
- package/dist/umd/builders/hcs6/index.d.ts +1 -0
- package/dist/umd/builders/index.d.ts +1 -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/hcs6/CreateDynamicRegistryTool.d.ts +44 -0
- package/dist/umd/tools/hcs6/QueryDynamicRegistryTool.d.ts +50 -0
- package/dist/umd/tools/hcs6/RegisterDynamicHashinalTool.d.ts +102 -0
- package/dist/umd/tools/hcs6/UpdateDynamicHashinalTool.d.ts +96 -0
- package/dist/umd/tools/hcs6/base-hcs6-tools.d.ts +28 -0
- package/dist/umd/tools/hcs6/hcs6-tool-params.d.ts +18 -0
- package/dist/umd/tools/hcs6/index.d.ts +6 -0
- package/dist/umd/tools/index.d.ts +1 -0
- package/dist/umd/tools/inscriber/InscribeFromBufferTool.d.ts +4 -4
- package/package.json +2 -2
- package/src/builders/hcs6/hcs6-builder.ts +136 -0
- package/src/builders/hcs6/index.ts +1 -0
- package/src/builders/index.ts +1 -0
- package/src/index.ts +1 -1
- package/src/tools/hcs6/CreateDynamicRegistryTool.ts +66 -0
- package/src/tools/hcs6/QueryDynamicRegistryTool.ts +72 -0
- package/src/tools/hcs6/RegisterDynamicHashinalTool.ts +79 -0
- package/src/tools/hcs6/UpdateDynamicHashinalTool.ts +74 -0
- package/src/tools/hcs6/base-hcs6-tools.ts +63 -0
- package/src/tools/hcs6/hcs6-tool-params.ts +21 -0
- package/src/tools/hcs6/index.ts +6 -0
- package/src/tools/index.ts +1 -0
- package/src/tools/inscriber/InscribeFromBufferTool.ts +1 -1
- package/src/tools/inscriber/InscribeFromUrlTool.ts +60 -7
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseHCS6TransactionTool } from './base-hcs6-tools';
|
|
3
|
+
import { HCS6TransactionToolParams } from './hcs6-tool-params';
|
|
4
|
+
import { TransactionResponse } from 'hedera-agent-kit';
|
|
5
|
+
/**
|
|
6
|
+
* Schema for creating a dynamic hashinal registry
|
|
7
|
+
*/
|
|
8
|
+
declare const CreateDynamicRegistrySchema: z.ZodObject<{
|
|
9
|
+
ttl: z.ZodDefault<z.ZodNumber>;
|
|
10
|
+
adminKey: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
11
|
+
submitKey: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
12
|
+
}, "strip", z.ZodTypeAny, {
|
|
13
|
+
ttl: number;
|
|
14
|
+
adminKey?: string | boolean | undefined;
|
|
15
|
+
submitKey?: string | boolean | undefined;
|
|
16
|
+
}, {
|
|
17
|
+
ttl?: number | undefined;
|
|
18
|
+
adminKey?: string | boolean | undefined;
|
|
19
|
+
submitKey?: string | boolean | undefined;
|
|
20
|
+
}>;
|
|
21
|
+
export type CreateDynamicRegistryInput = z.infer<typeof CreateDynamicRegistrySchema>;
|
|
22
|
+
/**
|
|
23
|
+
* Tool for creating HCS-6 dynamic registries
|
|
24
|
+
*/
|
|
25
|
+
export declare class CreateDynamicRegistryTool extends BaseHCS6TransactionTool<typeof CreateDynamicRegistrySchema> {
|
|
26
|
+
name: string;
|
|
27
|
+
description: string;
|
|
28
|
+
schema: z.ZodObject<{
|
|
29
|
+
ttl: z.ZodDefault<z.ZodNumber>;
|
|
30
|
+
adminKey: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
31
|
+
submitKey: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodString]>>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
ttl: number;
|
|
34
|
+
adminKey?: string | boolean | undefined;
|
|
35
|
+
submitKey?: string | boolean | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
ttl?: number | undefined;
|
|
38
|
+
adminKey?: string | boolean | undefined;
|
|
39
|
+
submitKey?: string | boolean | undefined;
|
|
40
|
+
}>;
|
|
41
|
+
constructor(params: HCS6TransactionToolParams);
|
|
42
|
+
protected _call(params: CreateDynamicRegistryInput): Promise<TransactionResponse>;
|
|
43
|
+
}
|
|
44
|
+
export {};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseHCS6QueryTool } from './base-hcs6-tools';
|
|
3
|
+
import { HCS6QueryToolParams } from './hcs6-tool-params';
|
|
4
|
+
import { TransactionResponse } from 'hedera-agent-kit';
|
|
5
|
+
/**
|
|
6
|
+
* Schema for querying a dynamic registry
|
|
7
|
+
*/
|
|
8
|
+
declare const QueryDynamicRegistrySchema: z.ZodObject<{
|
|
9
|
+
topicId: z.ZodString;
|
|
10
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
order: z.ZodDefault<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
|
|
12
|
+
skip: z.ZodOptional<z.ZodNumber>;
|
|
13
|
+
}, "strip", z.ZodTypeAny, {
|
|
14
|
+
topicId: string;
|
|
15
|
+
limit: number;
|
|
16
|
+
order: "asc" | "desc";
|
|
17
|
+
skip?: number | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
topicId: string;
|
|
20
|
+
limit?: number | undefined;
|
|
21
|
+
order?: "asc" | "desc" | undefined;
|
|
22
|
+
skip?: number | undefined;
|
|
23
|
+
}>;
|
|
24
|
+
export type QueryDynamicRegistryInput = z.infer<typeof QueryDynamicRegistrySchema>;
|
|
25
|
+
/**
|
|
26
|
+
* Tool for querying HCS-6 dynamic registries
|
|
27
|
+
*/
|
|
28
|
+
export declare class QueryDynamicRegistryTool extends BaseHCS6QueryTool<typeof QueryDynamicRegistrySchema> {
|
|
29
|
+
name: string;
|
|
30
|
+
description: string;
|
|
31
|
+
schema: z.ZodObject<{
|
|
32
|
+
topicId: z.ZodString;
|
|
33
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
34
|
+
order: z.ZodDefault<z.ZodOptional<z.ZodEnum<["asc", "desc"]>>>;
|
|
35
|
+
skip: z.ZodOptional<z.ZodNumber>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
topicId: string;
|
|
38
|
+
limit: number;
|
|
39
|
+
order: "asc" | "desc";
|
|
40
|
+
skip?: number | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
topicId: string;
|
|
43
|
+
limit?: number | undefined;
|
|
44
|
+
order?: "asc" | "desc" | undefined;
|
|
45
|
+
skip?: number | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
constructor(params: HCS6QueryToolParams);
|
|
48
|
+
protected _call(params: QueryDynamicRegistryInput): Promise<TransactionResponse>;
|
|
49
|
+
}
|
|
50
|
+
export {};
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseHCS6TransactionTool } from './base-hcs6-tools';
|
|
3
|
+
import { HCS6TransactionToolParams } from './hcs6-tool-params';
|
|
4
|
+
import { TransactionResponse } from 'hedera-agent-kit';
|
|
5
|
+
/**
|
|
6
|
+
* Schema for registering a dynamic hashinal
|
|
7
|
+
*/
|
|
8
|
+
declare const RegisterDynamicHashinalSchema: z.ZodObject<{
|
|
9
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
10
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
11
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
12
|
+
url: z.ZodOptional<z.ZodString>;
|
|
13
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
14
|
+
}, "strip", z.ZodTypeAny, {
|
|
15
|
+
base64?: string | undefined;
|
|
16
|
+
url?: string | undefined;
|
|
17
|
+
mimeType?: string | undefined;
|
|
18
|
+
}, {
|
|
19
|
+
base64?: string | undefined;
|
|
20
|
+
url?: string | undefined;
|
|
21
|
+
mimeType?: string | undefined;
|
|
22
|
+
}>>;
|
|
23
|
+
memo: z.ZodOptional<z.ZodString>;
|
|
24
|
+
ttl: z.ZodDefault<z.ZodNumber>;
|
|
25
|
+
registryTopicId: z.ZodOptional<z.ZodString>;
|
|
26
|
+
submitKey: z.ZodOptional<z.ZodString>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
metadata: Record<string, unknown>;
|
|
29
|
+
ttl: number;
|
|
30
|
+
data?: {
|
|
31
|
+
base64?: string | undefined;
|
|
32
|
+
url?: string | undefined;
|
|
33
|
+
mimeType?: string | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
memo?: string | undefined;
|
|
36
|
+
submitKey?: string | undefined;
|
|
37
|
+
registryTopicId?: string | undefined;
|
|
38
|
+
}, {
|
|
39
|
+
metadata: Record<string, unknown>;
|
|
40
|
+
data?: {
|
|
41
|
+
base64?: string | undefined;
|
|
42
|
+
url?: string | undefined;
|
|
43
|
+
mimeType?: string | undefined;
|
|
44
|
+
} | undefined;
|
|
45
|
+
memo?: string | undefined;
|
|
46
|
+
ttl?: number | undefined;
|
|
47
|
+
submitKey?: string | undefined;
|
|
48
|
+
registryTopicId?: string | undefined;
|
|
49
|
+
}>;
|
|
50
|
+
export type RegisterDynamicHashinalInput = z.infer<typeof RegisterDynamicHashinalSchema>;
|
|
51
|
+
/**
|
|
52
|
+
* Tool for registering (creating) dynamic hashinals
|
|
53
|
+
*/
|
|
54
|
+
export declare class RegisterDynamicHashinalTool extends BaseHCS6TransactionTool<typeof RegisterDynamicHashinalSchema> {
|
|
55
|
+
name: string;
|
|
56
|
+
description: string;
|
|
57
|
+
schema: z.ZodObject<{
|
|
58
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
59
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
60
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
61
|
+
url: z.ZodOptional<z.ZodString>;
|
|
62
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
63
|
+
}, "strip", z.ZodTypeAny, {
|
|
64
|
+
base64?: string | undefined;
|
|
65
|
+
url?: string | undefined;
|
|
66
|
+
mimeType?: string | undefined;
|
|
67
|
+
}, {
|
|
68
|
+
base64?: string | undefined;
|
|
69
|
+
url?: string | undefined;
|
|
70
|
+
mimeType?: string | undefined;
|
|
71
|
+
}>>;
|
|
72
|
+
memo: z.ZodOptional<z.ZodString>;
|
|
73
|
+
ttl: z.ZodDefault<z.ZodNumber>;
|
|
74
|
+
registryTopicId: z.ZodOptional<z.ZodString>;
|
|
75
|
+
submitKey: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, "strip", z.ZodTypeAny, {
|
|
77
|
+
metadata: Record<string, unknown>;
|
|
78
|
+
ttl: number;
|
|
79
|
+
data?: {
|
|
80
|
+
base64?: string | undefined;
|
|
81
|
+
url?: string | undefined;
|
|
82
|
+
mimeType?: string | undefined;
|
|
83
|
+
} | undefined;
|
|
84
|
+
memo?: string | undefined;
|
|
85
|
+
submitKey?: string | undefined;
|
|
86
|
+
registryTopicId?: string | undefined;
|
|
87
|
+
}, {
|
|
88
|
+
metadata: Record<string, unknown>;
|
|
89
|
+
data?: {
|
|
90
|
+
base64?: string | undefined;
|
|
91
|
+
url?: string | undefined;
|
|
92
|
+
mimeType?: string | undefined;
|
|
93
|
+
} | undefined;
|
|
94
|
+
memo?: string | undefined;
|
|
95
|
+
ttl?: number | undefined;
|
|
96
|
+
submitKey?: string | undefined;
|
|
97
|
+
registryTopicId?: string | undefined;
|
|
98
|
+
}>;
|
|
99
|
+
constructor(params: HCS6TransactionToolParams);
|
|
100
|
+
protected _call(params: RegisterDynamicHashinalInput): Promise<TransactionResponse>;
|
|
101
|
+
}
|
|
102
|
+
export {};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseHCS6TransactionTool } from './base-hcs6-tools';
|
|
3
|
+
import { HCS6TransactionToolParams } from './hcs6-tool-params';
|
|
4
|
+
import { TransactionResponse } from 'hedera-agent-kit';
|
|
5
|
+
/**
|
|
6
|
+
* Schema for updating a dynamic hashinal
|
|
7
|
+
*/
|
|
8
|
+
declare const UpdateDynamicHashinalSchema: z.ZodObject<{
|
|
9
|
+
registryTopicId: z.ZodString;
|
|
10
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
11
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
12
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
13
|
+
url: z.ZodOptional<z.ZodString>;
|
|
14
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
base64?: string | undefined;
|
|
17
|
+
url?: string | undefined;
|
|
18
|
+
mimeType?: string | undefined;
|
|
19
|
+
}, {
|
|
20
|
+
base64?: string | undefined;
|
|
21
|
+
url?: string | undefined;
|
|
22
|
+
mimeType?: string | undefined;
|
|
23
|
+
}>>;
|
|
24
|
+
memo: z.ZodOptional<z.ZodString>;
|
|
25
|
+
submitKey: z.ZodString;
|
|
26
|
+
}, "strip", z.ZodTypeAny, {
|
|
27
|
+
metadata: Record<string, unknown>;
|
|
28
|
+
submitKey: string;
|
|
29
|
+
registryTopicId: string;
|
|
30
|
+
data?: {
|
|
31
|
+
base64?: string | undefined;
|
|
32
|
+
url?: string | undefined;
|
|
33
|
+
mimeType?: string | undefined;
|
|
34
|
+
} | undefined;
|
|
35
|
+
memo?: string | undefined;
|
|
36
|
+
}, {
|
|
37
|
+
metadata: Record<string, unknown>;
|
|
38
|
+
submitKey: string;
|
|
39
|
+
registryTopicId: string;
|
|
40
|
+
data?: {
|
|
41
|
+
base64?: string | undefined;
|
|
42
|
+
url?: string | undefined;
|
|
43
|
+
mimeType?: string | undefined;
|
|
44
|
+
} | undefined;
|
|
45
|
+
memo?: string | undefined;
|
|
46
|
+
}>;
|
|
47
|
+
export type UpdateDynamicHashinalInput = z.infer<typeof UpdateDynamicHashinalSchema>;
|
|
48
|
+
/**
|
|
49
|
+
* Tool for updating dynamic hashinals
|
|
50
|
+
*/
|
|
51
|
+
export declare class UpdateDynamicHashinalTool extends BaseHCS6TransactionTool<typeof UpdateDynamicHashinalSchema> {
|
|
52
|
+
name: string;
|
|
53
|
+
description: string;
|
|
54
|
+
schema: z.ZodObject<{
|
|
55
|
+
registryTopicId: z.ZodString;
|
|
56
|
+
metadata: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
57
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
58
|
+
base64: z.ZodOptional<z.ZodString>;
|
|
59
|
+
url: z.ZodOptional<z.ZodString>;
|
|
60
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
61
|
+
}, "strip", z.ZodTypeAny, {
|
|
62
|
+
base64?: string | undefined;
|
|
63
|
+
url?: string | undefined;
|
|
64
|
+
mimeType?: string | undefined;
|
|
65
|
+
}, {
|
|
66
|
+
base64?: string | undefined;
|
|
67
|
+
url?: string | undefined;
|
|
68
|
+
mimeType?: string | undefined;
|
|
69
|
+
}>>;
|
|
70
|
+
memo: z.ZodOptional<z.ZodString>;
|
|
71
|
+
submitKey: z.ZodString;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
metadata: Record<string, unknown>;
|
|
74
|
+
submitKey: string;
|
|
75
|
+
registryTopicId: string;
|
|
76
|
+
data?: {
|
|
77
|
+
base64?: string | undefined;
|
|
78
|
+
url?: string | undefined;
|
|
79
|
+
mimeType?: string | undefined;
|
|
80
|
+
} | undefined;
|
|
81
|
+
memo?: string | undefined;
|
|
82
|
+
}, {
|
|
83
|
+
metadata: Record<string, unknown>;
|
|
84
|
+
submitKey: string;
|
|
85
|
+
registryTopicId: string;
|
|
86
|
+
data?: {
|
|
87
|
+
base64?: string | undefined;
|
|
88
|
+
url?: string | undefined;
|
|
89
|
+
mimeType?: string | undefined;
|
|
90
|
+
} | undefined;
|
|
91
|
+
memo?: string | undefined;
|
|
92
|
+
}>;
|
|
93
|
+
constructor(params: HCS6TransactionToolParams);
|
|
94
|
+
protected _call(params: UpdateDynamicHashinalInput): Promise<TransactionResponse>;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseHederaTransactionTool, BaseHederaQueryTool, BaseServiceBuilder } from 'hedera-agent-kit';
|
|
2
|
+
import { HCS6Builder } from '../../builders/hcs6/hcs6-builder';
|
|
3
|
+
import { HCS6TransactionToolParams, HCS6QueryToolParams } from './hcs6-tool-params';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
/**
|
|
6
|
+
* Base class for HCS6 transaction tools
|
|
7
|
+
*/
|
|
8
|
+
export declare abstract class BaseHCS6TransactionTool<T extends z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny> = z.ZodObject<z.ZodRawShape>> extends BaseHederaTransactionTool<T> {
|
|
9
|
+
protected hcs6Builder: HCS6Builder;
|
|
10
|
+
namespace: "hcs6";
|
|
11
|
+
constructor(params: HCS6TransactionToolParams);
|
|
12
|
+
/**
|
|
13
|
+
* Override to return the HCS6Builder
|
|
14
|
+
*/
|
|
15
|
+
protected getServiceBuilder(): BaseServiceBuilder;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Base class for HCS6 query tools
|
|
19
|
+
*/
|
|
20
|
+
export declare abstract class BaseHCS6QueryTool<T extends z.ZodObject<z.ZodRawShape, z.UnknownKeysParam, z.ZodTypeAny> = z.ZodObject<z.ZodRawShape>> extends BaseHederaQueryTool<T> {
|
|
21
|
+
protected hcs6Builder: HCS6Builder;
|
|
22
|
+
namespace: "hcs6";
|
|
23
|
+
constructor(params: HCS6QueryToolParams);
|
|
24
|
+
/**
|
|
25
|
+
* Override to return the HCS6Builder
|
|
26
|
+
*/
|
|
27
|
+
protected getServiceBuilder(): BaseServiceBuilder;
|
|
28
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HederaAgentKit, BasePluginContext } from 'hedera-agent-kit';
|
|
2
|
+
import { HCS6Builder } from '../../builders/hcs6/hcs6-builder';
|
|
3
|
+
/**
|
|
4
|
+
* Parameters for HCS6 transaction tools
|
|
5
|
+
*/
|
|
6
|
+
export interface HCS6TransactionToolParams {
|
|
7
|
+
hederaKit: HederaAgentKit;
|
|
8
|
+
hcs6Builder: HCS6Builder;
|
|
9
|
+
logger?: BasePluginContext['logger'];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Parameters for HCS6 query tools
|
|
13
|
+
*/
|
|
14
|
+
export interface HCS6QueryToolParams {
|
|
15
|
+
hederaKit: HederaAgentKit;
|
|
16
|
+
hcs6Builder: HCS6Builder;
|
|
17
|
+
logger?: BasePluginContext['logger'];
|
|
18
|
+
}
|
|
@@ -20,23 +20,23 @@ declare const inscribeFromBufferSchema: z.ZodObject<{
|
|
|
20
20
|
base64Data: string;
|
|
21
21
|
tags?: string[] | undefined;
|
|
22
22
|
metadata?: Record<string, unknown> | undefined;
|
|
23
|
+
mimeType?: string | undefined;
|
|
23
24
|
mode?: "file" | "hashinal" | undefined;
|
|
24
25
|
chunkSize?: number | undefined;
|
|
25
26
|
waitForConfirmation?: boolean | undefined;
|
|
26
27
|
apiKey?: string | undefined;
|
|
27
28
|
timeoutMs?: number | undefined;
|
|
28
|
-
mimeType?: string | undefined;
|
|
29
29
|
}, {
|
|
30
30
|
fileName: string;
|
|
31
31
|
base64Data: string;
|
|
32
32
|
tags?: string[] | undefined;
|
|
33
33
|
metadata?: Record<string, unknown> | undefined;
|
|
34
|
+
mimeType?: string | undefined;
|
|
34
35
|
mode?: "file" | "hashinal" | undefined;
|
|
35
36
|
chunkSize?: number | undefined;
|
|
36
37
|
waitForConfirmation?: boolean | undefined;
|
|
37
38
|
apiKey?: string | undefined;
|
|
38
39
|
timeoutMs?: number | undefined;
|
|
39
|
-
mimeType?: string | undefined;
|
|
40
40
|
}>;
|
|
41
41
|
/**
|
|
42
42
|
* Tool for inscribing content from buffer
|
|
@@ -60,23 +60,23 @@ export declare class InscribeFromBufferTool extends BaseInscriberQueryTool<typeo
|
|
|
60
60
|
base64Data: string;
|
|
61
61
|
tags?: string[] | undefined;
|
|
62
62
|
metadata?: Record<string, unknown> | undefined;
|
|
63
|
+
mimeType?: string | undefined;
|
|
63
64
|
mode?: "file" | "hashinal" | undefined;
|
|
64
65
|
chunkSize?: number | undefined;
|
|
65
66
|
waitForConfirmation?: boolean | undefined;
|
|
66
67
|
apiKey?: string | undefined;
|
|
67
68
|
timeoutMs?: number | undefined;
|
|
68
|
-
mimeType?: string | undefined;
|
|
69
69
|
}, {
|
|
70
70
|
fileName: string;
|
|
71
71
|
base64Data: string;
|
|
72
72
|
tags?: string[] | undefined;
|
|
73
73
|
metadata?: Record<string, unknown> | undefined;
|
|
74
|
+
mimeType?: string | undefined;
|
|
74
75
|
mode?: "file" | "hashinal" | undefined;
|
|
75
76
|
chunkSize?: number | undefined;
|
|
76
77
|
waitForConfirmation?: boolean | undefined;
|
|
77
78
|
apiKey?: string | undefined;
|
|
78
79
|
timeoutMs?: number | undefined;
|
|
79
|
-
mimeType?: string | undefined;
|
|
80
80
|
}>;
|
|
81
81
|
protected executeQuery(params: z.infer<typeof inscribeFromBufferSchema>, _runManager?: CallbackManagerForToolRun): Promise<unknown>;
|
|
82
82
|
}
|
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.113",
|
|
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",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
},
|
|
90
90
|
"dependencies": {
|
|
91
91
|
"@hashgraph/sdk": "^2.69.0",
|
|
92
|
-
"@hashgraphonline/standards-sdk": "0.0.
|
|
92
|
+
"@hashgraphonline/standards-sdk": "0.0.167",
|
|
93
93
|
"@langchain/community": "^0.3.49",
|
|
94
94
|
"@langchain/core": "^0.3.66",
|
|
95
95
|
"@langchain/openai": "^0.6.3",
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { BaseServiceBuilder } from 'hedera-agent-kit';
|
|
2
|
+
import type { HederaAgentKit } from 'hedera-agent-kit';
|
|
3
|
+
import {
|
|
4
|
+
HCS6Client,
|
|
5
|
+
SDKHCS6ClientConfig,
|
|
6
|
+
HCS6CreateRegistryOptions,
|
|
7
|
+
HCS6RegisterEntryOptions,
|
|
8
|
+
HCS6QueryRegistryOptions,
|
|
9
|
+
HCS6RegisterOptions,
|
|
10
|
+
HCS6CreateHashinalOptions,
|
|
11
|
+
HCS6TopicRegistrationResponse,
|
|
12
|
+
HCS6RegistryOperationResponse,
|
|
13
|
+
HCS6TopicRegistry,
|
|
14
|
+
HCS6CreateHashinalResponse,
|
|
15
|
+
NetworkType,
|
|
16
|
+
} from '@hashgraphonline/standards-sdk';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Builder for HCS-6 operations that delegates to HCS6Client
|
|
20
|
+
*/
|
|
21
|
+
export class HCS6Builder extends BaseServiceBuilder {
|
|
22
|
+
protected hcs6Client?: HCS6Client;
|
|
23
|
+
|
|
24
|
+
constructor(hederaKit: HederaAgentKit) {
|
|
25
|
+
super(hederaKit);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Get or create HCS-6 client
|
|
30
|
+
*/
|
|
31
|
+
protected async getHCS6Client(): Promise<HCS6Client> {
|
|
32
|
+
if (!this.hcs6Client) {
|
|
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: SDKHCS6ClientConfig = {
|
|
44
|
+
network: networkType,
|
|
45
|
+
operatorId: operatorId,
|
|
46
|
+
operatorKey: operatorPrivateKey,
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
this.hcs6Client = new HCS6Client(config);
|
|
50
|
+
}
|
|
51
|
+
return this.hcs6Client;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Create a new HCS-6 dynamic registry
|
|
56
|
+
* Note: This executes the transaction directly via HCS6Client
|
|
57
|
+
*/
|
|
58
|
+
async createRegistry(
|
|
59
|
+
options: HCS6CreateRegistryOptions = {}
|
|
60
|
+
): Promise<HCS6TopicRegistrationResponse> {
|
|
61
|
+
const client = await this.getHCS6Client();
|
|
62
|
+
return await client.createRegistry(options);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Register a new dynamic hashinal entry in an HCS-6 registry
|
|
67
|
+
*/
|
|
68
|
+
async registerEntry(
|
|
69
|
+
registryTopicId: string,
|
|
70
|
+
options: HCS6RegisterEntryOptions
|
|
71
|
+
): Promise<HCS6RegistryOperationResponse> {
|
|
72
|
+
const client = await this.getHCS6Client();
|
|
73
|
+
return await client.registerEntry(registryTopicId, options);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Query entries from an HCS-6 registry
|
|
78
|
+
*/
|
|
79
|
+
async getRegistry(
|
|
80
|
+
topicId: string,
|
|
81
|
+
options: HCS6QueryRegistryOptions = {}
|
|
82
|
+
): Promise<HCS6TopicRegistry> {
|
|
83
|
+
const client = await this.getHCS6Client();
|
|
84
|
+
return await client.getRegistry(topicId, options);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* Create a complete dynamic hashinal with inscription and registry
|
|
89
|
+
*/
|
|
90
|
+
async createHashinal(
|
|
91
|
+
options: HCS6CreateHashinalOptions
|
|
92
|
+
): Promise<HCS6CreateHashinalResponse> {
|
|
93
|
+
const client = await this.getHCS6Client();
|
|
94
|
+
return await client.createHashinal(options);
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Register a dynamic hashinal with combined inscription and registry creation
|
|
99
|
+
* This is the main method for creating and updating dynamic hashinals
|
|
100
|
+
*/
|
|
101
|
+
async register(
|
|
102
|
+
options: HCS6RegisterOptions
|
|
103
|
+
): Promise<HCS6CreateHashinalResponse> {
|
|
104
|
+
const client = await this.getHCS6Client();
|
|
105
|
+
return await client.register(options);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* Submit a raw message to an HCS-6 topic
|
|
110
|
+
*/
|
|
111
|
+
async submitMessage(
|
|
112
|
+
topicId: string,
|
|
113
|
+
payload: any
|
|
114
|
+
): Promise<any> {
|
|
115
|
+
const client = await this.getHCS6Client();
|
|
116
|
+
return await client.submitMessage(topicId, payload);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Get topic info from mirror node
|
|
121
|
+
*/
|
|
122
|
+
async getTopicInfo(topicId: string): Promise<any> {
|
|
123
|
+
const client = await this.getHCS6Client();
|
|
124
|
+
return await client.getTopicInfo(topicId);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Close the HCS-6 client
|
|
129
|
+
*/
|
|
130
|
+
async close(): Promise<void> {
|
|
131
|
+
if (this.hcs6Client) {
|
|
132
|
+
this.hcs6Client.close();
|
|
133
|
+
this.hcs6Client = undefined;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './hcs6-builder';
|
package/src/builders/index.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -2,6 +2,6 @@ export * from './tools';
|
|
|
2
2
|
export * from './state';
|
|
3
3
|
export * from './init';
|
|
4
4
|
export * from './plugins';
|
|
5
|
-
export { HCS10Builder, HCS2Builder, InscriberBuilder } from './builders';
|
|
5
|
+
export { HCS10Builder, HCS2Builder, HCS6Builder, InscriberBuilder } from './builders';
|
|
6
6
|
export type { ExecuteResult } from './builders';
|
|
7
7
|
export { HCS10Client } from './hcs10';
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { BaseHCS6TransactionTool } from './base-hcs6-tools';
|
|
3
|
+
import { HCS6TransactionToolParams } from './hcs6-tool-params';
|
|
4
|
+
import type { TransactionResponse } from 'hedera-agent-kit';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Schema for creating a dynamic hashinal registry
|
|
8
|
+
*/
|
|
9
|
+
const CreateDynamicRegistrySchema = z.object({
|
|
10
|
+
ttl: z.number()
|
|
11
|
+
.min(3600)
|
|
12
|
+
.default(86400)
|
|
13
|
+
.describe('Time-to-live in seconds (minimum 3600 seconds/1 hour)'),
|
|
14
|
+
adminKey: z.union([z.boolean(), z.string()])
|
|
15
|
+
.optional()
|
|
16
|
+
.describe('Admin key for the registry topic. Can be boolean (use operator key) or a public key string'),
|
|
17
|
+
submitKey: z.union([z.boolean(), z.string()])
|
|
18
|
+
.optional()
|
|
19
|
+
.describe('Submit key for the registry topic. Can be boolean (use operator key) or a public key string'),
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export type CreateDynamicRegistryInput = z.infer<typeof CreateDynamicRegistrySchema>;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Tool for creating HCS-6 dynamic registries
|
|
26
|
+
*/
|
|
27
|
+
export class CreateDynamicRegistryTool extends BaseHCS6TransactionTool<typeof CreateDynamicRegistrySchema> {
|
|
28
|
+
name = 'createDynamicRegistry';
|
|
29
|
+
description = 'Create a new HCS-6 dynamic registry for managing evolving content';
|
|
30
|
+
schema = CreateDynamicRegistrySchema;
|
|
31
|
+
|
|
32
|
+
constructor(params: HCS6TransactionToolParams) {
|
|
33
|
+
super(params);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
protected async _call(
|
|
37
|
+
params: CreateDynamicRegistryInput
|
|
38
|
+
): Promise<TransactionResponse> {
|
|
39
|
+
try {
|
|
40
|
+
const result = await this.hcs6Builder.createRegistry({
|
|
41
|
+
ttl: params.ttl,
|
|
42
|
+
adminKey: params.adminKey,
|
|
43
|
+
submitKey: params.submitKey,
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
if (!result.success) {
|
|
47
|
+
throw new Error(result.error || 'Failed to create dynamic registry');
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
return {
|
|
51
|
+
status: 'success',
|
|
52
|
+
data: {
|
|
53
|
+
topicId: result.topicId,
|
|
54
|
+
transactionId: result.transactionId,
|
|
55
|
+
ttl: params.ttl,
|
|
56
|
+
memo: `hcs-6:1:${params.ttl}`,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
} catch (error) {
|
|
60
|
+
return {
|
|
61
|
+
status: 'error',
|
|
62
|
+
message: error instanceof Error ? error.message : 'Unknown error',
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|