@hashgraphonline/standards-sdk 0.0.112-canary.2 → 0.0.112-canary.4

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.
Files changed (43) hide show
  1. package/dist/cjs/index-CHar8dVv-SclbHQNq.cjs +11 -0
  2. package/dist/cjs/{index-CHar8dVv-CRh6n7ac.cjs.map → index-CHar8dVv-SclbHQNq.cjs.map} +1 -1
  3. package/dist/cjs/{index-BjSZGzAb.cjs → index-CcE0yY9g.cjs} +2 -2
  4. package/dist/cjs/{index-BjSZGzAb.cjs.map → index-CcE0yY9g.cjs.map} +1 -1
  5. package/dist/cjs/standards-sdk.cjs +1 -1
  6. package/dist/es/standards-sdk.es13.js +0 -1
  7. package/dist/es/standards-sdk.es13.js.map +1 -1
  8. package/dist/es/standards-sdk.es19.js +6 -6
  9. package/dist/es/standards-sdk.es20.js +1 -2
  10. package/dist/es/standards-sdk.es20.js.map +1 -1
  11. package/dist/es/standards-sdk.es21.js +0 -1
  12. package/dist/es/standards-sdk.es21.js.map +1 -1
  13. package/dist/es/standards-sdk.es24.js +450 -7139
  14. package/dist/es/standards-sdk.es24.js.map +1 -1
  15. package/dist/es/standards-sdk.es25.js +109 -2
  16. package/dist/es/standards-sdk.es25.js.map +1 -1
  17. package/dist/es/standards-sdk.es26.js +34 -469
  18. package/dist/es/standards-sdk.es26.js.map +1 -1
  19. package/dist/es/standards-sdk.es27.js +221 -74
  20. package/dist/es/standards-sdk.es27.js.map +1 -1
  21. package/dist/es/standards-sdk.es28.js +141 -34
  22. package/dist/es/standards-sdk.es28.js.map +1 -1
  23. package/dist/es/standards-sdk.es29.js +5 -251
  24. package/dist/es/standards-sdk.es29.js.map +1 -1
  25. package/dist/es/standards-sdk.es30.js +7172 -155
  26. package/dist/es/standards-sdk.es30.js.map +1 -1
  27. package/dist/es/standards-sdk.es31.js +2 -11
  28. package/dist/es/standards-sdk.es31.js.map +1 -1
  29. package/dist/es/standards-sdk.es32.js +41 -7135
  30. package/dist/es/standards-sdk.es32.js.map +1 -1
  31. package/dist/es/standards-sdk.es33.js +7134 -41
  32. package/dist/es/standards-sdk.es33.js.map +1 -1
  33. package/dist/es/standards-sdk.es5.js +0 -1
  34. package/dist/es/standards-sdk.es5.js.map +1 -1
  35. package/dist/es/standards-sdk.es7.js +1 -2
  36. package/dist/es/standards-sdk.es7.js.map +1 -1
  37. package/dist/es/standards-sdk.es8.js +1 -2
  38. package/dist/es/standards-sdk.es8.js.map +1 -1
  39. package/dist/es/standards-sdk.es9.js +1 -1
  40. package/dist/umd/standards-sdk.umd.js +11 -11
  41. package/dist/umd/standards-sdk.umd.js.map +1 -1
  42. package/package.json +2 -2
  43. package/dist/cjs/index-CHar8dVv-CRh6n7ac.cjs +0 -11
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BjSZGzAb.cjs");exports.AIAgentCapability=e.AIAgentCapability,exports.AIAgentType=e.AIAgentType,exports.AccountCreationError=e.AccountCreationError,exports.AgentBuilder=e.AgentBuilder,exports.BrowserHCSClient=e.BrowserHCSClient,exports.ConnectionConfirmationError=e.ConnectionConfirmationError,exports.ConnectionsManager=e.ConnectionsManager,exports.CustomFeeType=e.CustomFeeType,exports.EVMBridge=e.EVMBridge,exports.EndpointType=e.EndpointType,exports.FeeConfigBuilder=e.FeeConfigBuilder,exports.HCS=e.HCS,exports.HCS10BaseClient=e.HCS10BaseClient,exports.HCS10Cache=e.HCS10Cache,exports.HCS10Client=e.HCS10Client,exports.HCS11Client=e.HCS11Client,exports.HRLResolver=e.HRLResolver,exports.Hcs10MemoType=e.Hcs10MemoType,exports.HederaMirrorNode=e.HederaMirrorNode,exports.InboundTopicType=e.InboundTopicType,exports.Logger=e.Logger,exports.PayloadSizeError=e.PayloadSizeError,exports.PersonBuilder=e.PersonBuilder,exports.ProfileType=e.ProfileType,exports.ProgressReporter=e.ProgressReporter,exports.Registration=e.Registration,exports.SUPPORTED_SOCIAL_PLATFORMS=e.SUPPORTED_SOCIAL_PLATFORMS,exports.TopicCreationError=e.TopicCreationError,exports.TransactionParser=e.TransactionParser,exports.WasmBridge=e.WasmBridge,exports.accountIdsToExemptKeys=e.accountIdsToExemptKeys,exports.capabilityNameToCapabilityMap=e.capabilityNameToCapabilityMap,exports.inscribe=e.inscribe,exports.inscribeWithSigner=e.inscribeWithSigner,exports.retrieveInscription=e.retrieveInscription,exports.sleep=e.sleep,exports.waitForInscriptionConfirmation=e.waitForInscriptionConfirmation;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-CcE0yY9g.cjs");exports.AIAgentCapability=e.AIAgentCapability,exports.AIAgentType=e.AIAgentType,exports.AccountCreationError=e.AccountCreationError,exports.AgentBuilder=e.AgentBuilder,exports.BrowserHCSClient=e.BrowserHCSClient,exports.ConnectionConfirmationError=e.ConnectionConfirmationError,exports.ConnectionsManager=e.ConnectionsManager,exports.CustomFeeType=e.CustomFeeType,exports.EVMBridge=e.EVMBridge,exports.EndpointType=e.EndpointType,exports.FeeConfigBuilder=e.FeeConfigBuilder,exports.HCS=e.HCS,exports.HCS10BaseClient=e.HCS10BaseClient,exports.HCS10Cache=e.HCS10Cache,exports.HCS10Client=e.HCS10Client,exports.HCS11Client=e.HCS11Client,exports.HRLResolver=e.HRLResolver,exports.Hcs10MemoType=e.Hcs10MemoType,exports.HederaMirrorNode=e.HederaMirrorNode,exports.InboundTopicType=e.InboundTopicType,exports.Logger=e.Logger,exports.PayloadSizeError=e.PayloadSizeError,exports.PersonBuilder=e.PersonBuilder,exports.ProfileType=e.ProfileType,exports.ProgressReporter=e.ProgressReporter,exports.Registration=e.Registration,exports.SUPPORTED_SOCIAL_PLATFORMS=e.SUPPORTED_SOCIAL_PLATFORMS,exports.TopicCreationError=e.TopicCreationError,exports.TransactionParser=e.TransactionParser,exports.WasmBridge=e.WasmBridge,exports.accountIdsToExemptKeys=e.accountIdsToExemptKeys,exports.capabilityNameToCapabilityMap=e.capabilityNameToCapabilityMap,exports.inscribe=e.inscribe,exports.inscribeWithSigner=e.inscribeWithSigner,exports.retrieveInscription=e.retrieveInscription,exports.sleep=e.sleep,exports.waitForInscriptionConfirmation=e.waitForInscriptionConfirmation;
2
2
  //# sourceMappingURL=standards-sdk.cjs.map
@@ -1,4 +1,3 @@
1
- import Buffer from "vite-plugin-node-polyfills/shims/buffer";
2
1
  import { Client, PrivateKey, Status, AccountUpdateTransaction } from "@hashgraph/sdk";
3
2
  import { inscribeWithSigner, inscribe } from "./standards-sdk.es20.js";
