HCS‑11 API Reference
Sources
- Module folder: GitHub
- client.ts: GitHub
- agent-builder.ts: GitHub
- person-builder.ts: GitHub
- mcp-server-builder.ts: GitHub
- types.ts: GitHub
Import PathsDirect link to Import Paths
- TypeScript
- Go
import {
HCS11Client,
AgentBuilder,
PersonBuilder,
MCPServerBuilder,
type HCS11ClientConfig,
type HCS11Profile,
type PersonalProfile,
type AIAgentProfile,
type MCPServerProfile,
ProfileType,
AIAgentType,
AIAgentCapability,
} from '@hashgraphonline/standards-sdk';
NewClient(config ClientConfig) (*Client, error)
Client.CreateAndInscribeProfile(ctx, HCS11Profile, waitForConfirmation bool)
Client.InscribeProfile(ctx, ...)
Client.InscribeImage(ctx, ...)
Client.FetchProfileByAccountID(ctx, ...)
Client.UpdateAccountMemoWithProfile(ctx, ...)
NewAgentBuilder() *AgentBuilder
AgentBuilder.SetName/SetBio/SetAlias/SetDescription/SetCapabilities/SetType/SetModel/SetCreator/AddSocial/AddProperty/SetInboundTopicID/SetOutboundTopicID/SetBaseAccount(...)
AgentBuilder.Build() (HCS11Profile, error)
NewPersonBuilder() *PersonBuilder
Types (selected)Direct link to Types (selected)
- TypeScript
- Go
enum ProfileType { PERSONAL=0, AI_AGENT=1, MCP_SERVER=2, FLORA=3 }
enum AIAgentType { MANUAL=0, AUTONOMOUS=1 }
enum AIAgentCapability { /* bit flags */ TEXT_GENERATION=1 /* … */ }
interface HCS11ClientConfig {
network: 'mainnet' | 'testnet';
auth: { operatorId: string; privateKey?: string; signer?: any };
logLevel?: 'debug'|'info'|'warn'|'error';
keyType?: 'ed25519'|'ecdsa';
silent?: boolean;
}
// See standards-sdk-go for full Go API types and methods
BuildersDirect link to Builders
- TypeScript
- Go
new AgentBuilder();
new PersonBuilder();
new MCPServerBuilder();
// See standards-sdk-go for full Go API types and methods
Client (HCS11Client)Direct link to Client (HCS11Client)
- TypeScript
- Go
constructor(config: HCS11ClientConfig)
getClient(): import('@hashgraph/sdk').Client
getOperatorId(): string
initializeOperator(): Promise<void>
// Create profiles (in‑memory)
createPersonalProfile(displayName: string, options?): PersonalProfile
createAIAgentProfile(displayName: string, type: AIAgentType, caps: AIAgentCapability[], model: string, options?): AIAgentProfile
createMCPServerProfile(displayName: string, server: MCPServerDetails, options?): MCPServerProfile
// Validation/format helpers
validateProfile(profile: unknown): { valid: boolean; errors: string[] }
profileToJSONString(profile: HCS11Profile): string
parseProfileFromString(profileStr: string): HCS11Profile | null
setProfileForAccountMemo(topicId: string, topicStandard?: 1|2|7): string // hcs-11:hcs://<std>/<topicId>
// Inscription flows
inscribeImage(buffer: Buffer, fileName: string, options?): Promise<{ success: boolean; topicId?: string; transactionId?: string; totalCostHbar?: string; error?: string }>
inscribeProfile(profile: HCS11Profile, options?): Promise<{ success: boolean; profileTopicId?: string; transactionId?: string; totalCostHbar?: string; error?: string }>
createAndInscribeProfile(builder: AgentBuilder|PersonBuilder|MCPServerBuilder, updateAccountMemo?: boolean): Promise<{ success: boolean; profileTopicId?: string; transactionId?: string; totalCostHbar?: string; error?: string }>
updateAccountMemoWithProfile(accountId: string, profileTopicId: string): Promise<{ success: boolean; error?: string }>
// Discovery helpers
getCapabilitiesFromTags(tags: string[]): Promise<number[]>
getAgentTypeFromMetadata(meta: AgentMetadata): AIAgentType
fetchProfileByAccountId(accountId: string, network?: string): Promise<{ success: boolean; profile?: HCS11Profile; error?: string; topicInfo?: any }>
// See standards-sdk-go for full Go API types and methods
Notes
- Works with both private key operator and wallet signer; auto‑detects key curve or queries Mirror Node.
- Progress callbacks for inscription are supported via options.
Source
ExampleDirect link to Example
- TypeScript
- Go
const client = new HCS11Client({ network: 'testnet', auth: { operatorId, privateKey } });
const profile = client.createAIAgentProfile('Bot', AIAgentType.AUTONOMOUS, [AIAgentCapability.TEXT_GENERATION], 'gpt-4');
const res = await client.inscribeProfile(profile, { waitForConfirmation: true });
// See standards-sdk-go for full Go API types and methods