@hashgraphonline/standards-sdk 0.0.38 → 0.0.41

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.
@@ -32,6 +32,7 @@ export declare class AgentBuilder {
32
32
  addProperty(key: string, value: any): AgentBuilder;
33
33
  setMetadata(metadata: AgentMetadata): AgentBuilder;
34
34
  setProfilePicture(pfpBuffer: Buffer, pfpFileName: string): AgentBuilder;
35
+ setExistingProfilePicture(pfpTopicId: string): AgentBuilder;
35
36
  setNetwork(network: NetworkType): AgentBuilder;
36
37
  setInboundTopicType(inboundTopicType: InboundTopicType): AgentBuilder;
37
38
  setFeeConfig(feeConfigBuilder: FeeConfigBuilderInterface): AgentBuilder;
@@ -3,7 +3,8 @@ import { HashinalsWalletConnectSDK } from '@hashgraphonline/hashinal-wc';
3
3
  import { Logger, LogLevel } from '../utils/logger';
4
4
  import { RetrievedInscriptionResult } from '@kiloscribe/inscription-sdk';
5
5
  import { HCS10BaseClient } from './base-client';
6
- import { AgentConfig, NetworkType, RegistrationProgressCallback } from './types.d';
6
+ import { AgentConfig, RegistrationProgressCallback, AgentCreationState } from './types.d';
7
+ import { AgentBuilder } from './agent-builder';
7
8
  export type BrowserHCSClientConfig = {
8
9
  network: 'mainnet' | 'testnet';
9
10
  hwc: HashinalsWalletConnectSDK;
@@ -60,6 +61,7 @@ export declare class BrowserHCSClient extends HCS10BaseClient {
60
61
  }>;
61
62
  createAgent(pfpBuffer: Buffer, pfpFileName: string, agentName: string, agentDescription: string, capabilities: number[], metadata: AgentMetadata, existingPfpTopicId?: string, options?: {
62
63
  progressCallback?: RegistrationProgressCallback;
64
+ existingState?: AgentCreationState;
63
65
  }): Promise<{
64
66
  outboundTopicId: string;
65
67
  inboundTopicId: string;
@@ -67,16 +69,15 @@ export declare class BrowserHCSClient extends HCS10BaseClient {
67
69
  profileTopicId: string;
68
70
  error?: string;
69
71
  success: boolean;
72
+ state: AgentCreationState;
70
73
  }>;
71
- createAndRegisterAgent(name: string, description: string, capabilities: number[], metadata: AgentMetadata, pfpBuffer: Buffer, pfpFileName: string, network: NetworkType, existingPfpTopicId?: string, options?: {
72
- progressCallback?: RegistrationProgressCallback;
73
- maxAttempts?: number;
74
- delayMs?: number;
75
- }): Promise<BrowserAgentConfig>;
76
- registerAgentWithGuardedRegistry(accountId: string, inboundTopicId: string, network?: string, options?: {
74
+ private initializeRegistrationState;
75
+ private updateStateForCompletedRegistration;
76
+ registerAgentWithGuardedRegistry(accountId: string, network?: string, options?: {
77
77
  progressCallback?: RegistrationProgressCallback;
78
78
  maxAttempts?: number;
79
79
  delayMs?: number;
80
+ existingState?: AgentCreationState;
80
81
  }): Promise<{
81
82
  error?: string;
82
83
  success: boolean;
@@ -84,8 +85,16 @@ export declare class BrowserHCSClient extends HCS10BaseClient {
84
85
  transactionId?: string;
85
86
  confirmed?: boolean;
86
87
  validationErrors?: any[];
88
+ state: AgentCreationState;
89
+ }>;
90
+ createAndRegisterAgent(builder: AgentBuilder, options?: {
91
+ progressCallback?: RegistrationProgressCallback;
92
+ maxAttempts?: number;
93
+ delayMs?: number;
94
+ existingState?: AgentCreationState;
95
+ }): Promise<BrowserAgentConfig & {
96
+ state: AgentCreationState;
87
97
  }>;
88
- waitForRegistrationConfirmation(transactionId: string, network: string, guardedRegistryBaseUrl: string, maxAttempts?: number, delayMs?: number, progressCallbackOrLogger?: ((currentAttempt: number, maxAttempts: number) => void) | Logger): Promise<boolean>;
89
98
  storeHCS11Profile(agentName: string, agentDescription: string, inboundTopicId: string, outboundTopicId: string, capabilities?: number[], metadata?: Record<string, any>, pfpBuffer?: Buffer, pfpFileName?: string, existingPfpTopicId?: string, options?: {
90
99
  progressCallback?: RegistrationProgressCallback;
91
100
  }): Promise<{
@@ -105,12 +114,6 @@ export declare class BrowserHCSClient extends HCS10BaseClient {
105
114
  accountId: string;
106
115
  signer: any;
107
116
  };
108
- /**
109
- * Inscribes a profile picture file to the Hedera network
110
- * @param buffer File buffer to inscribe
111
- * @param fileName Filename for the inscription
112
- * @returns Object containing the topic ID and success status
113
- */
114
117
  inscribePfp(buffer: Buffer, fileName: string, options?: {
115
118
  progressCallback?: RegistrationProgressCallback;
116
119
  }): Promise<{
@@ -23,21 +23,49 @@ export interface RegistrationSearchResult {
23
23
  error?: string;
24
24
  success: boolean;
25
25
  }
26
+ export interface RegistrationsApiResponse {
27
+ registrations: Array<{
28
+ id: string;
29
+ transaction_id: string;
30
+ status: 'pending' | 'success' | 'failed';
31
+ network: string;
32
+ account_id: string;
33
+ inbound_topic_id: string;
34
+ outbound_topic_id: string;
35
+ operator_id: string;
36
+ metadata: AgentMetadata;
37
+ registry_topic_id: string;
38
+ created_at: string;
39
+ updated_at: string;
40
+ }>;
41
+ error?: string;
42
+ }
26
43
  export type RegistrationResult = {
27
44
  transaction?: any;
28
45
  transactionId?: string;
29
46
  success: boolean;
30
47
  error?: string;
31
- validationErrors?: any[];
48
+ validationErrors?: ValidationError[];
32
49
  };
50
+ export interface ValidationError {
51
+ message: string;
52
+ path?: string[];
53
+ type?: string;
54
+ context?: any;
55
+ }
56
+ export interface RegistrationApiResponse {
57
+ transaction_id: string;
58
+ transaction: string;
59
+ error?: string;
60
+ details?: ValidationError[];
61
+ }
62
+ export interface RegistrationStatusResponse {
63
+ status: 'pending' | 'success' | 'failed';
64
+ error?: string;
65
+ }
33
66
  export declare abstract class Registration {
34
- protected checkRegistrationStatus(transactionId: string, network: string, baseUrl: string, logger?: Logger): Promise<{
35
- status: 'pending' | 'success' | 'failed';
36
- }>;
67
+ protected checkRegistrationStatus(transactionId: string, network: string, baseUrl: string, logger?: Logger): Promise<RegistrationStatusResponse>;
37
68
  waitForRegistrationConfirmation(transactionId: string, network: string, baseUrl: string, maxAttempts?: number, delayMs?: number, logger?: Logger): Promise<boolean>;
38
- executeRegistration(accountId: string, inboundTopicId: string, network: string, baseUrl: string, logger?: Logger, metadata?: {
39
- tags: string[];
40
- [key: string]: any;
41
- }): Promise<RegistrationResult>;
69
+ executeRegistration(accountId: string, network?: string, baseUrl?: string, logger?: Logger): Promise<RegistrationResult>;
42
70
  findRegistrations(options?: RegistrationSearchOptions, baseUrl?: string): Promise<RegistrationSearchResult>;
43
71
  }
@@ -2,7 +2,7 @@ import { Client, PrivateKey, KeyList, TransactionReceipt, PublicKey } from '@has
2
2
  import { RetrievedInscriptionResult } from '@kiloscribe/inscription-sdk';
3
3
  import { Logger } from '../utils/logger';
4
4
  import { HCS10BaseClient } from './base-client';
5
- import { HCSClientConfig, AgentConfig, CreateAccountResponse, CreateAgentResponse, InscribePfpResponse, StoreHCS11ProfileResponse, AgentRegistrationResult, HandleConnectionRequestResponse, WaitForConnectionConfirmationResponse, GetAccountAndSignerResponse, InboundTopicType, TopicFeeConfig, FeeConfigBuilderInterface } from './types.d';
5
+ import { HCSClientConfig, CreateAccountResponse, CreateAgentResponse, InscribePfpResponse, StoreHCS11ProfileResponse, AgentRegistrationResult, HandleConnectionRequestResponse, WaitForConnectionConfirmationResponse, GetAccountAndSignerResponse, InboundTopicType, TopicFeeConfig, FeeConfigBuilderInterface, AgentCreationState } from './types.d';
6
6
  import { AgentBuilder } from './agent-builder';
7
7
  export { InboundTopicType } from './types.d';
8
8
  export { FeeConfigBuilder } from './fee-config-builder';
@@ -140,9 +140,14 @@ export declare class HCS10Client extends HCS10BaseClient {
140
140
  * 4. Registers the agent with the Hashgraph Online Guarded Registry.
141
141
  *
142
142
  * @param builder The agent builder object
143
- * @returns Agent configuration
143
+ * @param options Optional configuration including progress callback and state management
144
+ * @returns Agent registration result
144
145
  */
145
- createAndRegisterAgent(builder: AgentBuilder): Promise<AgentConfig<HCS10Client>>;
146
+ createAndRegisterAgent(builder: AgentBuilder, options?: {
147
+ baseUrl?: string;
148
+ progressCallback?: RegistrationProgressCallback;
149
+ existingState?: AgentCreationState;
150
+ }): Promise<AgentRegistrationResult>;
146
151
  /**
147
152
  * Registers an agent with the guarded registry
148
153
  * @param accountId Account ID to register
@@ -151,10 +156,11 @@ export declare class HCS10Client extends HCS10BaseClient {
151
156
  * @param options Optional configuration including progress callback and confirmation settings
152
157
  * @returns Registration result
153
158
  */
154
- registerAgentWithGuardedRegistry(accountId: string, inboundTopicId: string, network?: string, options?: {
159
+ registerAgentWithGuardedRegistry(accountId: string, network?: string, options?: {
155
160
  progressCallback?: RegistrationProgressCallback;
156
161
  maxAttempts?: number;
157
162
  delayMs?: number;
163
+ existingState?: AgentCreationState;
158
164
  }): Promise<AgentRegistrationResult>;
159
165
  /**
160
166
  * Registers an agent with the guarded registry. Should be called by a registry.
@@ -146,12 +146,19 @@ export declare class HCS11Client {
146
146
  parseProfileFromString(profileStr: string): HCS11Profile | null;
147
147
  setProfileForAccountMemo(topicId: string, topicStandard?: 1 | 2 | 7): string;
148
148
  private executeTransaction;
149
- private inscribeContent;
150
149
  inscribeImage(buffer: Buffer, fileName: string, options?: InscribeImageOptions): Promise<InscribeImageResponse>;
151
150
  inscribeProfile(profile: HCS11Profile, options?: InscribeProfileOptions): Promise<InscribeProfileResponse>;
152
151
  updateAccountMemoWithProfile(accountId: string | AccountId, profileTopicId: string): Promise<TransactionResult>;
153
152
  createAndInscribeProfile(profile: HCS11Profile, updateAccountMemo?: boolean, options?: InscribeProfileOptions): Promise<InscribeProfileResponse>;
154
- getCapabilitiesFromTags(capabilityNames: string[]): Promise<AIAgentCapability[]>;
153
+ getCapabilitiesFromTags(capabilityNames: string[]): Promise<number[]>;
155
154
  getAgentTypeFromMetadata(metadata: AIAgentMetadata): AIAgentType;
156
- private detectMimeTypeFromBase64;
155
+ fetchProfileByAccountId(accountId: string | AccountId, network?: string): Promise<{
156
+ success: boolean;
157
+ profile?: HCS11Profile;
158
+ error?: string;
159
+ topicInfo?: {
160
+ inboundTopicId?: string;
161
+ outboundTopicId?: string;
162
+ };
163
+ }>;
157
164
  }