4
3
  import { Logger } from "./standards-sdk.es15.js";
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es13.js","sources":["../../src/hcs-11/client.ts"],"sourcesContent":["import {\n AccountId,\n AccountUpdateTransaction,\n Client,\n PrivateKey,\n Status,\n Transaction,\n} from '@hashgraph/sdk';\nimport {\n inscribe,\n inscribeWithSigner,\n InscriptionInput,\n InscriptionOptions,\n} from '../inscribe';\nimport { Logger } from '../utils/logger';\nimport * as mime from 'mime-types';\nimport { z, ZodIssue } from 'zod';\nimport type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport { ProgressReporter } from '../utils/progress-reporter';\nimport { HederaMirrorNode } from '../services';\nimport { TopicInfo } from '../services/types';\nimport {\n ProfileType,\n AIAgentType,\n AIAgentCapability,\n SocialLink,\n PersonalProfile,\n AIAgentProfile,\n HCS11Profile,\n HCS11Auth,\n HCS11ClientConfig,\n TransactionResult,\n InscribeProfileResponse,\n InscribeImageResponse,\n AgentMetadata,\n InscribeImageOptions,\n InscribeProfileOptions,\n capabilityNameToCapabilityMap,\n} from './types';\n\nconst SocialLinkSchema = z.object({\n platform: z.string().min(1),\n handle: z.string().min(1),\n});\n\nconst AIAgentDetailsSchema = z.object({\n type: z.nativeEnum(AIAgentType),\n capabilities: z.array(z.nativeEnum(AIAgentCapability)).min(1),\n model: z.string().min(1),\n creator: z.string().optional(),\n});\n\nconst BaseProfileSchema = z.object({\n version: z.string().min(1),\n type: z.nativeEnum(ProfileType),\n display_name: z.string().min(1),\n alias: z.string().optional(),\n bio: z.string().optional(),\n socials: z.array(SocialLinkSchema).optional(),\n profileImage: z.string().optional(),\n properties: z.record(z.any()).optional(),\n inboundTopicId: z.string().optional(),\n outboundTopicId: z.string().optional(),\n});\n\nconst PersonalProfileSchema = BaseProfileSchema.extend({\n type: z.literal(ProfileType.PERSONAL),\n language: z.string().optional(),\n timezone: z.string().optional(),\n});\n\nconst AIAgentProfileSchema = BaseProfileSchema.extend({\n type: z.literal(ProfileType.AI_AGENT),\n aiAgent: AIAgentDetailsSchema,\n});\n\nconst HCS11ProfileSchema = z.union([\n PersonalProfileSchema,\n AIAgentProfileSchema,\n]);\n\nexport class HCS11Client {\n private client: Client;\n private auth: HCS11Auth;\n private network: string;\n private logger: Logger;\n private mirrorNode: HederaMirrorNode;\n\n constructor(config: HCS11ClientConfig) {\n this.client =\n config.network === 'mainnet' ? Client.forMainnet() : Client.forTestnet();\n this.auth = config.auth;\n this.network = config.network;\n this.mirrorNode = new HederaMirrorNode(\n this.network as 'mainnet' | 'testnet',\n this.logger\n );\n\n if (this.auth.privateKey) {\n const privateKey = PrivateKey.fromString(this.auth.privateKey);\n this.client.setOperator(this.auth.operatorId, privateKey);\n }\n\n this.logger = Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS-11',\n });\n }\n\n public getClient(): Client {\n return this.client;\n }\n\n public getOperatorId(): string {\n return this.auth.operatorId;\n }\n\n public createPersonalProfile(\n displayName: string,\n options?: {\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n language?: string;\n timezone?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n }\n ): PersonalProfile {\n return {\n version: '1.0',\n type: ProfileType.PERSONAL,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n };\n }\n\n public createAIAgentProfile(\n displayName: string,\n agentType: AIAgentType,\n capabilities: AIAgentCapability[],\n model: string,\n options?: {\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n creator?: string;\n }\n ): AIAgentProfile {\n const validation = this.validateProfile({\n version: '1.0',\n type: ProfileType.AI_AGENT,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n aiAgent: {\n type: agentType,\n capabilities,\n model,\n creator: options?.creator,\n },\n });\n\n if (!validation.valid) {\n throw new Error(\n `Invalid AI Agent Profile: ${validation.errors.join(', ')}`\n );\n }\n\n return {\n version: '1.0',\n type: ProfileType.AI_AGENT,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n aiAgent: {\n type: agentType,\n capabilities,\n model,\n creator: options?.creator,\n },\n };\n }\n\n public validateProfile(profile: unknown): {\n valid: boolean;\n errors: string[];\n } {\n const result = HCS11ProfileSchema.safeParse(profile);\n\n if (result.success) {\n return { valid: true, errors: [] };\n }\n\n const formattedErrors = result.error.errors.map((err: ZodIssue) => {\n const path = err.path.join('.');\n let message = err.message;\n\n if (err.code === 'invalid_type') {\n message = `Expected ${err.expected}, got ${err.received}`;\n } else if (err.code === 'invalid_enum_value') {\n const validOptions = (err as any).options?.join(', ');\n message = `Invalid value. Valid options are: ${validOptions}`;\n } else if (err.code === 'too_small' && err.type === 'string') {\n message = 'Cannot be empty';\n }\n\n return `${path}: ${message}`;\n });\n\n return { valid: false, errors: formattedErrors };\n }\n\n public profileToJSONString(profile: HCS11Profile): string {\n return JSON.stringify(profile);\n }\n\n public parseProfileFromString(profileStr: string): HCS11Profile | null {\n try {\n const parsedProfile = JSON.parse(profileStr);\n const validation = this.validateProfile(parsedProfile);\n if (!validation.valid) {\n this.logger.error('Invalid profile format:', validation.errors);\n return null;\n }\n return parsedProfile as HCS11Profile;\n } catch (error) {\n this.logger.error('Error parsing profile:');\n return null;\n }\n }\n\n public setProfileForAccountMemo(\n topicId: string,\n topicStandard: 1 | 2 | 7 = 1\n ): string {\n return `hcs-11:hcs://${topicStandard}/${topicId}`;\n }\n\n private async executeTransaction<T>(\n transaction: Transaction\n ): Promise<TransactionResult<T>> {\n try {\n if (this.auth.privateKey) {\n const signedTx = await transaction.signWithOperator(this.client);\n const response = await signedTx.execute(this.client);\n const receipt = await response.getReceipt(this.client);\n\n if (receipt.status.toString() !== Status.Success.toString()) {\n return {\n success: false,\n error: `Transaction failed: ${receipt.status.toString()}`,\n };\n }\n\n return {\n success: true,\n result: receipt as T,\n };\n }\n\n if (!this.auth.signer) {\n throw new Error('No valid authentication method provided');\n }\n\n const signer = this.auth.signer;\n const frozenTransaction = await transaction.freezeWithSigner(signer);\n const response = await frozenTransaction.executeWithSigner(signer);\n const receipt = await response.getReceiptWithSigner(signer);\n\n if (receipt.status.toString() !== Status.Success.toString()) {\n return {\n success: false,\n error: `Transaction failed: ${receipt.status.toString()}: ${Status.Success.toString()}`,\n };\n }\n\n return {\n success: true,\n result: receipt as T,\n };\n } catch (error) {\n return {\n success: false,\n error:\n error instanceof Error\n ? error.message\n : 'Unknown error during transaction execution',\n };\n }\n }\n\n public async inscribeImage(\n buffer: Buffer,\n fileName: string,\n options?: InscribeImageOptions\n ): Promise<InscribeImageResponse> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-Image',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Preparing to inscribe image', 0);\n\n const mimeType = mime.lookup(fileName) || 'application/octet-stream';\n\n const waitForConfirmation = options?.waitForConfirmation ?? true;\n\n let inscriptionResponse;\n if (this.auth.signer) {\n if ('accountId' in this.auth.signer) {\n progressReporter.preparing('Using signer for inscription', 10);\n\n inscriptionResponse = await inscribeWithSigner(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n this.auth.signer as DAppSigner,\n {\n network: this.network as 'mainnet' | 'testnet',\n waitForConfirmation,\n waitMaxAttempts: 150,\n waitIntervalMs: 4000,\n logging: {\n level: 'debug',\n },\n progressCallback: (data: any) => {\n const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;\n progressReporter.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n }\n );\n } else {\n progressReporter.failed(\n 'Signer must be a DAppSigner for inscription'\n );\n throw new Error('Signer must be a DAppSigner for inscription');\n }\n } else {\n if (!this.auth.privateKey) {\n progressReporter.failed('Private key is required for inscription');\n this.logger.error('Private key is required for inscription');\n throw new Error('Private key is required for inscription');\n }\n\n progressReporter.preparing('Using private key for inscription', 10);\n\n inscriptionResponse = await inscribe(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n {\n accountId: this.auth.operatorId,\n privateKey: this.auth.privateKey,\n network: this.network as 'mainnet' | 'testnet',\n },\n {\n waitForConfirmation,\n waitMaxAttempts: 150,\n waitIntervalMs: 2000,\n logging: {\n level: 'debug',\n },\n progressCallback: (data: any) => {\n const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;\n progressReporter.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n }\n );\n }\n\n if (inscriptionResponse.confirmed) {\n progressReporter.completed('Image inscription completed', {\n topic_id: inscriptionResponse.inscription.topic_id,\n });\n return {\n imageTopicId: inscriptionResponse.inscription.topic_id || '',\n transactionId: inscriptionResponse.result.jobId,\n success: true,\n };\n } else {\n progressReporter.verifying('Waiting for inscription confirmation', 50, {\n jobId: inscriptionResponse.result.jobId,\n });\n return {\n imageTopicId: '',\n transactionId: inscriptionResponse.result.jobId,\n success: false,\n error: 'Inscription not confirmed',\n };\n }\n } catch (error: any) {\n this.logger.error('Error inscribing image:', error);\n return {\n imageTopicId: '',\n transactionId: '',\n success: false,\n error: error.message || 'Error inscribing image',\n };\n }\n }\n\n public async inscribeProfile(\n profile: HCS11Profile,\n options?: InscribeProfileOptions\n ): Promise<InscribeProfileResponse> {\n this.logger.info('Inscribing HCS-11 profile');\n\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-Profile',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Validating profile data', 5);\n\n const validation = this.validateProfile(profile);\n if (!validation.valid) {\n progressReporter.failed(\n `Invalid profile: ${validation.errors.join(', ')}`\n );\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: `Invalid profile: ${validation.errors.join(', ')}`,\n };\n }\n\n progressReporter.preparing('Formatting profile for inscription', 15);\n\n const profileJson = this.profileToJSONString(profile);\n const fileName = `profile-${profile.display_name\n .toLowerCase()\n .replace(/\\s+/g, '-')}.json`;\n\n try {\n const contentBuffer = Buffer.from(profileJson, 'utf-8');\n const contentType = 'application/json';\n\n progressReporter.preparing('Preparing profile for inscription', 20);\n\n const input: InscriptionInput = {\n type: 'buffer',\n buffer: contentBuffer,\n fileName,\n mimeType: contentType,\n };\n\n const inscriptionOptions: InscriptionOptions = {\n waitForConfirmation: true,\n mode: 'file',\n network: this.network as 'mainnet' | 'testnet',\n waitMaxAttempts: 100,\n waitIntervalMs: 2000,\n progressCallback: (data: any) => {\n const adjustedPercent =\n 20 + Number(data?.progressPercent || 0) * 0.75;\n progressReporter?.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n };\n\n progressReporter.submitting('Submitting profile to Hedera network', 30);\n\n const inscriptionResponse = this.auth.privateKey\n ? await inscribe(\n input,\n {\n accountId: this.auth.operatorId,\n privateKey: this.auth.privateKey,\n network: this.network as 'mainnet' | 'testnet',\n },\n inscriptionOptions\n )\n : await inscribeWithSigner(\n input,\n this.auth.signer as DAppSigner,\n inscriptionOptions\n );\n\n if (\n !inscriptionResponse.confirmed ||\n !inscriptionResponse.inscription.topic_id\n ) {\n progressReporter.failed('Failed to inscribe profile content');\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: 'Failed to inscribe profile content',\n };\n }\n\n const topicId = inscriptionResponse.inscription.topic_id;\n\n progressReporter.completed('Profile inscription completed', {\n topicId,\n transactionId: inscriptionResponse.result.transactionId,\n });\n\n return {\n profileTopicId: topicId,\n transactionId: inscriptionResponse.result.transactionId,\n success: true,\n };\n } catch (error: any) {\n progressReporter.failed(\n `Error inscribing profile: ${error.message || 'Unknown error'}`\n );\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: error.message || 'Unknown error during inscription',\n };\n }\n }\n\n public async updateAccountMemoWithProfile(\n accountId: string | AccountId,\n profileTopicId: string\n ): Promise<TransactionResult> {\n try {\n this.logger.info(\n `Updating account memo for ${accountId} with profile ${profileTopicId}`\n );\n const memo = this.setProfileForAccountMemo(profileTopicId);\n\n const transaction = new AccountUpdateTransaction()\n .setAccountMemo(memo)\n .setAccountId(accountId);\n\n return this.executeTransaction(transaction);\n } catch (error) {\n this.logger.error(\n `Error updating account memo: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`\n );\n return {\n success: false,\n error:\n error instanceof Error\n ? error.message\n : 'Unknown error updating account memo',\n };\n }\n }\n\n /**\n * Creates and inscribes a profile.\n *\n * @param profile - The profile to create and inscribe.\n * @param updateAccountMemo - Whether to update the account memo with the profile.\n * @param options - Optional configuration options.\n * @returns A promise that resolves to the inscription result.\n */\n public async createAndInscribeProfile(\n profile: HCS11Profile,\n updateAccountMemo = true,\n options?: InscribeProfileOptions\n ): Promise<InscribeProfileResponse> {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-ProfileCreation',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Starting profile creation process', 0);\n\n const inscriptionProgress = progressReporter.createSubProgress({\n minPercent: 0,\n maxPercent: 80,\n logPrefix: 'Inscription',\n });\n\n const inscriptionResult = await this.inscribeProfile(profile, {\n ...options,\n progressCallback: (data: any) => {\n inscriptionProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent,\n details: data.details,\n });\n },\n });\n\n if (!inscriptionResult?.success) {\n progressReporter.failed('Profile inscription failed', {\n error: inscriptionResult?.error,\n });\n return inscriptionResult;\n }\n\n progressReporter.confirming('Profile inscribed, updating account memo', 85);\n\n if (updateAccountMemo) {\n const memoResult = await this.updateAccountMemoWithProfile(\n this.auth.operatorId,\n inscriptionResult.profileTopicId\n );\n\n if (!memoResult.success) {\n progressReporter.failed('Failed to update account memo', {\n error: memoResult?.error,\n });\n return {\n ...inscriptionResult,\n success: false,\n error: memoResult?.error,\n };\n }\n }\n\n progressReporter.completed('Profile creation completed successfully', {\n profileTopicId: inscriptionResult.profileTopicId,\n transactionId: inscriptionResult.transactionId,\n });\n\n return inscriptionResult;\n }\n\n /**\n * Gets the capabilities from the capability names.\n *\n * @param capabilityNames - The capability names to get the capabilities for.\n * @returns The capabilities.\n */\n public async getCapabilitiesFromTags(\n capabilityNames: string[]\n ): Promise<number[]> {\n const capabilities: number[] = [];\n\n if (capabilityNames.length === 0) {\n return [AIAgentCapability.TEXT_GENERATION];\n }\n\n for (const capabilityName of capabilityNames) {\n const capability =\n capabilityNameToCapabilityMap[capabilityName.toLowerCase()];\n if (capability !== undefined && !capabilities.includes(capability)) {\n capabilities.push(capability);\n }\n }\n\n if (capabilities.length === 0) {\n capabilities.push(AIAgentCapability.TEXT_GENERATION);\n }\n\n return capabilities;\n }\n\n /**\n * Gets the agent type from the metadata.\n *\n * @param metadata - The metadata of the agent.\n * @returns The agent type.\n */\n public getAgentTypeFromMetadata(metadata: AgentMetadata): AIAgentType {\n if (metadata.type === 'autonomous') {\n return AIAgentType.AUTONOMOUS;\n } else {\n return AIAgentType.MANUAL;\n }\n }\n\n /**\n * Fetches a profile from the account memo.\n *\n * @param accountId - The account ID of the agent to fetch the profile for.\n * @param network - The network to use for the fetch.\n * @returns A promise that resolves to the profile.\n */\n public async fetchProfileByAccountId(\n accountId: string | AccountId,\n network?: string\n ): Promise<{\n success: boolean;\n profile?: HCS11Profile;\n error?: string;\n topicInfo?: TopicInfo;\n }> {\n try {\n this.logger.info(\n `Fetching profile for account ${accountId.toString()} on ${\n this.network\n }`\n );\n\n const memo = await this.mirrorNode.getAccountMemo(accountId.toString());\n\n this.logger.info(`Got account memo: ${memo}`);\n\n if (!memo?.startsWith('hcs-11:')) {\n return {\n success: false,\n error: `Account ${accountId.toString()} does not have a valid HCS-11 memo`,\n };\n }\n\n this.logger.info(`Found HCS-11 memo: ${memo}`);\n\n const protocolReference = memo.substring(7);\n\n if (protocolReference?.startsWith('hcs://')) {\n const hcsFormat = protocolReference.match(/hcs:\\/\\/(\\d+)\\/(.+)/);\n\n if (!hcsFormat) {\n return {\n success: false,\n error: `Invalid HCS protocol reference format: ${protocolReference}`,\n };\n }\n\n const [_, protocolId, profileTopicId] = hcsFormat;\n const networkParam = network || this.network || 'mainnet';\n\n this.logger.info(\n `Retrieving profile from Kiloscribe CDN: ${profileTopicId}`\n );\n const cdnUrl = `https://kiloscribe.com/api/inscription-cdn/${profileTopicId}?network=${networkParam}`;\n\n try {\n const response = await fetch(cdnUrl);\n\n if (!response.ok) {\n return {\n success: false,\n error: `Failed to fetch profile from Kiloscribe CDN: ${response.statusText}`,\n };\n }\n\n const profileData = await response.json();\n\n if (!profileData) {\n return {\n success: false,\n error: `No profile data found for topic ${profileTopicId}`,\n };\n }\n\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId,\n },\n };\n } catch (cdnError: any) {\n this.logger.error(\n `Error retrieving from Kiloscribe CDN: ${cdnError.message}`\n );\n return {\n success: false,\n error: `Error retrieving from Kiloscribe CDN: ${cdnError.message}`,\n };\n }\n } else if (protocolReference.startsWith('ipfs://')) {\n this.logger.warn('IPFS protocol references are not fully supported');\n const response = await fetch(\n `https://ipfs.io/ipfs/${protocolReference.replace('ipfs://', '')}`\n );\n const profileData = await response.json();\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId: profileData.profileTopicId,\n },\n };\n } else if (protocolReference.startsWith('ar://')) {\n const arTxId = protocolReference.replace('ar://', '');\n const response = await fetch(`https://arweave.net/${arTxId}`);\n\n if (!response.ok) {\n return {\n success: false,\n error: `Failed to fetch profile from Arweave ${arTxId}: ${response.statusText}`,\n };\n }\n\n const profileData = await response.json();\n\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId: profileData.profileTopicId,\n },\n };\n } else {\n return {\n success: false,\n error: `Invalid protocol reference format: ${protocolReference}`,\n };\n }\n } catch (error: any) {\n this.logger.error(`Error fetching profile: ${error.message}`);\n return {\n success: false,\n error: `Error fetching profile: ${error.message}`,\n };\n }\n }\n}\n"],"names":["response","receipt"],"mappings":";;;;;;;;;AAwCA,MAAM,mBAAmB,EAAE,OAAO;AAAA,EAChC,UAAU,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC;AAC1B,CAAC;AAED,MAAM,uBAAuB,EAAE,OAAO;AAAA,EACpC,MAAM,EAAE,WAAW,WAAW;AAAA,EAC9B,cAAc,EAAE,MAAM,EAAE,WAAW,iBAAiB,CAAC,EAAE,IAAI,CAAC;AAAA,EAC5D,OAAO,EAAE,SAAS,IAAI,CAAC;AAAA,EACvB,SAAS,EAAE,OAAO,EAAE,SAAS;AAC/B,CAAC;AAED,MAAM,oBAAoB,EAAE,OAAO;AAAA,EACjC,SAAS,EAAE,SA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AAW,OAAO,GAAG;AAChD,cAAM,SAAS,kBAAkB,QAAQ,SAAS,EAAE;AACpD,cAAM,WAAW,MAAM,MAAM,uBAAuB,MAAM,EAAE;AAExD,YAAA,CAAC,SAAS,IAAI;AACT,iBAAA;AAAA,YACL,SAAS;AAAA,YACT,OAAO,wCAAwC,MAAM,KAAK,SAAS,UAAU;AAAA,UAC/E;AAAA,QAAA;AAGI,cAAA,cAAc,MAAM,SAAS,KAAK;AAEjC,eAAA;AAAA,UACL,SAAS;AAAA,UACT,SAAS;AAAA,UACT,WAAW;AAAA,YACT,cAAc,YAAY;AAAA,YAC1B,eAAe,YAAY;AAAA,YAC3B,gBAAgB,YAAY;AAAA,UAAA;AAAA,QAEhC;AAAA,MAAA,OACK;AACE,eAAA;AAAA,UACL,SAAS;AAAA,UACT,OAAO,sCAAsC,iBAAiB;AAAA,QAChE;AAAA,MAAA;AAAA,aAEK,OAAY;AACnB,WAAK,OAAO,MAAM,2BAA2B,MAAM,OAAO,EAAE;AACrD,aAAA;AAAA,QACL,SAAS;AAAA,QACT,OAAO,2BAA2B,MAAM,OAAO;AAAA,MACjD;AAAA,IAAA;AAAA,EACF;AAEJ;"}
1
+ {"version":3,"file":"standards-sdk.es13.js","sources":["../../src/hcs-11/client.ts"],"sourcesContent":["import {\n AccountId,\n AccountUpdateTransaction,\n Client,\n PrivateKey,\n Status,\n Transaction,\n} from '@hashgraph/sdk';\nimport {\n inscribe,\n inscribeWithSigner,\n InscriptionInput,\n InscriptionOptions,\n} from '../inscribe';\nimport { Logger } from '../utils/logger';\nimport * as mime from 'mime-types';\nimport { z, ZodIssue } from 'zod';\nimport type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport { ProgressReporter } from '../utils/progress-reporter';\nimport { HederaMirrorNode } from '../services';\nimport { TopicInfo } from '../services/types';\nimport {\n ProfileType,\n AIAgentType,\n AIAgentCapability,\n SocialLink,\n PersonalProfile,\n AIAgentProfile,\n HCS11Profile,\n HCS11Auth,\n HCS11ClientConfig,\n TransactionResult,\n InscribeProfileResponse,\n InscribeImageResponse,\n AgentMetadata,\n InscribeImageOptions,\n InscribeProfileOptions,\n capabilityNameToCapabilityMap,\n} from './types';\n\nconst SocialLinkSchema = z.object({\n platform: z.string().min(1),\n handle: z.string().min(1),\n});\n\nconst AIAgentDetailsSchema = z.object({\n type: z.nativeEnum(AIAgentType),\n capabilities: z.array(z.nativeEnum(AIAgentCapability)).min(1),\n model: z.string().min(1),\n creator: z.string().optional(),\n});\n\nconst BaseProfileSchema = z.object({\n version: z.string().min(1),\n type: z.nativeEnum(ProfileType),\n display_name: z.string().min(1),\n alias: z.string().optional(),\n bio: z.string().optional(),\n socials: z.array(SocialLinkSchema).optional(),\n profileImage: z.string().optional(),\n properties: z.record(z.any()).optional(),\n inboundTopicId: z.string().optional(),\n outboundTopicId: z.string().optional(),\n});\n\nconst PersonalProfileSchema = BaseProfileSchema.extend({\n type: z.literal(ProfileType.PERSONAL),\n language: z.string().optional(),\n timezone: z.string().optional(),\n});\n\nconst AIAgentProfileSchema = BaseProfileSchema.extend({\n type: z.literal(ProfileType.AI_AGENT),\n aiAgent: AIAgentDetailsSchema,\n});\n\nconst HCS11ProfileSchema = z.union([\n PersonalProfileSchema,\n AIAgentProfileSchema,\n]);\n\nexport class HCS11Client {\n private client: Client;\n private auth: HCS11Auth;\n private network: string;\n private logger: Logger;\n private mirrorNode: HederaMirrorNode;\n\n constructor(config: HCS11ClientConfig) {\n this.client =\n config.network === 'mainnet' ? Client.forMainnet() : Client.forTestnet();\n this.auth = config.auth;\n this.network = config.network;\n this.mirrorNode = new HederaMirrorNode(\n this.network as 'mainnet' | 'testnet',\n this.logger\n );\n\n if (this.auth.privateKey) {\n const privateKey = PrivateKey.fromString(this.auth.privateKey);\n this.client.setOperator(this.auth.operatorId, privateKey);\n }\n\n this.logger = Logger.getInstance({\n level: config.logLevel || 'info',\n module: 'HCS-11',\n });\n }\n\n public getClient(): Client {\n return this.client;\n }\n\n public getOperatorId(): string {\n return this.auth.operatorId;\n }\n\n public createPersonalProfile(\n displayName: string,\n options?: {\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n language?: string;\n timezone?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n }\n ): PersonalProfile {\n return {\n version: '1.0',\n type: ProfileType.PERSONAL,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n };\n }\n\n public createAIAgentProfile(\n displayName: string,\n agentType: AIAgentType,\n capabilities: AIAgentCapability[],\n model: string,\n options?: {\n alias?: string;\n bio?: string;\n socials?: SocialLink[];\n profileImage?: string;\n properties?: Record<string, any>;\n inboundTopicId?: string;\n outboundTopicId?: string;\n creator?: string;\n }\n ): AIAgentProfile {\n const validation = this.validateProfile({\n version: '1.0',\n type: ProfileType.AI_AGENT,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n aiAgent: {\n type: agentType,\n capabilities,\n model,\n creator: options?.creator,\n },\n });\n\n if (!validation.valid) {\n throw new Error(\n `Invalid AI Agent Profile: ${validation.errors.join(', ')}`\n );\n }\n\n return {\n version: '1.0',\n type: ProfileType.AI_AGENT,\n display_name: displayName,\n alias: options?.alias,\n bio: options?.bio,\n socials: options?.socials,\n profileImage: options?.profileImage,\n properties: options?.properties,\n inboundTopicId: options?.inboundTopicId,\n outboundTopicId: options?.outboundTopicId,\n aiAgent: {\n type: agentType,\n capabilities,\n model,\n creator: options?.creator,\n },\n };\n }\n\n public validateProfile(profile: unknown): {\n valid: boolean;\n errors: string[];\n } {\n const result = HCS11ProfileSchema.safeParse(profile);\n\n if (result.success) {\n return { valid: true, errors: [] };\n }\n\n const formattedErrors = result.error.errors.map((err: ZodIssue) => {\n const path = err.path.join('.');\n let message = err.message;\n\n if (err.code === 'invalid_type') {\n message = `Expected ${err.expected}, got ${err.received}`;\n } else if (err.code === 'invalid_enum_value') {\n const validOptions = (err as any).options?.join(', ');\n message = `Invalid value. Valid options are: ${validOptions}`;\n } else if (err.code === 'too_small' && err.type === 'string') {\n message = 'Cannot be empty';\n }\n\n return `${path}: ${message}`;\n });\n\n return { valid: false, errors: formattedErrors };\n }\n\n public profileToJSONString(profile: HCS11Profile): string {\n return JSON.stringify(profile);\n }\n\n public parseProfileFromString(profileStr: string): HCS11Profile | null {\n try {\n const parsedProfile = JSON.parse(profileStr);\n const validation = this.validateProfile(parsedProfile);\n if (!validation.valid) {\n this.logger.error('Invalid profile format:', validation.errors);\n return null;\n }\n return parsedProfile as HCS11Profile;\n } catch (error) {\n this.logger.error('Error parsing profile:');\n return null;\n }\n }\n\n public setProfileForAccountMemo(\n topicId: string,\n topicStandard: 1 | 2 | 7 = 1\n ): string {\n return `hcs-11:hcs://${topicStandard}/${topicId}`;\n }\n\n private async executeTransaction<T>(\n transaction: Transaction\n ): Promise<TransactionResult<T>> {\n try {\n if (this.auth.privateKey) {\n const signedTx = await transaction.signWithOperator(this.client);\n const response = await signedTx.execute(this.client);\n const receipt = await response.getReceipt(this.client);\n\n if (receipt.status.toString() !== Status.Success.toString()) {\n return {\n success: false,\n error: `Transaction failed: ${receipt.status.toString()}`,\n };\n }\n\n return {\n success: true,\n result: receipt as T,\n };\n }\n\n if (!this.auth.signer) {\n throw new Error('No valid authentication method provided');\n }\n\n const signer = this.auth.signer;\n const frozenTransaction = await transaction.freezeWithSigner(signer);\n const response = await frozenTransaction.executeWithSigner(signer);\n const receipt = await response.getReceiptWithSigner(signer);\n\n if (receipt.status.toString() !== Status.Success.toString()) {\n return {\n success: false,\n error: `Transaction failed: ${receipt.status.toString()}: ${Status.Success.toString()}`,\n };\n }\n\n return {\n success: true,\n result: receipt as T,\n };\n } catch (error) {\n return {\n success: false,\n error:\n error instanceof Error\n ? error.message\n : 'Unknown error during transaction execution',\n };\n }\n }\n\n public async inscribeImage(\n buffer: Buffer,\n fileName: string,\n options?: InscribeImageOptions\n ): Promise<InscribeImageResponse> {\n try {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-Image',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Preparing to inscribe image', 0);\n\n const mimeType = mime.lookup(fileName) || 'application/octet-stream';\n\n const waitForConfirmation = options?.waitForConfirmation ?? true;\n\n let inscriptionResponse;\n if (this.auth.signer) {\n if ('accountId' in this.auth.signer) {\n progressReporter.preparing('Using signer for inscription', 10);\n\n inscriptionResponse = await inscribeWithSigner(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n this.auth.signer as DAppSigner,\n {\n network: this.network as 'mainnet' | 'testnet',\n waitForConfirmation,\n waitMaxAttempts: 150,\n waitIntervalMs: 4000,\n logging: {\n level: 'debug',\n },\n progressCallback: (data: any) => {\n const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;\n progressReporter.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n }\n );\n } else {\n progressReporter.failed(\n 'Signer must be a DAppSigner for inscription'\n );\n throw new Error('Signer must be a DAppSigner for inscription');\n }\n } else {\n if (!this.auth.privateKey) {\n progressReporter.failed('Private key is required for inscription');\n this.logger.error('Private key is required for inscription');\n throw new Error('Private key is required for inscription');\n }\n\n progressReporter.preparing('Using private key for inscription', 10);\n\n inscriptionResponse = await inscribe(\n {\n type: 'buffer',\n buffer,\n fileName,\n mimeType,\n },\n {\n accountId: this.auth.operatorId,\n privateKey: this.auth.privateKey,\n network: this.network as 'mainnet' | 'testnet',\n },\n {\n waitForConfirmation,\n waitMaxAttempts: 150,\n waitIntervalMs: 2000,\n logging: {\n level: 'debug',\n },\n progressCallback: (data: any) => {\n const adjustedPercent = 10 + (data.progressPercent || 0) * 0.8;\n progressReporter.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n }\n );\n }\n\n if (inscriptionResponse.confirmed) {\n progressReporter.completed('Image inscription completed', {\n topic_id: inscriptionResponse.inscription.topic_id,\n });\n return {\n imageTopicId: inscriptionResponse.inscription.topic_id || '',\n transactionId: inscriptionResponse.result.jobId,\n success: true,\n };\n } else {\n progressReporter.verifying('Waiting for inscription confirmation', 50, {\n jobId: inscriptionResponse.result.jobId,\n });\n return {\n imageTopicId: '',\n transactionId: inscriptionResponse.result.jobId,\n success: false,\n error: 'Inscription not confirmed',\n };\n }\n } catch (error: any) {\n this.logger.error('Error inscribing image:', error);\n return {\n imageTopicId: '',\n transactionId: '',\n success: false,\n error: error.message || 'Error inscribing image',\n };\n }\n }\n\n public async inscribeProfile(\n profile: HCS11Profile,\n options?: InscribeProfileOptions\n ): Promise<InscribeProfileResponse> {\n this.logger.info('Inscribing HCS-11 profile');\n\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-Profile',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Validating profile data', 5);\n\n const validation = this.validateProfile(profile);\n if (!validation.valid) {\n progressReporter.failed(\n `Invalid profile: ${validation.errors.join(', ')}`\n );\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: `Invalid profile: ${validation.errors.join(', ')}`,\n };\n }\n\n progressReporter.preparing('Formatting profile for inscription', 15);\n\n const profileJson = this.profileToJSONString(profile);\n const fileName = `profile-${profile.display_name\n .toLowerCase()\n .replace(/\\s+/g, '-')}.json`;\n\n try {\n const contentBuffer = Buffer.from(profileJson, 'utf-8');\n const contentType = 'application/json';\n\n progressReporter.preparing('Preparing profile for inscription', 20);\n\n const input: InscriptionInput = {\n type: 'buffer',\n buffer: contentBuffer,\n fileName,\n mimeType: contentType,\n };\n\n const inscriptionOptions: InscriptionOptions = {\n waitForConfirmation: true,\n mode: 'file',\n network: this.network as 'mainnet' | 'testnet',\n waitMaxAttempts: 100,\n waitIntervalMs: 2000,\n progressCallback: (data: any) => {\n const adjustedPercent =\n 20 + Number(data?.progressPercent || 0) * 0.75;\n progressReporter?.report({\n stage: data.stage,\n message: data.message,\n progressPercent: adjustedPercent,\n details: data.details,\n });\n },\n };\n\n progressReporter.submitting('Submitting profile to Hedera network', 30);\n\n const inscriptionResponse = this.auth.privateKey\n ? await inscribe(\n input,\n {\n accountId: this.auth.operatorId,\n privateKey: this.auth.privateKey,\n network: this.network as 'mainnet' | 'testnet',\n },\n inscriptionOptions\n )\n : await inscribeWithSigner(\n input,\n this.auth.signer as DAppSigner,\n inscriptionOptions\n );\n\n if (\n !inscriptionResponse.confirmed ||\n !inscriptionResponse.inscription.topic_id\n ) {\n progressReporter.failed('Failed to inscribe profile content');\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: 'Failed to inscribe profile content',\n };\n }\n\n const topicId = inscriptionResponse.inscription.topic_id;\n\n progressReporter.completed('Profile inscription completed', {\n topicId,\n transactionId: inscriptionResponse.result.transactionId,\n });\n\n return {\n profileTopicId: topicId,\n transactionId: inscriptionResponse.result.transactionId,\n success: true,\n };\n } catch (error: any) {\n progressReporter.failed(\n `Error inscribing profile: ${error.message || 'Unknown error'}`\n );\n return {\n profileTopicId: '',\n transactionId: '',\n success: false,\n error: error.message || 'Unknown error during inscription',\n };\n }\n }\n\n public async updateAccountMemoWithProfile(\n accountId: string | AccountId,\n profileTopicId: string\n ): Promise<TransactionResult> {\n try {\n this.logger.info(\n `Updating account memo for ${accountId} with profile ${profileTopicId}`\n );\n const memo = this.setProfileForAccountMemo(profileTopicId);\n\n const transaction = new AccountUpdateTransaction()\n .setAccountMemo(memo)\n .setAccountId(accountId);\n\n return this.executeTransaction(transaction);\n } catch (error) {\n this.logger.error(\n `Error updating account memo: ${\n error instanceof Error ? error.message : 'Unknown error'\n }`\n );\n return {\n success: false,\n error:\n error instanceof Error\n ? error.message\n : 'Unknown error updating account memo',\n };\n }\n }\n\n /**\n * Creates and inscribes a profile.\n *\n * @param profile - The profile to create and inscribe.\n * @param updateAccountMemo - Whether to update the account memo with the profile.\n * @param options - Optional configuration options.\n * @returns A promise that resolves to the inscription result.\n */\n public async createAndInscribeProfile(\n profile: HCS11Profile,\n updateAccountMemo = true,\n options?: InscribeProfileOptions\n ): Promise<InscribeProfileResponse> {\n const progressCallback = options?.progressCallback;\n const progressReporter = new ProgressReporter({\n module: 'HCS11-ProfileCreation',\n logger: this.logger,\n callback: progressCallback as any,\n });\n\n progressReporter.preparing('Starting profile creation process', 0);\n\n const inscriptionProgress = progressReporter.createSubProgress({\n minPercent: 0,\n maxPercent: 80,\n logPrefix: 'Inscription',\n });\n\n const inscriptionResult = await this.inscribeProfile(profile, {\n ...options,\n progressCallback: (data: any) => {\n inscriptionProgress.report({\n stage: data.stage,\n message: data.message,\n progressPercent: data.progressPercent,\n details: data.details,\n });\n },\n });\n\n if (!inscriptionResult?.success) {\n progressReporter.failed('Profile inscription failed', {\n error: inscriptionResult?.error,\n });\n return inscriptionResult;\n }\n\n progressReporter.confirming('Profile inscribed, updating account memo', 85);\n\n if (updateAccountMemo) {\n const memoResult = await this.updateAccountMemoWithProfile(\n this.auth.operatorId,\n inscriptionResult.profileTopicId\n );\n\n if (!memoResult.success) {\n progressReporter.failed('Failed to update account memo', {\n error: memoResult?.error,\n });\n return {\n ...inscriptionResult,\n success: false,\n error: memoResult?.error,\n };\n }\n }\n\n progressReporter.completed('Profile creation completed successfully', {\n profileTopicId: inscriptionResult.profileTopicId,\n transactionId: inscriptionResult.transactionId,\n });\n\n return inscriptionResult;\n }\n\n /**\n * Gets the capabilities from the capability names.\n *\n * @param capabilityNames - The capability names to get the capabilities for.\n * @returns The capabilities.\n */\n public async getCapabilitiesFromTags(\n capabilityNames: string[]\n ): Promise<number[]> {\n const capabilities: number[] = [];\n\n if (capabilityNames.length === 0) {\n return [AIAgentCapability.TEXT_GENERATION];\n }\n\n for (const capabilityName of capabilityNames) {\n const capability =\n capabilityNameToCapabilityMap[capabilityName.toLowerCase()];\n if (capability !== undefined && !capabilities.includes(capability)) {\n capabilities.push(capability);\n }\n }\n\n if (capabilities.length === 0) {\n capabilities.push(AIAgentCapability.TEXT_GENERATION);\n }\n\n return capabilities;\n }\n\n /**\n * Gets the agent type from the metadata.\n *\n * @param metadata - The metadata of the agent.\n * @returns The agent type.\n */\n public getAgentTypeFromMetadata(metadata: AgentMetadata): AIAgentType {\n if (metadata.type === 'autonomous') {\n return AIAgentType.AUTONOMOUS;\n } else {\n return AIAgentType.MANUAL;\n }\n }\n\n /**\n * Fetches a profile from the account memo.\n *\n * @param accountId - The account ID of the agent to fetch the profile for.\n * @param network - The network to use for the fetch.\n * @returns A promise that resolves to the profile.\n */\n public async fetchProfileByAccountId(\n accountId: string | AccountId,\n network?: string\n ): Promise<{\n success: boolean;\n profile?: HCS11Profile;\n error?: string;\n topicInfo?: TopicInfo;\n }> {\n try {\n this.logger.info(\n `Fetching profile for account ${accountId.toString()} on ${\n this.network\n }`\n );\n\n const memo = await this.mirrorNode.getAccountMemo(accountId.toString());\n\n this.logger.info(`Got account memo: ${memo}`);\n\n if (!memo?.startsWith('hcs-11:')) {\n return {\n success: false,\n error: `Account ${accountId.toString()} does not have a valid HCS-11 memo`,\n };\n }\n\n this.logger.info(`Found HCS-11 memo: ${memo}`);\n\n const protocolReference = memo.substring(7);\n\n if (protocolReference?.startsWith('hcs://')) {\n const hcsFormat = protocolReference.match(/hcs:\\/\\/(\\d+)\\/(.+)/);\n\n if (!hcsFormat) {\n return {\n success: false,\n error: `Invalid HCS protocol reference format: ${protocolReference}`,\n };\n }\n\n const [_, protocolId, profileTopicId] = hcsFormat;\n const networkParam = network || this.network || 'mainnet';\n\n this.logger.info(\n `Retrieving profile from Kiloscribe CDN: ${profileTopicId}`\n );\n const cdnUrl = `https://kiloscribe.com/api/inscription-cdn/${profileTopicId}?network=${networkParam}`;\n\n try {\n const response = await fetch(cdnUrl);\n\n if (!response.ok) {\n return {\n success: false,\n error: `Failed to fetch profile from Kiloscribe CDN: ${response.statusText}`,\n };\n }\n\n const profileData = await response.json();\n\n if (!profileData) {\n return {\n success: false,\n error: `No profile data found for topic ${profileTopicId}`,\n };\n }\n\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId,\n },\n };\n } catch (cdnError: any) {\n this.logger.error(\n `Error retrieving from Kiloscribe CDN: ${cdnError.message}`\n );\n return {\n success: false,\n error: `Error retrieving from Kiloscribe CDN: ${cdnError.message}`,\n };\n }\n } else if (protocolReference.startsWith('ipfs://')) {\n this.logger.warn('IPFS protocol references are not fully supported');\n const response = await fetch(\n `https://ipfs.io/ipfs/${protocolReference.replace('ipfs://', '')}`\n );\n const profileData = await response.json();\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId: profileData.profileTopicId,\n },\n };\n } else if (protocolReference.startsWith('ar://')) {\n const arTxId = protocolReference.replace('ar://', '');\n const response = await fetch(`https://arweave.net/${arTxId}`);\n\n if (!response.ok) {\n return {\n success: false,\n error: `Failed to fetch profile from Arweave ${arTxId}: ${response.statusText}`,\n };\n }\n\n const profileData = await response.json();\n\n return {\n success: true,\n profile: profileData,\n topicInfo: {\n inboundTopic: profileData.inboundTopicId,\n outboundTopic: profileData.outboundTopicId,\n profileTopicId: profileData.profileTopicId,\n },\n };\n } else {\n return {\n success: false,\n error: `Invalid protocol reference format: ${protocolReference}`,\n };\n }\n } catch (error: any) {\n this.logger.error(`Error fetching profile: ${error.message}`);\n return {\n success: false,\n error: `Error fetching profile: ${error.message}`,\n };\n }\n }\n}\n"],"names":["response","receipt"],"mappings":";;;;;;;;AAwCA,MAAM,mBAAmB,EAAE,OAAO;AAAA,EAChC,UAAU,EAAE,SAAS,IAAI,CAAC;AAAA,EAC1B,QAAQ,EAAE,OAAO,EAAE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K,kDAAkD;AACnE,cAAM,WAAW,MAAM;AAAA,UACrB,wBAAwB,kBAAkB,QAAQ,WAAW,EAAE,CAAC;AAAA,QAClE;AACM,cAAA,cAAc,MAAM,SAAS,KAAK;AACjC,eAAA;AAAA,UACL,SAAS;AAAA,UACT,SAAS;AAAA,UACT,WAAW;AAAA,YACT,cAAc,YAAY;AAAA,YAC1B,eAAe,YAAY;AAAA,YAC3B,gBAAgB,YAAY;AAAA,UAAA;AAAA,QAEhC;AAAA,MACS,WAAA,kBAAkB,WAAW,OAAO,GAAG;AAChD,cAAM,SAAS,kBAAkB,QAAQ,SAAS,EAAE;AACpD,cAAM,WAAW,MAAM,MAAM,uBAAuB,MAAM,EAAE;AAExD,YAAA,CAAC,SAAS,IAAI;AACT,iBAAA;AAAA,YACL,SAAS;AAAA,YACT,OAAO,wCAAwC,MAAM,KAAK,SAAS,UAAU;AAAA,UAC/E;AAAA,QAAA;AAGI,cAAA,cAAc,MAAM,SAAS,KAAK;AAEjC,eAAA;AAAA,UACL,SAAS;AAAA,UACT,SAAS;AAAA,UACT,WAAW;AAAA,YACT,cAAc,YAAY;AAAA,YAC1B,eAAe,YAAY;AAAA,YAC3B,gBAAgB,YAAY;AAAA,UAAA;AAAA,QAEhC;AAAA,MAAA,OACK;AACE,eAAA;AAAA,UACL,SAAS;AAAA,UACT,OAAO,sCAAsC,iBAAiB;AAAA,QAChE;AAAA,MAAA;AAAA,aAEK,OAAY;AACnB,WAAK,OAAO,MAAM,2BAA2B,MAAM,OAAO,EAAE;AACrD,aAAA;AAAA,QACL,SAAS;AAAA,QACT,OAAO,2BAA2B,MAAM,OAAO;AAAA,MACjD;AAAA,IAAA;AAAA,EACF;AAEJ;"}
@@ -2,12 +2,12 @@ import { proto } from "@hashgraph/proto";
2
2
  import { Buffer } from "buffer";
3
3
  import { Hbar, Long, HbarUnit } from "@hashgraph/sdk";
4
4
  import { ethers } from "ethers";
5
- import { HTSParser } from "./standards-sdk.es26.js";
6
- import { HCSParser } from "./standards-sdk.es27.js";
7
- import { FileParser } from "./standards-sdk.es28.js";
8
- import { CryptoParser } from "./standards-sdk.es29.js";
9
- import { SCSParser } from "./standards-sdk.es30.js";
10
- import { UtilParser } from "./standards-sdk.es31.js";
5
+ import { HTSParser } from "./standards-sdk.es24.js";
6
+ import { HCSParser } from "./standards-sdk.es25.js";
7
+ import { FileParser } from "./standards-sdk.es26.js";
8
+ import { CryptoParser } from "./standards-sdk.es27.js";
9
+ import { SCSParser } from "./standards-sdk.es28.js";
10
+ import { UtilParser } from "./standards-sdk.es29.js";
11
11
  class TransactionParser {
12
12
  /**
13
13
  * Parse a base64 encoded transaction body and return structured data
@@ -1,5 +1,4 @@
1
- import Buffer from "vite-plugin-node-polyfills/shims/buffer";
2
- import { I as InscriptionSDK } from "./standards-sdk.es24.js";
1
+ import { I as InscriptionSDK } from "./standards-sdk.es30.js";
3
2
  import { Logger } from "./standards-sdk.es15.js";
4
3
  import { ProgressReporter } from "./standards-sdk.es17.js";
5
4
  async function inscribe(input, clientConfig, options, existingSDK) {
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es20.js","sources":["../../src/inscribe/inscriber.ts"],"sourcesContent":["import { InscriptionSDK } from '@kiloscribe/inscription-sdk';\nimport {\n InscriptionOptions,\n InscriptionResult,\n RetrievedInscriptionResult,\n HederaClientConfig,\n} from './types';\nimport type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport { Logger } from '../utils/logger';\nimport { ProgressCallback, ProgressReporter } from '../utils/progress-reporter';\n\nexport type InscriptionInput =\n | { type: 'url'; url: string }\n | { type: 'file'; path: string }\n | {\n type: 'buffer';\n buffer: ArrayBuffer | Buffer;\n fileName: string;\n mimeType?: string;\n };\n\nexport type InscriptionResponse =\n | { confirmed: false; result: InscriptionResult; sdk: InscriptionSDK }\n | {\n confirmed: true;\n result: InscriptionResult;\n inscription: RetrievedInscriptionResult;\n sdk: InscriptionSDK;\n };\n\nexport async function inscribe(\n input: InscriptionInput,\n clientConfig: HederaClientConfig,\n options: InscriptionOptions,\n existingSDK?: InscriptionSDK\n): Promise<InscriptionResponse> {\n const logger = Logger.getInstance({\n module: 'Inscriber',\n ...options.logging,\n });\n\n logger.info('Starting inscription process', {\n type: input.type,\n mode: options.mode || 'file',\n ...(input.type === 'url' ? { url: input.url } : {}),\n ...(input.type === 'file' ? { path: input.path } : {}),\n ...(input.type === 'buffer'\n ? { fileName: input.fileName, bufferSize: input.buffer.byteLength }\n : {}),\n });\n\n try {\n if (options.mode === 'hashinal' && options.metadata) {\n validateHashinalMetadata(options.metadata, logger);\n }\n\n let sdk: InscriptionSDK;\n\n if (existingSDK) {\n logger.debug('Using existing InscriptionSDK instance');\n sdk = existingSDK;\n } else if (options.apiKey) {\n logger.debug('Initializing InscriptionSDK with API key');\n sdk = new InscriptionSDK({\n apiKey: options.apiKey,\n network: clientConfig.network || 'mainnet',\n });\n } else {\n logger.debug('Initializing InscriptionSDK with server auth');\n sdk = await InscriptionSDK.createWithAuth({\n type: 'server',\n accountId: clientConfig.accountId,\n privateKey: clientConfig.privateKey,\n network: clientConfig.network || 'mainnet',\n });\n }\n\n const baseRequest = {\n holderId: clientConfig.accountId,\n metadata: options.metadata || {},\n tags: options.tags || [],\n mode: options.mode || 'file',\n chunkSize: options.chunkSize,\n };\n\n let request: any;\n switch (input.type) {\n case 'url':\n request = {\n ...baseRequest,\n file: {\n type: 'url',\n url: input.url,\n },\n };\n break;\n\n case 'file':\n request = {\n ...baseRequest,\n file: {\n type: 'path',\n path: input.path,\n },\n };\n break;\n\n case 'buffer':\n request = {\n ...baseRequest,\n file: {\n type: 'base64',\n base64: Buffer.from(input.buffer).toString('base64'),\n fileName: input.fileName,\n mimeType: input.mimeType,\n },\n };\n break;\n }\n\n if (options.mode === 'hashinal') {\n request.metadataObject = options.metadata;\n request.creator = options.metadata?.creator || clientConfig.accountId;\n request.description = options.metadata?.description;\n\n if (options.jsonFileURL) {\n request.jsonFileURL = options.jsonFileURL;\n }\n }\n\n logger.debug('Preparing to inscribe content', {\n type: input.type,\n mode: options.mode || 'file',\n holderId: clientConfig.accountId,\n });\n\n const result = await sdk.inscribeAndExecute(request, clientConfig);\n logger.info('Starting to inscribe.', {\n type: input.type,\n mode: options.mode || 'file',\n transactionId: result.jobId,\n });\n\n if (options.waitForConfirmation) {\n logger.debug('Waiting for inscription confirmation', {\n transactionId: result.jobId,\n maxAttempts: options.waitMaxAttempts,\n intervalMs: options.waitIntervalMs,\n });\n\n const inscription = await waitForInscriptionConfirmation(\n sdk,\n result.jobId,\n options.waitMaxAttempts,\n options.waitIntervalMs,\n options.progressCallback\n );\n\n logger.info('Inscription confirmation received', {\n transactionId: result.jobId,\n });\n\n return {\n confirmed: true,\n result,\n inscription,\n sdk,\n };\n }\n\n return {\n confirmed: false,\n result,\n sdk,\n };\n } catch (error) {\n logger.error('Error during inscription process', error);\n throw error;\n }\n}\n\nexport async function inscribeWithSigner(\n input: InscriptionInput,\n signer: DAppSigner,\n options: InscriptionOptions,\n existingSDK?: InscriptionSDK\n): Promise<InscriptionResponse> {\n const logger = Logger.getInstance({\n module: 'Inscriber',\n ...options.logging,\n });\n\n logger.info('Starting inscription process with signer', {\n type: input.type,\n mode: options.mode || 'file',\n ...(input.type === 'url' ? { url: input.url } : {}),\n ...(input.type === 'file' ? { path: input.path } : {}),\n ...(input.type === 'buffer'\n ? { fileName: input.fileName, bufferSize: input.buffer.byteLength }\n : {}),\n });\n\n try {\n if (options.mode === 'hashinal' && options.metadata) {\n validateHashinalMetadata(options.metadata, logger);\n }\n\n const accountId = signer.getAccountId().toString();\n logger.debug('Using account ID from signer', { accountId });\n\n let sdk: InscriptionSDK;\n\n if (existingSDK) {\n logger.debug('Using existing InscriptionSDK instance');\n sdk = existingSDK;\n } else if (options.apiKey) {\n logger.debug('Initializing InscriptionSDK with API key');\n sdk = new InscriptionSDK({\n apiKey: options.apiKey,\n network: options.network || 'mainnet',\n });\n } else {\n logger.debug('Initializing InscriptionSDK with client auth');\n sdk = await InscriptionSDK.createWithAuth({\n type: 'client',\n accountId,\n signer: signer,\n network: options.network || 'mainnet',\n });\n }\n\n const baseRequest = {\n holderId: accountId,\n metadata: options.metadata || {},\n tags: options.tags || [],\n mode: options.mode || 'file',\n chunkSize: options.chunkSize,\n };\n\n let request: any;\n switch (input.type) {\n case 'url':\n request = {\n ...baseRequest,\n file: {\n type: 'url',\n url: input.url,\n },\n };\n break;\n\n case 'file':\n request = {\n ...baseRequest,\n file: {\n type: 'path',\n path: input.path,\n },\n };\n break;\n\n case 'buffer':\n request = {\n ...baseRequest,\n file: {\n type: 'base64',\n base64: Buffer.from(input.buffer).toString('base64'),\n fileName: input.fileName,\n mimeType: input.mimeType,\n },\n };\n break;\n }\n\n if (options.mode === 'hashinal') {\n request.metadataObject = options.metadata;\n request.creator = options.metadata?.creator || accountId;\n request.description = options.metadata?.description;\n\n if (options.jsonFileURL) {\n request.jsonFileURL = options.jsonFileURL;\n }\n }\n\n logger.debug('Preparing to inscribe content with signer', {\n type: input.type,\n mode: options.mode || 'file',\n holderId: accountId,\n });\n\n const result = await sdk.inscribe(\n {\n ...request,\n holderId: accountId,\n },\n signer\n );\n logger.info('Inscription started', {\n type: input.type,\n mode: options.mode || 'file',\n transactionId: result.jobId,\n });\n\n if (options.waitForConfirmation) {\n logger.debug('Waiting for inscription confirmation', {\n transactionId: result.jobId,\n maxAttempts: options.waitMaxAttempts,\n intervalMs: options.waitIntervalMs,\n });\n\n const inscription = await waitForInscriptionConfirmation(\n sdk,\n result.jobId,\n options.waitMaxAttempts,\n options.waitIntervalMs,\n options.progressCallback\n );\n\n logger.info('Inscription confirmation received', {\n transactionId: result.jobId,\n });\n\n return {\n confirmed: true,\n result,\n inscription,\n sdk,\n };\n }\n\n return {\n confirmed: false,\n result,\n sdk,\n };\n } catch (error) {\n logger.error('Error during inscription process', error);\n throw error;\n }\n}\n\nexport async function retrieveInscription(\n transactionId: string,\n options: InscriptionOptions & { accountId?: string; privateKey?: string }\n): Promise<RetrievedInscriptionResult> {\n const logger = Logger.getInstance({\n module: 'Inscriber',\n ...options?.logging || {},\n });\n\n const formattedTransactionId = transactionId.includes('@')\n ? `${transactionId.split('@')[0]}-${transactionId\n .split('@')[1]\n .replace(/\\./g, '-')}`\n : transactionId;\n\n logger.info('Retrieving inscription', {\n originalTransactionId: transactionId,\n formattedTransactionId,\n });\n\n try {\n let sdk: InscriptionSDK;\n\n if (options?.apiKey) {\n logger.debug('Initializing InscriptionSDK with API key');\n sdk = new InscriptionSDK({\n apiKey: options.apiKey,\n network: options.network || 'mainnet',\n });\n } else if (options?.accountId && options?.privateKey) {\n logger.debug('Initializing InscriptionSDK with server auth');\n sdk = await InscriptionSDK.createWithAuth({\n type: 'server',\n accountId: options.accountId,\n privateKey: options.privateKey,\n network: options.network || 'mainnet',\n });\n } else {\n const error = new Error(\n 'Either API key or account ID and private key are required for retrieving inscriptions'\n );\n logger.error('Missing authentication credentials', {\n hasApiKey: Boolean(options?.apiKey),\n hasAccountId: Boolean(options?.accountId),\n hasPrivateKey: Boolean(options?.privateKey),\n });\n throw error;\n }\n\n logger.debug('Initialized SDK for inscription retrieval', {\n formattedTransactionId,\n network: options.network || 'mainnet',\n });\n\n const result = await sdk.retrieveInscription(formattedTransactionId);\n logger.info('Successfully retrieved inscription', {\n formattedTransactionId,\n });\n\n return result;\n } catch (error) {\n logger.error('Error retrieving inscription', {\n formattedTransactionId,\n error,\n });\n throw error;\n }\n}\n\nfunction validateHashinalMetadata(metadata: any, logger: any): void {\n const requiredFields = ['name', 'creator', 'description', 'type'];\n const missingFields = requiredFields.filter((field) => !metadata[field]);\n\n if (missingFields.length > 0) {\n const error = new Error(\n `Missing required Hashinal metadata fields: ${missingFields.join(', ')}`\n );\n logger.error('Hashinal metadata validation failed', { missingFields });\n throw error;\n }\n\n logger.debug('Hashinal metadata validation passed', {\n name: metadata.name,\n creator: metadata.creator,\n description: metadata.description,\n type: metadata.type,\n hasAttributes: !!metadata.attributes,\n hasProperties: !!metadata.properties,\n });\n}\n\nexport async function waitForInscriptionConfirmation(\n sdk: InscriptionSDK,\n transactionId: string,\n maxAttempts: number = 30,\n intervalMs: number = 4000,\n progressCallback?: ProgressCallback\n): Promise<RetrievedInscriptionResult> {\n const logger = Logger.getInstance({ module: 'Inscriber' });\n const progressReporter = new ProgressReporter({\n module: 'Inscriber',\n logger,\n callback: progressCallback,\n });\n\n try {\n logger.debug('Waiting for inscription confirmation', {\n transactionId,\n maxAttempts,\n intervalMs,\n });\n\n progressReporter.preparing('Preparing for inscription confirmation', 5, {\n transactionId,\n maxAttempts,\n intervalMs,\n });\n\n try {\n const waitMethod = sdk.waitForInscription.bind(sdk) as (\n txId: string,\n maxAttempts: number,\n intervalMs: number,\n checkCompletion: boolean,\n progressCallback?: Function\n ) => Promise<RetrievedInscriptionResult>;\n\n const wrappedCallback = (data: any) => {\n const stage = data.stage || 'confirming';\n const message = data.message || 'Processing inscription';\n const percent = data.progressPercent || 50;\n\n progressReporter.report({\n stage: stage,\n message: message,\n progressPercent: percent,\n details: {},\n });\n };\n\n return await waitMethod(\n transactionId,\n maxAttempts,\n intervalMs,\n true,\n wrappedCallback\n );\n } catch (e) {\n console.log(e);\n // Fall back to standard method if progress callback fails\n logger.debug('Falling back to standard waitForInscription method', {\n error: e,\n });\n progressReporter.verifying('Verifying inscription status', 50, {\n error: e,\n });\n\n return await sdk.waitForInscription(\n transactionId,\n maxAttempts,\n intervalMs,\n true\n );\n }\n } catch (error) {\n logger.error('Error waiting for inscription confirmation', {\n transactionId,\n maxAttempts,\n intervalMs,\n error,\n });\n\n progressReporter.failed('Inscription confirmation failed', {\n transactionId,\n error,\n });\n\n throw error;\n }\n}\n"],"names":[],"mappings":";;;;AA8BA,eAAsB,SACpB,OACA,cACA,SACA,aAC8B;AACxB,QAAA,SAAS,OAAO,YAAY;AAAA,IAChC,QAAQ;AAAA,IACR,GAAG,QAAQ;AAAA,EAAA,CACZ;AAED,SAAO,KAAK,gCAAgC;AAAA,IAC1C,MAAM,MAAM;AAAA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}
1
+ {"version":3,"file":"standards-sdk.es20.js","sources":["../../src/inscribe/inscriber.ts"],"sourcesContent":["import { InscriptionSDK } from '@kiloscribe/inscription-sdk';\nimport {\n InscriptionOptions,\n InscriptionResult,\n RetrievedInscriptionResult,\n HederaClientConfig,\n} from './types';\nimport type { DAppSigner } from '@hashgraph/hedera-wallet-connect';\nimport { Logger } from '../utils/logger';\nimport { ProgressCallback, ProgressReporter } from '../utils/progress-reporter';\n\nexport type InscriptionInput =\n | { type: 'url'; url: string }\n | { type: 'file'; path: string }\n | {\n type: 'buffer';\n buffer: ArrayBuffer | Buffer;\n fileName: string;\n mimeType?: string;\n };\n\nexport type InscriptionResponse =\n | { confirmed: false; result: InscriptionResult; sdk: InscriptionSDK }\n | {\n confirmed: true;\n result: InscriptionResult;\n inscription: RetrievedInscriptionResult;\n sdk: InscriptionSDK;\n };\n\nexport async function inscribe(\n input: InscriptionInput,\n clientConfig: HederaClientConfig,\n options: InscriptionOptions,\n existingSDK?: InscriptionSDK\n): Promise<InscriptionResponse> {\n const logger = Logger.getInstance({\n module: 'Inscriber',\n ...options.logging,\n });\n\n logger.info('Starting inscription process', {\n type: input.type,\n mode: options.mode || 'file',\n ...(input.type === 'url' ? { url: input.url } : {}),\n ...(input.type === 'file' ? { path: input.path } : {}),\n ...(input.type === 'buffer'\n ? { fileName: input.fileName, bufferSize: input.buffer.byteLength }\n : {}),\n });\n\n try {\n if (options.mode === 'hashinal' && options.metadata) {\n validateHashinalMetadata(options.metadata, logger);\n }\n\n let sdk: InscriptionSDK;\n\n if (existingSDK) {\n logger.debug('Using existing InscriptionSDK instance');\n sdk = existingSDK;\n } else if (options.apiKey) {\n logger.debug('Initializing InscriptionSDK with API key');\n sdk = new InscriptionSDK({\n apiKey: options.apiKey,\n network: clientConfig.network || 'mainnet',\n });\n } else {\n logger.debug('Initializing InscriptionSDK with server auth');\n sdk = await InscriptionSDK.createWithAuth({\n type: 'server',\n accountId: clientConfig.accountId,\n privateKey: clientConfig.privateKey,\n network: clientConfig.network || 'mainnet',\n });\n }\n\n const baseRequest = {\n holderId: clientConfig.accountId,\n metadata: options.metadata || {},\n tags: options.tags || [],\n mode: options.mode || 'file',\n chunkSize: options.chunkSize,\n };\n\n let request: any;\n switch (input.type) {\n case 'url':\n request = {\n ...baseRequest,\n file: {\n type: 'url',\n url: input.url,\n },\n };\n break;\n\n case 'file':\n request = {\n ...baseRequest,\n file: {\n type: 'path',\n path: input.path,\n },\n };\n break;\n\n case 'buffer':\n request = {\n ...baseRequest,\n file: {\n type: 'base64',\n base64: Buffer.from(input.buffer).toString('base64'),\n fileName: input.fileName,\n mimeType: input.mimeType,\n },\n };\n break;\n }\n\n if (options.mode === 'hashinal') {\n request.metadataObject = options.metadata;\n request.creator = options.metadata?.creator || clientConfig.accountId;\n request.description = options.metadata?.description;\n\n if (options.jsonFileURL) {\n request.jsonFileURL = options.jsonFileURL;\n }\n }\n\n logger.debug('Preparing to inscribe content', {\n type: input.type,\n mode: options.mode || 'file',\n holderId: clientConfig.accountId,\n });\n\n const result = await sdk.inscribeAndExecute(request, clientConfig);\n logger.info('Starting to inscribe.', {\n type: input.type,\n mode: options.mode || 'file',\n transactionId: result.jobId,\n });\n\n if (options.waitForConfirmation) {\n logger.debug('Waiting for inscription confirmation', {\n transactionId: result.jobId,\n maxAttempts: options.waitMaxAttempts,\n intervalMs: options.waitIntervalMs,\n });\n\n const inscription = await waitForInscriptionConfirmation(\n sdk,\n result.jobId,\n options.waitMaxAttempts,\n options.waitIntervalMs,\n options.progressCallback\n );\n\n logger.info('Inscription confirmation received', {\n transactionId: result.jobId,\n });\n\n return {\n confirmed: true,\n result,\n inscription,\n sdk,\n };\n }\n\n return {\n confirmed: false,\n result,\n sdk,\n };\n } catch (error) {\n logger.error('Error during inscription process', error);\n throw error;\n }\n}\n\nexport async function inscribeWithSigner(\n input: InscriptionInput,\n signer: DAppSigner,\n options: InscriptionOptions,\n existingSDK?: InscriptionSDK\n): Promise<InscriptionResponse> {\n const logger = Logger.getInstance({\n module: 'Inscriber',\n ...options.logging,\n });\n\n logger.info('Starting inscription process with signer', {\n type: input.type,\n mode: options.mode || 'file',\n ...(input.type === 'url' ? { url: input.url } : {}),\n ...(input.type === 'file' ? { path: input.path } : {}),\n ...(input.type === 'buffer'\n ? { fileName: input.fileName, bufferSize: input.buffer.byteLength }\n : {}),\n });\n\n try {\n if (options.mode === 'hashinal' && options.metadata) {\n validateHashinalMetadata(options.metadata, logger);\n }\n\n const accountId = signer.getAccountId().toString();\n logger.debug('Using account ID from signer', { accountId });\n\n let sdk: InscriptionSDK;\n\n if (existingSDK) {\n logger.debug('Using existing InscriptionSDK instance');\n sdk = existingSDK;\n } else if (options.apiKey) {\n logger.debug('Initializing InscriptionSDK with API key');\n sdk = new InscriptionSDK({\n apiKey: options.apiKey,\n network: options.network || 'mainnet',\n });\n } else {\n logger.debug('Initializing InscriptionSDK with client auth');\n sdk = await InscriptionSDK.createWithAuth({\n type: 'client',\n accountId,\n signer: signer,\n network: options.network || 'mainnet',\n });\n }\n\n const baseRequest = {\n holderId: accountId,\n metadata: options.metadata || {},\n tags: options.tags || [],\n mode: options.mode || 'file',\n chunkSize: options.chunkSize,\n };\n\n let request: any;\n switch (input.type) {\n case 'url':\n request = {\n ...baseRequest,\n file: {\n type: 'url',\n url: input.url,\n },\n };\n break;\n\n case 'file':\n request = {\n ...baseRequest,\n file: {\n type: 'path',\n path: input.path,\n },\n };\n break;\n\n case 'buffer':\n request = {\n ...baseRequest,\n file: {\n type: 'base64',\n base64: Buffer.from(input.buffer).toString('base64'),\n fileName: input.fileName,\n mimeType: input.mimeType,\n },\n };\n break;\n }\n\n if (options.mode === 'hashinal') {\n request.metadataObject = options.metadata;\n request.creator = options.metadata?.creator || accountId;\n request.description = options.metadata?.description;\n\n if (options.jsonFileURL) {\n request.jsonFileURL = options.jsonFileURL;\n }\n }\n\n logger.debug('Preparing to inscribe content with signer', {\n type: input.type,\n mode: options.mode || 'file',\n holderId: accountId,\n });\n\n const result = await sdk.inscribe(\n {\n ...request,\n holderId: accountId,\n },\n signer\n );\n logger.info('Inscription started', {\n type: input.type,\n mode: options.mode || 'file',\n transactionId: result.jobId,\n });\n\n if (options.waitForConfirmation) {\n logger.debug('Waiting for inscription confirmation', {\n transactionId: result.jobId,\n maxAttempts: options.waitMaxAttempts,\n intervalMs: options.waitIntervalMs,\n });\n\n const inscription = await waitForInscriptionConfirmation(\n sdk,\n result.jobId,\n options.waitMaxAttempts,\n options.waitIntervalMs,\n options.progressCallback\n );\n\n logger.info('Inscription confirmation received', {\n transactionId: result.jobId,\n });\n\n return {\n confirmed: true,\n result,\n inscription,\n sdk,\n };\n }\n\n return {\n confirmed: false,\n result,\n sdk,\n };\n } catch (error) {\n logger.error('Error during inscription process', error);\n throw error;\n }\n}\n\nexport async function retrieveInscription(\n transactionId: string,\n options: InscriptionOptions & { accountId?: string; privateKey?: string }\n): Promise<RetrievedInscriptionResult> {\n const logger = Logger.getInstance({\n module: 'Inscriber',\n ...options?.logging || {},\n });\n\n const formattedTransactionId = transactionId.includes('@')\n ? `${transactionId.split('@')[0]}-${transactionId\n .split('@')[1]\n .replace(/\\./g, '-')}`\n : transactionId;\n\n logger.info('Retrieving inscription', {\n originalTransactionId: transactionId,\n formattedTransactionId,\n });\n\n try {\n let sdk: InscriptionSDK;\n\n if (options?.apiKey) {\n logger.debug('Initializing InscriptionSDK with API key');\n sdk = new InscriptionSDK({\n apiKey: options.apiKey,\n network: options.network || 'mainnet',\n });\n } else if (options?.accountId && options?.privateKey) {\n logger.debug('Initializing InscriptionSDK with server auth');\n sdk = await InscriptionSDK.createWithAuth({\n type: 'server',\n accountId: options.accountId,\n privateKey: options.privateKey,\n network: options.network || 'mainnet',\n });\n } else {\n const error = new Error(\n 'Either API key or account ID and private key are required for retrieving inscriptions'\n );\n logger.error('Missing authentication credentials', {\n hasApiKey: Boolean(options?.apiKey),\n hasAccountId: Boolean(options?.accountId),\n hasPrivateKey: Boolean(options?.privateKey),\n });\n throw error;\n }\n\n logger.debug('Initialized SDK for inscription retrieval', {\n formattedTransactionId,\n network: options.network || 'mainnet',\n });\n\n const result = await sdk.retrieveInscription(formattedTransactionId);\n logger.info('Successfully retrieved inscription', {\n formattedTransactionId,\n });\n\n return result;\n } catch (error) {\n logger.error('Error retrieving inscription', {\n formattedTransactionId,\n error,\n });\n throw error;\n }\n}\n\nfunction validateHashinalMetadata(metadata: any, logger: any): void {\n const requiredFields = ['name', 'creator', 'description', 'type'];\n const missingFields = requiredFields.filter((field) => !metadata[field]);\n\n if (missingFields.length > 0) {\n const error = new Error(\n `Missing required Hashinal metadata fields: ${missingFields.join(', ')}`\n );\n logger.error('Hashinal metadata validation failed', { missingFields });\n throw error;\n }\n\n logger.debug('Hashinal metadata validation passed', {\n name: metadata.name,\n creator: metadata.creator,\n description: metadata.description,\n type: metadata.type,\n hasAttributes: !!metadata.attributes,\n hasProperties: !!metadata.properties,\n });\n}\n\nexport async function waitForInscriptionConfirmation(\n sdk: InscriptionSDK,\n transactionId: string,\n maxAttempts: number = 30,\n intervalMs: number = 4000,\n progressCallback?: ProgressCallback\n): Promise<RetrievedInscriptionResult> {\n const logger = Logger.getInstance({ module: 'Inscriber' });\n const progressReporter = new ProgressReporter({\n module: 'Inscriber',\n logger,\n callback: progressCallback,\n });\n\n try {\n logger.debug('Waiting for inscription confirmation', {\n transactionId,\n maxAttempts,\n intervalMs,\n });\n\n progressReporter.preparing('Preparing for inscription confirmation', 5, {\n transactionId,\n maxAttempts,\n intervalMs,\n });\n\n try {\n const waitMethod = sdk.waitForInscription.bind(sdk) as (\n txId: string,\n maxAttempts: number,\n intervalMs: number,\n checkCompletion: boolean,\n progressCallback?: Function\n ) => Promise<RetrievedInscriptionResult>;\n\n const wrappedCallback = (data: any) => {\n const stage = data.stage || 'confirming';\n const message = data.message || 'Processing inscription';\n const percent = data.progressPercent || 50;\n\n progressReporter.report({\n stage: stage,\n message: message,\n progressPercent: percent,\n details: {},\n });\n };\n\n return await waitMethod(\n transactionId,\n maxAttempts,\n intervalMs,\n true,\n wrappedCallback\n );\n } catch (e) {\n console.log(e);\n // Fall back to standard method if progress callback fails\n logger.debug('Falling back to standard waitForInscription method', {\n error: e,\n });\n progressReporter.verifying('Verifying inscription status', 50, {\n error: e,\n });\n\n return await sdk.waitForInscription(\n transactionId,\n maxAttempts,\n intervalMs,\n true\n );\n }\n } catch (error) {\n logger.error('Error waiting for inscription confirmation', {\n transactionId,\n maxAttempts,\n intervalMs,\n error,\n });\n\n progressReporter.failed('Inscription confirmation failed', {\n transactionId,\n error,\n });\n\n throw error;\n }\n}\n"],"names":[],"mappings":";;;AA8BA,eAAsB,SACpB,OACA,cACA,SACA,aAC8B;AACxB,QAAA,SAAS,OAAO,YAAY;AAAA,IAChC,QAAQ;AAAA,IACR,GAAG,QAAQ;AAAA,EAAA,CACZ;AAED,SAAO,KAAK,gCAAgC;AAAA,IAC1C,MAAM,MAAM;AAAA,IACZ,MAAM,QAAQ,QAAQ;AAAA,IACtB,GAAI,MAAM,SAAS,QAAQ,EAAE,KAAK,MAAM,IAAI,IAAI,CAAC;AAAA,IACjD,GAAI,MAAM,SAAS,SAAS,EAAE,MAAM,MAAM,KAAK,IAAI,CAAC;AAAA,IACpD,GAAI,MAAM,SAAS,WACf,EAAE,UAAU,MAAM,UAAU,YAAY,MAAM,OAAO,WAAA,IACrD,CAAA;AAAA,EAAC,CACN;AAEG,MAAA;AACF,QAAI,QAAQ,SAAS,cAAc,QAAQ,UAAU;AAC1B,+BAAA,QAAQ,UAAU,MAAM;AAAA,IAAA;AAG/C,QAAA;AAEJ,QAAI,aAAa;AACf,aAAO,MAAM,wCAAwC;AAC/C,YAAA;AAAA,IAAA,WACG,QAAQ,QAAQ;AACzB,aAAO,MAAM,0CAA0C;AACvD,YAAM,IAAI,eAAe;AAAA,QACvB,QAAQ,QAAQ;AAAA,QAChB,SAAS,aAAa,WAAW;AAAA,MAAA,CAClC;AAAA,IAAA,OACI;AACL,aAAO,MAAM,8CAA8C;AACrD,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,QAAC,CACX;AAAA,MACH;AAEA,aAAO,MAAM;AAAA,QACX;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,aACO,GAAG;AACV,cAAQ,IAAI,CAAC;AAEb,aAAO,MAAM,sDAAsD;AAAA,QACjE,OAAO;AAAA,MAAA,CACR;AACgB,uBAAA,UAAU,gCAAgC,IAAI;AAAA,QAC7D,OAAO;AAAA,MAAA,CACR;AAED,aAAO,MAAM,IAAI;AAAA,QACf;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAAA,IAAA;AAAA,WAEK,OAAO;AACd,WAAO,MAAM,8CAA8C;AAAA,MACzD;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,IAAA,CACD;AAED,qBAAiB,OAAO,mCAAmC;AAAA,MACzD;AAAA,MACA;AAAA,IAAA,CACD;AAEK,UAAA;AAAA,EAAA;AAEV;"}
@@ -1,4 +1,3 @@
1
- import Buffer from "vite-plugin-node-polyfills/shims/buffer";
2
1
  import { PublicKey, Timestamp, AccountId } from "@hashgraph/sdk";
3
2
  import axios from "axios";
4
3
  import { Logger } from "./standards-sdk.es15.js";