@hashgraphonline/standards-agent-kit 0.2.136 → 0.2.138
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/README.md +3 -4
- package/dist/cjs/builders/hcs10/hcs10-builder.d.ts +1 -0
- package/dist/cjs/builders/hcs2/hcs2-builder.d.ts +8 -7
- package/dist/cjs/builders/hcs6/hcs6-builder.d.ts +5 -4
- package/dist/cjs/builders/inscriber/inscriber-builder.d.ts +32 -1
- package/dist/cjs/index.d.ts +4 -0
- package/dist/cjs/signing/bytes-registry.d.ts +17 -0
- package/dist/cjs/signing/signer-provider.d.ts +45 -0
- package/dist/cjs/standards-agent-kit.cjs +1 -1
- package/dist/cjs/standards-agent-kit.cjs.map +1 -1
- package/dist/cjs/tools/hcs10/InitiateConnectionTool.d.ts +4 -4
- package/dist/cjs/tools/hcs2/CreateRegistryTool.d.ts +2 -2
- package/dist/cjs/tools/hcs2/DeleteEntryTool.d.ts +2 -2
- package/dist/cjs/tools/hcs2/UpdateEntryTool.d.ts +2 -2
- package/dist/cjs/tools/hcs6/RegisterDynamicHashinalTool.d.ts +10 -10
- package/dist/cjs/tools/hcs6/UpdateDynamicHashinalTool.d.ts +8 -8
- package/dist/cjs/tools/inscriber/InscribeFromBufferTool.d.ts +5 -4
- package/dist/cjs/tools/inscriber/InscribeFromFileTool.d.ts +2 -2
- package/dist/cjs/tools/inscriber/InscribeFromUrlTool.d.ts +4 -4
- package/dist/cjs/tools/inscriber/InscribeHashinalTool.d.ts +3 -3
- package/dist/cjs/types/inscription-response.d.ts +8 -0
- package/dist/cjs/types/tx-results.d.ts +15 -0
- package/dist/cjs/utils/CodedError.d.ts +4 -0
- package/dist/cjs/utils/inscription-utils.d.ts +21 -0
- package/dist/cjs/validation/hip412-schemas.d.ts +2 -2
- package/dist/es/builders/hcs10/hcs10-builder.d.ts +1 -0
- package/dist/es/builders/hcs2/hcs2-builder.d.ts +8 -7
- package/dist/es/builders/hcs6/hcs6-builder.d.ts +5 -4
- package/dist/es/builders/inscriber/inscriber-builder.d.ts +32 -1
- package/dist/es/index.d.ts +4 -0
- package/dist/es/signing/bytes-registry.d.ts +17 -0
- package/dist/es/signing/signer-provider.d.ts +45 -0
- package/dist/es/standards-agent-kit.es.js +46 -42
- package/dist/es/standards-agent-kit.es.js.map +1 -1
- package/dist/es/standards-agent-kit.es10.js +24 -83
- package/dist/es/standards-agent-kit.es10.js.map +1 -1
- package/dist/es/standards-agent-kit.es11.js +224 -20
- package/dist/es/standards-agent-kit.es11.js.map +1 -1
- package/dist/es/standards-agent-kit.es12.js +78 -27
- package/dist/es/standards-agent-kit.es12.js.map +1 -1
- package/dist/es/standards-agent-kit.es13.js +26 -36
- package/dist/es/standards-agent-kit.es13.js.map +1 -1
- package/dist/es/standards-agent-kit.es14.js +17 -39
- package/dist/es/standards-agent-kit.es14.js.map +1 -1
- package/dist/es/standards-agent-kit.es15.js +36 -58
- package/dist/es/standards-agent-kit.es15.js.map +1 -1
- package/dist/es/standards-agent-kit.es16.js +45 -18
- package/dist/es/standards-agent-kit.es16.js.map +1 -1
- package/dist/es/standards-agent-kit.es17.js +53 -16
- package/dist/es/standards-agent-kit.es17.js.map +1 -1
- package/dist/es/standards-agent-kit.es18.js +18 -28
- package/dist/es/standards-agent-kit.es18.js.map +1 -1
- package/dist/es/standards-agent-kit.es19.js +26 -12
- package/dist/es/standards-agent-kit.es19.js.map +1 -1
- package/dist/es/standards-agent-kit.es20.js +38 -136
- package/dist/es/standards-agent-kit.es20.js.map +1 -1
- package/dist/es/standards-agent-kit.es21.js +13 -24
- package/dist/es/standards-agent-kit.es21.js.map +1 -1
- package/dist/es/standards-agent-kit.es22.js +136 -39
- package/dist/es/standards-agent-kit.es22.js.map +1 -1
- package/dist/es/standards-agent-kit.es23.js +25 -41
- package/dist/es/standards-agent-kit.es23.js.map +1 -1
- package/dist/es/standards-agent-kit.es24.js +49 -31
- package/dist/es/standards-agent-kit.es24.js.map +1 -1
- package/dist/es/standards-agent-kit.es25.js +34 -18
- package/dist/es/standards-agent-kit.es25.js.map +1 -1
- package/dist/es/standards-agent-kit.es26.js +35 -19
- package/dist/es/standards-agent-kit.es26.js.map +1 -1
- package/dist/es/standards-agent-kit.es27.js +45 -32
- package/dist/es/standards-agent-kit.es27.js.map +1 -1
- package/dist/es/standards-agent-kit.es28.js +54 -25
- package/dist/es/standards-agent-kit.es28.js.map +1 -1
- package/dist/es/standards-agent-kit.es29.js +35 -23
- package/dist/es/standards-agent-kit.es29.js.map +1 -1
- package/dist/es/standards-agent-kit.es3.js +41 -1545
- package/dist/es/standards-agent-kit.es3.js.map +1 -1
- package/dist/es/standards-agent-kit.es30.js +23 -39
- package/dist/es/standards-agent-kit.es30.js.map +1 -1
- package/dist/es/standards-agent-kit.es31.js +30 -28
- package/dist/es/standards-agent-kit.es31.js.map +1 -1
- package/dist/es/standards-agent-kit.es32.js +45 -32
- package/dist/es/standards-agent-kit.es32.js.map +1 -1
- package/dist/es/standards-agent-kit.es33.js +50 -89
- package/dist/es/standards-agent-kit.es33.js.map +1 -1
- package/dist/es/standards-agent-kit.es34.js +35 -228
- package/dist/es/standards-agent-kit.es34.js.map +1 -1
- package/dist/es/standards-agent-kit.es35.js +87 -212
- package/dist/es/standards-agent-kit.es35.js.map +1 -1
- package/dist/es/standards-agent-kit.es36.js +188 -128
- package/dist/es/standards-agent-kit.es36.js.map +1 -1
- package/dist/es/standards-agent-kit.es37.js +167 -561
- package/dist/es/standards-agent-kit.es37.js.map +1 -1
- package/dist/es/standards-agent-kit.es38.js +236 -31
- package/dist/es/standards-agent-kit.es38.js.map +1 -1
- package/dist/es/standards-agent-kit.es39.js +483 -206
- package/dist/es/standards-agent-kit.es39.js.map +1 -1
- package/dist/es/standards-agent-kit.es4.js +359 -81
- package/dist/es/standards-agent-kit.es4.js.map +1 -1
- package/dist/es/standards-agent-kit.es40.js +39 -135
- package/dist/es/standards-agent-kit.es40.js.map +1 -1
- package/dist/es/standards-agent-kit.es41.js +244 -28
- package/dist/es/standards-agent-kit.es41.js.map +1 -1
- package/dist/es/standards-agent-kit.es42.js +132 -418
- package/dist/es/standards-agent-kit.es42.js.map +1 -1
- package/dist/es/standards-agent-kit.es43.js +28 -184
- package/dist/es/standards-agent-kit.es43.js.map +1 -1
- package/dist/es/standards-agent-kit.es44.js +423 -3
- package/dist/es/standards-agent-kit.es44.js.map +1 -1
- package/dist/es/standards-agent-kit.es45.js +185 -24
- package/dist/es/standards-agent-kit.es45.js.map +1 -1
- package/dist/es/standards-agent-kit.es46.js +3 -3
- package/dist/es/standards-agent-kit.es46.js.map +1 -1
- package/dist/es/standards-agent-kit.es47.js +21 -50
- package/dist/es/standards-agent-kit.es47.js.map +1 -1
- package/dist/es/standards-agent-kit.es48.js +8 -3
- package/dist/es/standards-agent-kit.es48.js.map +1 -1
- package/dist/es/standards-agent-kit.es49.js +3 -39
- package/dist/es/standards-agent-kit.es49.js.map +1 -1
- package/dist/es/standards-agent-kit.es5.js +1747 -73
- package/dist/es/standards-agent-kit.es5.js.map +1 -1
- package/dist/es/standards-agent-kit.es50.js +18 -16
- package/dist/es/standards-agent-kit.es50.js.map +1 -1
- package/dist/es/standards-agent-kit.es51.js +49 -49
- package/dist/es/standards-agent-kit.es51.js.map +1 -1
- package/dist/es/standards-agent-kit.es52.js +6 -0
- package/dist/es/standards-agent-kit.es52.js.map +1 -0
- package/dist/es/standards-agent-kit.es53.js +43 -0
- package/dist/es/standards-agent-kit.es53.js.map +1 -0
- package/dist/es/standards-agent-kit.es54.js +22 -0
- package/dist/es/standards-agent-kit.es54.js.map +1 -0
- package/dist/es/standards-agent-kit.es55.js +77 -0
- package/dist/es/standards-agent-kit.es55.js.map +1 -0
- package/dist/es/standards-agent-kit.es56.js +7 -0
- package/dist/es/standards-agent-kit.es56.js.map +1 -0
- package/dist/es/standards-agent-kit.es6.js +347 -32
- package/dist/es/standards-agent-kit.es6.js.map +1 -1
- package/dist/es/standards-agent-kit.es7.js +142 -293
- package/dist/es/standards-agent-kit.es7.js.map +1 -1
- package/dist/es/standards-agent-kit.es8.js +201 -21
- package/dist/es/standards-agent-kit.es8.js.map +1 -1
- package/dist/es/standards-agent-kit.es9.js +301 -213
- package/dist/es/standards-agent-kit.es9.js.map +1 -1
- package/dist/es/tools/hcs10/InitiateConnectionTool.d.ts +4 -4
- package/dist/es/tools/hcs2/CreateRegistryTool.d.ts +2 -2
- package/dist/es/tools/hcs2/DeleteEntryTool.d.ts +2 -2
- package/dist/es/tools/hcs2/UpdateEntryTool.d.ts +2 -2
- package/dist/es/tools/hcs6/RegisterDynamicHashinalTool.d.ts +10 -10
- package/dist/es/tools/hcs6/UpdateDynamicHashinalTool.d.ts +8 -8
- package/dist/es/tools/inscriber/InscribeFromBufferTool.d.ts +5 -4
- package/dist/es/tools/inscriber/InscribeFromFileTool.d.ts +2 -2
- package/dist/es/tools/inscriber/InscribeFromUrlTool.d.ts +4 -4
- package/dist/es/tools/inscriber/InscribeHashinalTool.d.ts +3 -3
- package/dist/es/types/inscription-response.d.ts +8 -0
- package/dist/es/types/tx-results.d.ts +15 -0
- package/dist/es/utils/CodedError.d.ts +4 -0
- package/dist/es/utils/inscription-utils.d.ts +21 -0
- package/dist/es/validation/hip412-schemas.d.ts +2 -2
- package/dist/umd/builders/hcs10/hcs10-builder.d.ts +1 -0
- package/dist/umd/builders/hcs2/hcs2-builder.d.ts +8 -7
- package/dist/umd/builders/hcs6/hcs6-builder.d.ts +5 -4
- package/dist/umd/builders/inscriber/inscriber-builder.d.ts +32 -1
- package/dist/umd/index.d.ts +4 -0
- package/dist/umd/signing/bytes-registry.d.ts +17 -0
- package/dist/umd/signing/signer-provider.d.ts +45 -0
- 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/InitiateConnectionTool.d.ts +4 -4
- package/dist/umd/tools/hcs2/CreateRegistryTool.d.ts +2 -2
- package/dist/umd/tools/hcs2/DeleteEntryTool.d.ts +2 -2
- package/dist/umd/tools/hcs2/UpdateEntryTool.d.ts +2 -2
- package/dist/umd/tools/hcs6/RegisterDynamicHashinalTool.d.ts +10 -10
- package/dist/umd/tools/hcs6/UpdateDynamicHashinalTool.d.ts +8 -8
- package/dist/umd/tools/inscriber/InscribeFromBufferTool.d.ts +5 -4
- package/dist/umd/tools/inscriber/InscribeFromFileTool.d.ts +2 -2
- package/dist/umd/tools/inscriber/InscribeFromUrlTool.d.ts +4 -4
- package/dist/umd/tools/inscriber/InscribeHashinalTool.d.ts +3 -3
- package/dist/umd/types/inscription-response.d.ts +8 -0
- package/dist/umd/types/tx-results.d.ts +15 -0
- package/dist/umd/utils/CodedError.d.ts +4 -0
- package/dist/umd/utils/inscription-utils.d.ts +21 -0
- package/dist/umd/validation/hip412-schemas.d.ts +2 -2
- package/package.json +10 -5
- package/src/builders/hcs10/hcs10-builder.ts +239 -6
- package/src/builders/hcs2/hcs2-builder.ts +302 -9
- package/src/builders/hcs6/hcs6-builder.ts +79 -4
- package/src/builders/inscriber/inscriber-builder.ts +235 -2
- package/src/hcs10/HCS10Client.ts +1 -1
- package/src/index.ts +5 -1
- package/src/lib/zod-render/schema-extension.ts +0 -1
- package/src/signing/bytes-registry.ts +501 -0
- package/src/signing/signer-provider.ts +120 -0
- package/src/tools/hcs2/CreateRegistryTool.ts +30 -5
- package/src/tools/hcs2/DeleteEntryTool.ts +16 -2
- package/src/tools/hcs2/MigrateRegistryTool.ts +16 -2
- package/src/tools/hcs2/QueryRegistryTool.ts +11 -2
- package/src/tools/hcs2/RegisterEntryTool.ts +17 -3
- package/src/tools/hcs2/UpdateEntryTool.ts +16 -2
- package/src/tools/hcs6/CreateDynamicRegistryTool.ts +17 -3
- package/src/tools/hcs6/RegisterDynamicHashinalTool.ts +17 -3
- package/src/tools/hcs6/UpdateDynamicHashinalTool.ts +17 -3
- package/src/tools/inscriber/InscribeFromBufferTool.ts +126 -21
- package/src/tools/inscriber/InscribeFromFileTool.ts +10 -13
- package/src/tools/inscriber/InscribeFromUrlTool.ts +15 -11
- package/src/tools/inscriber/InscribeHashinalTool.ts +40 -168
- package/src/tools/inscriber/RetrieveInscriptionTool.ts +15 -16
- package/src/types/inscription-response.ts +27 -0
- package/src/types/tx-results.ts +18 -0
- package/src/utils/CodedError.ts +8 -0
- package/src/utils/Encryption.ts +0 -2
- package/src/utils/ensure-agent-has-hbar.ts +4 -5
- package/src/utils/inscription-utils.ts +53 -0
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Hashgraph Online Standards Agent Kit
|
|
2
2
|
|
|
3
|
-
|  | A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication.<br><br>This SDK is built and maintained by [Hashgraph Online](https://hashgraphonline.com), a consortium of leading Hedera Organizations within the Hedera ecosystem.<br><br>[📚 Standards Agent Kit Documentation](https://hashgraphonline.com/docs/libraries/standards-agent-kit/)<br>[📖 HCS Standards Documentation](https://
|
|
3
|
+
|  | A modular SDK for building on-chain autonomous agents using Hashgraph Online Standards, including HCS-10 for agent discovery and communication.<br><br>This SDK is built and maintained by [Hashgraph Online](https://hashgraphonline.com), a consortium of leading Hedera Organizations within the Hedera ecosystem.<br><br>[📚 Standards Agent Kit Documentation](https://hashgraphonline.com/docs/libraries/standards-agent-kit/)<br>[📖 HCS Standards Documentation](https://hashgraphonline.com/docs/standards) |
|
|
4
4
|
| :-------------------------------------------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
5
5
|
|
|
6
6
|
## Quick Start
|
|
@@ -24,7 +24,7 @@ npm install @hashgraphonline/standards-agent-plugin
|
|
|
24
24
|
For complete documentation, examples, and API references, visit:
|
|
25
25
|
|
|
26
26
|
- [Standards Agent Kit Documentation](https://hashgraphonline.com/docs/libraries/standards-agent-kit/)
|
|
27
|
-
- [HCS-10 Standard Documentation](https://
|
|
27
|
+
- [HCS-10 Standard Documentation](https://hashgraphonline.com/docs/standards/hcs-10)
|
|
28
28
|
|
|
29
29
|
## Features
|
|
30
30
|
|
|
@@ -189,11 +189,10 @@ Please read our [Contributing Guide](CONTRIBUTING.md) before contributing to thi
|
|
|
189
189
|
## Resources
|
|
190
190
|
|
|
191
191
|
- [Standards Agent Kit Documentation](https://hashgraphonline.com/docs/libraries/standards-agent-kit/)
|
|
192
|
-
- [HCS Standards Documentation](https://
|
|
192
|
+
- [HCS Standards Documentation](https://hashgraphonline.com/docs/standards)
|
|
193
193
|
- [Hedera Documentation](https://docs.hedera.com)
|
|
194
194
|
- [GitHub Repository](https://github.com/hashgraph-online/standards-agent-kit)
|
|
195
195
|
|
|
196
196
|
## License
|
|
197
197
|
|
|
198
198
|
Apache-2.0
|
|
199
|
-
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseServiceBuilder, HederaAgentKit } from 'hedera-agent-kit';
|
|
2
|
-
import { HCS2Client, CreateRegistryOptions, RegisterEntryOptions, UpdateEntryOptions, DeleteEntryOptions, MigrateTopicOptions, QueryRegistryOptions,
|
|
2
|
+
import { HCS2Client, CreateRegistryOptions, RegisterEntryOptions, UpdateEntryOptions, DeleteEntryOptions, MigrateTopicOptions, QueryRegistryOptions, TopicRegistry } from '@hashgraphonline/standards-sdk';
|
|
3
|
+
import { TopicRegistrationResult, RegistryOperationResult, SubmitMessageResult } from '../../types/tx-results';
|
|
3
4
|
/**
|
|
4
5
|
* Builder for HCS-2 operations that delegates to HCS2Client
|
|
5
6
|
*/
|
|
@@ -14,23 +15,23 @@ export declare class HCS2Builder extends BaseServiceBuilder {
|
|
|
14
15
|
* Create a new HCS-2 registry
|
|
15
16
|
* Note: This executes the transaction directly via HCS2Client
|
|
16
17
|
*/
|
|
17
|
-
createRegistry(options?: CreateRegistryOptions): Promise<
|
|
18
|
+
createRegistry(options?: CreateRegistryOptions): Promise<TopicRegistrationResult>;
|
|
18
19
|
/**
|
|
19
20
|
* Register a new entry in an HCS-2 registry
|
|
20
21
|
*/
|
|
21
|
-
registerEntry(registryTopicId: string, options: RegisterEntryOptions): Promise<
|
|
22
|
+
registerEntry(registryTopicId: string, options: RegisterEntryOptions): Promise<RegistryOperationResult>;
|
|
22
23
|
/**
|
|
23
24
|
* Update an existing entry in an HCS-2 registry
|
|
24
25
|
*/
|
|
25
|
-
updateEntry(registryTopicId: string, options: UpdateEntryOptions): Promise<
|
|
26
|
+
updateEntry(registryTopicId: string, options: UpdateEntryOptions): Promise<RegistryOperationResult>;
|
|
26
27
|
/**
|
|
27
28
|
* Delete an entry from an HCS-2 registry
|
|
28
29
|
*/
|
|
29
|
-
deleteEntry(registryTopicId: string, options: DeleteEntryOptions): Promise<
|
|
30
|
+
deleteEntry(registryTopicId: string, options: DeleteEntryOptions): Promise<RegistryOperationResult>;
|
|
30
31
|
/**
|
|
31
32
|
* Migrate an HCS-2 registry to a new topic
|
|
32
33
|
*/
|
|
33
|
-
migrateRegistry(registryTopicId: string, options: MigrateTopicOptions): Promise<
|
|
34
|
+
migrateRegistry(registryTopicId: string, options: MigrateTopicOptions): Promise<RegistryOperationResult>;
|
|
34
35
|
/**
|
|
35
36
|
* Query entries from an HCS-2 registry
|
|
36
37
|
*/
|
|
@@ -38,7 +39,7 @@ export declare class HCS2Builder extends BaseServiceBuilder {
|
|
|
38
39
|
/**
|
|
39
40
|
* Submit a raw message to an HCS-2 topic
|
|
40
41
|
*/
|
|
41
|
-
submitMessage(topicId: string, payload: any): Promise<
|
|
42
|
+
submitMessage(topicId: string, payload: any): Promise<SubmitMessageResult>;
|
|
42
43
|
/**
|
|
43
44
|
* Get topic info from mirror node
|
|
44
45
|
*/
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { BaseServiceBuilder, HederaAgentKit } from 'hedera-agent-kit';
|
|
2
|
-
import { HCS6Client, HCS6CreateRegistryOptions, HCS6RegisterEntryOptions, HCS6QueryRegistryOptions, HCS6RegisterOptions, HCS6CreateHashinalOptions,
|
|
2
|
+
import { HCS6Client, HCS6CreateRegistryOptions, HCS6RegisterEntryOptions, HCS6QueryRegistryOptions, HCS6RegisterOptions, HCS6CreateHashinalOptions, HCS6TopicRegistry, HCS6CreateHashinalResponse } from '@hashgraphonline/standards-sdk';
|
|
3
|
+
import { HCS6TopicRegistrationResult, HCS6RegistryOperationResult } from '../../types/tx-results';
|
|
3
4
|
/**
|
|
4
5
|
* Builder for HCS-6 operations that delegates to HCS6Client
|
|
5
6
|
*/
|
|
@@ -14,11 +15,11 @@ export declare class HCS6Builder extends BaseServiceBuilder {
|
|
|
14
15
|
* Create a new HCS-6 dynamic registry
|
|
15
16
|
* Note: This executes the transaction directly via HCS6Client
|
|
16
17
|
*/
|
|
17
|
-
createRegistry(options?: HCS6CreateRegistryOptions): Promise<
|
|
18
|
+
createRegistry(options?: HCS6CreateRegistryOptions): Promise<HCS6TopicRegistrationResult>;
|
|
18
19
|
/**
|
|
19
20
|
* Register a new dynamic hashinal entry in an HCS-6 registry
|
|
20
21
|
*/
|
|
21
|
-
registerEntry(registryTopicId: string, options: HCS6RegisterEntryOptions): Promise<
|
|
22
|
+
registerEntry(registryTopicId: string, options: HCS6RegisterEntryOptions): Promise<HCS6RegistryOperationResult>;
|
|
22
23
|
/**
|
|
23
24
|
* Query entries from an HCS-6 registry
|
|
24
25
|
*/
|
|
@@ -35,7 +36,7 @@ export declare class HCS6Builder extends BaseServiceBuilder {
|
|
|
35
36
|
/**
|
|
36
37
|
* Submit a raw message to an HCS-6 topic
|
|
37
38
|
*/
|
|
38
|
-
submitMessage(topicId: string, payload: any): Promise<
|
|
39
|
+
submitMessage(topicId: string, payload: any): Promise<HCS6RegistryOperationResult>;
|
|
39
40
|
/**
|
|
40
41
|
* Get topic info from mirror node
|
|
41
42
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BaseServiceBuilder, HederaAgentKit } from 'hedera-agent-kit';
|
|
1
|
+
import { BaseServiceBuilder, HederaAgentKit, AgentOperationalMode } from 'hedera-agent-kit';
|
|
2
2
|
import { InscriptionInput, InscriptionOptions, InscriptionResponse, RetrievedInscriptionResult } from '@hashgraphonline/standards-sdk';
|
|
3
3
|
import { InscriptionSDK } from '@kiloscribe/inscription-sdk';
|
|
4
4
|
/**
|
|
@@ -15,7 +15,37 @@ interface DAppSigner {
|
|
|
15
15
|
*/
|
|
16
16
|
export declare class InscriberBuilder extends BaseServiceBuilder {
|
|
17
17
|
protected inscriptionSDK?: InscriptionSDK;
|
|
18
|
+
private static signerProvider?;
|
|
19
|
+
private static walletInfoResolver?;
|
|
20
|
+
private static startInscriptionDelegate?;
|
|
21
|
+
private static walletExecutor?;
|
|
22
|
+
/** When true, do not allow server fallback; require a wallet path in Provide Bytes */
|
|
23
|
+
private static preferWalletOnly;
|
|
18
24
|
constructor(hederaKit: HederaAgentKit);
|
|
25
|
+
getOperationalMode(): AgentOperationalMode;
|
|
26
|
+
static setSignerProvider(provider: () => Promise<DAppSigner | null> | DAppSigner | null): void;
|
|
27
|
+
static setWalletInfoResolver(resolver: () => Promise<{
|
|
28
|
+
accountId: string;
|
|
29
|
+
network: 'mainnet' | 'testnet';
|
|
30
|
+
} | null> | {
|
|
31
|
+
accountId: string;
|
|
32
|
+
network: 'mainnet' | 'testnet';
|
|
33
|
+
} | null): void;
|
|
34
|
+
static setStartInscriptionDelegate(delegate: (request: Record<string, unknown>, network: 'mainnet' | 'testnet') => Promise<{
|
|
35
|
+
transactionBytes: string;
|
|
36
|
+
tx_id?: string;
|
|
37
|
+
topic_id?: string;
|
|
38
|
+
status?: string;
|
|
39
|
+
completed?: boolean;
|
|
40
|
+
}>): void;
|
|
41
|
+
static setWalletExecutor(executor: (base64: string, network: 'mainnet' | 'testnet') => Promise<{
|
|
42
|
+
transactionId: string;
|
|
43
|
+
}>): void;
|
|
44
|
+
/**
|
|
45
|
+
* Control fallback behavior. When true, wallet must be available for execution paths.
|
|
46
|
+
*/
|
|
47
|
+
static setPreferWalletOnly(flag: boolean): void;
|
|
48
|
+
getSigner(): Promise<DAppSigner | null>;
|
|
19
49
|
/**
|
|
20
50
|
* Get or create Inscription SDK - temporarily returns null since we don't have the actual SDK
|
|
21
51
|
*/
|
|
@@ -28,6 +58,7 @@ export declare class InscriberBuilder extends BaseServiceBuilder {
|
|
|
28
58
|
* Inscribe content using a DApp signer
|
|
29
59
|
*/
|
|
30
60
|
inscribeWithSigner(input: InscriptionInput, signer: DAppSigner, options: InscriptionOptions): Promise<InscriptionResponse>;
|
|
61
|
+
inscribeAuto(input: InscriptionInput, options: InscriptionOptions): Promise<InscriptionResponse>;
|
|
31
62
|
/**
|
|
32
63
|
* Retrieve an existing inscription
|
|
33
64
|
*/
|
package/dist/cjs/index.d.ts
CHANGED
|
@@ -9,3 +9,7 @@ export type { ExecuteResult } from './builders';
|
|
|
9
9
|
export { HCS10Client } from './hcs10';
|
|
10
10
|
export type { ContentReferenceConfig } from './config/ContentReferenceConfig';
|
|
11
11
|
export { loadConfig } from './config/ContentReferenceConfig';
|
|
12
|
+
export { SignerProviderRegistry } from './signing/signer-provider';
|
|
13
|
+
export type { DAppSigner, WalletInfo, WalletExecutor, StartHCSDelegate, NetworkString } from './signing/signer-provider';
|
|
14
|
+
export { ByteBuildRegistry } from './signing/bytes-registry';
|
|
15
|
+
export type { ByteBuildHandler } from './signing/bytes-registry';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { HederaAgentKit } from 'hedera-agent-kit';
|
|
2
|
+
export type ByteBuildHandler = (ctx: {
|
|
3
|
+
hederaKit: HederaAgentKit;
|
|
4
|
+
request: Record<string, unknown>;
|
|
5
|
+
}) => Promise<{
|
|
6
|
+
transactionBytes: string;
|
|
7
|
+
}>;
|
|
8
|
+
declare class ByteBuildRegistryImpl {
|
|
9
|
+
private handlers;
|
|
10
|
+
register(op: string, handler: ByteBuildHandler): void;
|
|
11
|
+
has(op: string): boolean;
|
|
12
|
+
build(op: string, hederaKit: HederaAgentKit, request: Record<string, unknown>): Promise<{
|
|
13
|
+
transactionBytes: string;
|
|
14
|
+
} | null>;
|
|
15
|
+
}
|
|
16
|
+
export declare const ByteBuildRegistry: ByteBuildRegistryImpl;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
export type NetworkString = 'mainnet' | 'testnet';
|
|
2
|
+
export interface DAppSigner {
|
|
3
|
+
getAccountId(): {
|
|
4
|
+
toString(): string;
|
|
5
|
+
};
|
|
6
|
+
[key: string]: unknown;
|
|
7
|
+
}
|
|
8
|
+
export type WalletInfo = {
|
|
9
|
+
accountId: string;
|
|
10
|
+
network: NetworkString;
|
|
11
|
+
};
|
|
12
|
+
export type WalletInfoResolver = () => Promise<WalletInfo | null> | WalletInfo | null;
|
|
13
|
+
export type WalletExecutor = (base64: string, network: NetworkString) => Promise<{
|
|
14
|
+
transactionId: string;
|
|
15
|
+
}>;
|
|
16
|
+
export type HCSOperation = 'submitConnectionRequest' | 'handleConnectionRequest' | 'sendMessage' | 'hcs2.createRegistry' | 'hcs2.migrateRegistry' | 'hcs2.registerEntry' | 'hcs2.updateEntry' | 'hcs2.deleteEntry' | 'hcs2.submitMessage' | 'hcs6.createRegistry' | 'hcs6.registerEntry' | 'hcs6.submitMessage';
|
|
17
|
+
export type StartHCSDelegate = (op: HCSOperation, request: Record<string, unknown>, network: NetworkString) => Promise<{
|
|
18
|
+
transactionBytes: string;
|
|
19
|
+
}>;
|
|
20
|
+
/**
|
|
21
|
+
* Central registry for browser signer and wallet execution delegates
|
|
22
|
+
*/
|
|
23
|
+
export declare class SignerProviderRegistry {
|
|
24
|
+
private static _signerProvider;
|
|
25
|
+
private static _walletInfoResolver;
|
|
26
|
+
private static _walletExecutor;
|
|
27
|
+
private static _startHCSDelegate;
|
|
28
|
+
private static _browserHCSClientFactory;
|
|
29
|
+
private static _preferWalletOnly;
|
|
30
|
+
static setSignerProvider(provider: typeof SignerProviderRegistry._signerProvider): void;
|
|
31
|
+
static getSigner(): Promise<DAppSigner | null>;
|
|
32
|
+
static setWalletInfoResolver(resolver: WalletInfoResolver | null): void;
|
|
33
|
+
static getWalletInfo(): Promise<WalletInfo | null>;
|
|
34
|
+
static setWalletExecutor(executor: WalletExecutor | null): void;
|
|
35
|
+
static get walletExecutor(): WalletExecutor | null;
|
|
36
|
+
static setStartHCSDelegate(delegate: StartHCSDelegate | null): void;
|
|
37
|
+
static get startHCSDelegate(): StartHCSDelegate | null;
|
|
38
|
+
static setPreferWalletOnly(flag: boolean): void;
|
|
39
|
+
/**
|
|
40
|
+
* Register a factory to construct a BrowserHCSClient-like instance for wallet-driven flows
|
|
41
|
+
*/
|
|
42
|
+
static setBrowserHCSClientFactory(factory: ((network: NetworkString) => unknown) | null): void;
|
|
43
|
+
static getBrowserHCSClient(network: NetworkString): unknown | null;
|
|
44
|
+
static get preferWalletOnly(): boolean;
|
|
45
|
+
}
|