@hashgraphonline/standards-sdk 0.1.180 → 0.1.181

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 (132) hide show
  1. package/dist/browser/services/registry-broker/client/base-client.d.ts +3 -0
  2. package/dist/browser/services/registry-broker/client/base-client.d.ts.map +1 -1
  3. package/dist/browser/services/registry-broker/client/guard.d.ts.map +1 -1
  4. package/dist/browser/services/registry-broker/types.d.ts +3 -0
  5. package/dist/browser/services/registry-broker/types.d.ts.map +1 -1
  6. package/dist/browser-root/services/registry-broker/client/base-client.d.ts +3 -0
  7. package/dist/browser-root/services/registry-broker/client/base-client.d.ts.map +1 -1
  8. package/dist/browser-root/services/registry-broker/client/guard.d.ts.map +1 -1
  9. package/dist/browser-root/services/registry-broker/types.d.ts +3 -0
  10. package/dist/browser-root/services/registry-broker/types.d.ts.map +1 -1
  11. package/dist/browser-root/standards-sdk.root-browser.js +340 -104
  12. package/dist/browser-root/standards-sdk.root-browser.js.map +1 -1
  13. package/dist/cjs/services/registry-broker/client/base-client.d.ts +3 -0
  14. package/dist/cjs/services/registry-broker/client/base-client.d.ts.map +1 -1
  15. package/dist/cjs/services/registry-broker/client/guard.d.ts.map +1 -1
  16. package/dist/cjs/services/registry-broker/types.d.ts +3 -0
  17. package/dist/cjs/services/registry-broker/types.d.ts.map +1 -1
  18. package/dist/cjs/standards-sdk.cjs +1 -1
  19. package/dist/cjs/standards-sdk.cjs.map +1 -1
  20. package/dist/es/services/registry-broker/client/base-client.d.ts +3 -0
  21. package/dist/es/services/registry-broker/client/base-client.d.ts.map +1 -1
  22. package/dist/es/services/registry-broker/client/guard.d.ts.map +1 -1
  23. package/dist/es/services/registry-broker/types.d.ts +3 -0
  24. package/dist/es/services/registry-broker/types.d.ts.map +1 -1
  25. package/dist/es/standards-sdk.es.js +10 -7
  26. package/dist/es/standards-sdk.es.js.map +1 -1
  27. package/dist/es/standards-sdk.es104.js +1 -1
  28. package/dist/es/standards-sdk.es106.js +1 -1
  29. package/dist/es/standards-sdk.es108.js +1 -1
  30. package/dist/es/standards-sdk.es11.js +1 -1
  31. package/dist/es/standards-sdk.es110.js +1 -1
  32. package/dist/es/standards-sdk.es116.js +1 -1
  33. package/dist/es/standards-sdk.es12.js +1 -1
  34. package/dist/es/standards-sdk.es121.js +1 -1
  35. package/dist/es/standards-sdk.es127.js +2 -2
  36. package/dist/es/standards-sdk.es142.js +1 -1
  37. package/dist/es/standards-sdk.es145.js +43 -14
  38. package/dist/es/standards-sdk.es145.js.map +1 -1
  39. package/dist/es/standards-sdk.es147.js +3 -3
  40. package/dist/es/standards-sdk.es148.js +4 -81
  41. package/dist/es/standards-sdk.es148.js.map +1 -1
  42. package/dist/es/standards-sdk.es149.js +71 -77
  43. package/dist/es/standards-sdk.es149.js.map +1 -1
  44. package/dist/es/standards-sdk.es150.js +80 -53
  45. package/dist/es/standards-sdk.es150.js.map +1 -1
  46. package/dist/es/standards-sdk.es151.js +53 -152
  47. package/dist/es/standards-sdk.es151.js.map +1 -1
  48. package/dist/es/standards-sdk.es152.js +159 -7
  49. package/dist/es/standards-sdk.es152.js.map +1 -1
  50. package/dist/es/standards-sdk.es153.js +7 -86
  51. package/dist/es/standards-sdk.es153.js.map +1 -1
  52. package/dist/es/standards-sdk.es154.js +64 -43
  53. package/dist/es/standards-sdk.es154.js.map +1 -1
  54. package/dist/es/standards-sdk.es155.js +65 -30
  55. package/dist/es/standards-sdk.es155.js.map +1 -1
  56. package/dist/es/standards-sdk.es156.js +30 -34
  57. package/dist/es/standards-sdk.es156.js.map +1 -1
  58. package/dist/es/standards-sdk.es157.js +34 -48
  59. package/dist/es/standards-sdk.es157.js.map +1 -1
  60. package/dist/es/standards-sdk.es158.js +48 -138
  61. package/dist/es/standards-sdk.es158.js.map +1 -1
  62. package/dist/es/standards-sdk.es159.js +133 -37
  63. package/dist/es/standards-sdk.es159.js.map +1 -1
  64. package/dist/es/standards-sdk.es16.js +2 -2
  65. package/dist/es/standards-sdk.es160.js +42 -2352
  66. package/dist/es/standards-sdk.es160.js.map +1 -1
  67. package/dist/es/standards-sdk.es162.js +2352 -672
  68. package/dist/es/standards-sdk.es162.js.map +1 -1
  69. package/dist/es/standards-sdk.es163.js +15 -54
  70. package/dist/es/standards-sdk.es163.js.map +1 -1
  71. package/dist/es/standards-sdk.es165.js +63 -71
  72. package/dist/es/standards-sdk.es165.js.map +1 -1
  73. package/dist/es/standards-sdk.es166.js +48 -192
  74. package/dist/es/standards-sdk.es166.js.map +1 -1
  75. package/dist/es/standards-sdk.es167.js +79 -15
  76. package/dist/es/standards-sdk.es167.js.map +1 -1
  77. package/dist/es/standards-sdk.es168.js +181 -54
  78. package/dist/es/standards-sdk.es168.js.map +1 -1
  79. package/dist/es/standards-sdk.es175.js +653 -120
  80. package/dist/es/standards-sdk.es175.js.map +1 -1
  81. package/dist/es/standards-sdk.es176.js +111 -303
  82. package/dist/es/standards-sdk.es176.js.map +1 -1
  83. package/dist/es/standards-sdk.es177.js +297 -225
  84. package/dist/es/standards-sdk.es177.js.map +1 -1
  85. package/dist/es/standards-sdk.es178.js +239 -176
  86. package/dist/es/standards-sdk.es178.js.map +1 -1
  87. package/dist/es/standards-sdk.es179.js +178 -101
  88. package/dist/es/standards-sdk.es179.js.map +1 -1
  89. package/dist/es/standards-sdk.es18.js +4 -4
  90. package/dist/es/standards-sdk.es180.js +75 -108
  91. package/dist/es/standards-sdk.es180.js.map +1 -1
  92. package/dist/es/standards-sdk.es181.js +116 -148
  93. package/dist/es/standards-sdk.es181.js.map +1 -1
  94. package/dist/es/standards-sdk.es182.js +143 -439
  95. package/dist/es/standards-sdk.es182.js.map +1 -1
  96. package/dist/es/standards-sdk.es183.js +661 -162
  97. package/dist/es/standards-sdk.es183.js.map +1 -1
  98. package/dist/es/standards-sdk.es184.js +156 -206
  99. package/dist/es/standards-sdk.es184.js.map +1 -1
  100. package/dist/es/standards-sdk.es185.js +219 -223
  101. package/dist/es/standards-sdk.es185.js.map +1 -1
  102. package/dist/es/standards-sdk.es186.js +242 -0
  103. package/dist/es/standards-sdk.es186.js.map +1 -0
  104. package/dist/es/standards-sdk.es19.js +2 -2
  105. package/dist/es/standards-sdk.es22.js +1 -1
  106. package/dist/es/standards-sdk.es27.js +4 -4
  107. package/dist/es/standards-sdk.es35.js +2 -2
  108. package/dist/es/standards-sdk.es36.js +2 -2
  109. package/dist/es/standards-sdk.es4.js +1 -1
  110. package/dist/es/standards-sdk.es53.js +1 -1
  111. package/dist/es/standards-sdk.es56.js +1 -1
  112. package/dist/es/standards-sdk.es59.js +1 -1
  113. package/dist/es/standards-sdk.es62.js +1 -1
  114. package/dist/es/standards-sdk.es63.js +2 -2
  115. package/dist/es/standards-sdk.es64.js +1 -1
  116. package/dist/es/standards-sdk.es65.js +1 -1
  117. package/dist/es/standards-sdk.es67.js +3 -3
  118. package/dist/es/standards-sdk.es7.js +1 -1
  119. package/dist/es/standards-sdk.es71.js +1 -1
  120. package/dist/es/standards-sdk.es72.js +2 -2
  121. package/dist/es/standards-sdk.es75.js +2 -2
  122. package/dist/es/standards-sdk.es76.js +1 -1
  123. package/dist/es/standards-sdk.es78.js +1 -1
  124. package/dist/es/standards-sdk.es83.js +1 -1
  125. package/dist/es/standards-sdk.es84.js +2 -2
  126. package/dist/es/standards-sdk.es85.js +1 -1
  127. package/dist/es/standards-sdk.es88.js +1 -1
  128. package/dist/es/standards-sdk.es90.js +1 -1
  129. package/dist/es/standards-sdk.es94.js +3 -3
  130. package/dist/es/standards-sdk.es98.js +1 -1
  131. package/dist/es/standards-sdk.es99.js +1 -1
  132. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es148.js","sources":["../../src/services/registry-broker/private-key-signer.ts"],"sourcesContent":["import type {\n Signer,\n AccountBalance,\n AccountInfo,\n Transaction,\n TransactionRecord,\n SignerSignature,\n} from '@hashgraph/sdk';\nimport { optionalImport, optionalImportSync } from '../../utils/dynamic-import';\n\nconst unsupported = (method: string): Error =>\n new Error(`${method} is not supported by the in-memory signer`);\n\nexport interface PrivateKeySignerOptions {\n accountId: string;\n privateKey: string;\n network: 'mainnet' | 'testnet';\n}\n\ntype HashgraphSdk = typeof import('@hashgraph/sdk');\n\nlet cachedSdk: HashgraphSdk | null = null;\n\nconst loadHashgraphSdk = (): HashgraphSdk => {\n if (cachedSdk) {\n return cachedSdk;\n }\n const resolved = optionalImportSync<HashgraphSdk>('@hashgraph/sdk');\n if (resolved) {\n cachedSdk = resolved;\n return resolved;\n }\n\n const message =\n '@hashgraph/sdk is required for ledger signing. Install it as a dependency to enable createPrivateKeySigner.';\n throw new Error(message);\n};\n\nconst loadHashgraphSdkAsync = async (): Promise<HashgraphSdk> => {\n if (cachedSdk) {\n return cachedSdk;\n }\n const resolved = await optionalImport<HashgraphSdk>('@hashgraph/sdk');\n if (resolved) {\n cachedSdk = resolved;\n return resolved;\n }\n const message =\n '@hashgraph/sdk is required for ledger signing. Install it as a dependency to enable createPrivateKeySigner.';\n throw new Error(message);\n};\n\nconst buildSigner = (\n sdk: HashgraphSdk,\n options: PrivateKeySignerOptions,\n): Signer => {\n const { AccountId, LedgerId, PrivateKey, SignerSignature } = sdk;\n if (!options.privateKey) {\n throw new Error('privateKey is required to create a ledger signer.');\n }\n if (!options.accountId) {\n throw new Error('accountId is required to create a ledger signer.');\n }\n const accountId = AccountId.fromString(options.accountId);\n const privateKey = PrivateKey.fromString(options.privateKey);\n const ledgerId = LedgerId.fromString(options.network);\n\n return {\n getLedgerId: () => ledgerId,\n getAccountId: () => accountId,\n getAccountKey: () => privateKey.publicKey,\n getNetwork: () => ({}),\n getMirrorNetwork: () => [],\n sign: async (messages: Uint8Array[]): Promise<SignerSignature[]> =>\n Promise.all(\n messages.map(async message => {\n const signature = await privateKey.sign(message);\n return new SignerSignature({\n publicKey: privateKey.publicKey,\n signature,\n accountId,\n });\n }),\n ),\n getAccountBalance: async (): Promise<AccountBalance> => {\n throw unsupported('getAccountBalance');\n },\n getAccountInfo: async (): Promise<AccountInfo> => {\n throw unsupported('getAccountInfo');\n },\n getAccountRecords: async (): Promise<TransactionRecord[]> => {\n throw unsupported('getAccountRecords');\n },\n signTransaction: async <T extends Transaction>(_: T): Promise<T> => {\n throw unsupported('signTransaction');\n },\n checkTransaction: async <T extends Transaction>(_: T): Promise<T> => {\n throw unsupported('checkTransaction');\n },\n populateTransaction: async <T extends Transaction>(_: T): Promise<T> => {\n throw unsupported('populateTransaction');\n },\n call: async <RequestT, ResponseT, OutputT>(\n _request: unknown,\n ): Promise<OutputT> => {\n throw unsupported('call');\n },\n };\n};\n\nexport const createPrivateKeySigner = (\n options: PrivateKeySignerOptions,\n): Signer => buildSigner(loadHashgraphSdk(), options);\n\nexport const createPrivateKeySignerAsync = async (\n options: PrivateKeySignerOptions,\n): Promise<Signer> => buildSigner(await loadHashgraphSdkAsync(), options);\n"],"names":[],"mappings":";AAUA,MAAM,cAAc,CAAC,WACnB,IAAI,MAAM,GAAG,MAAM,2CAA2C;AAUhE,IAAI,YAAiC;AAErC,MAAM,mBAAmB,MAAoB;AAC3C,MAAI,WAAW;AACb,WAAO;AAAA,EACT;AACA,QAAM,WAAW,mBAAiC,gBAAgB;AAClE,MAAI,UAAU;AACZ,gBAAY;AACZ,WAAO;AAAA,EACT;AAEA,QAAM,UACJ;AACF,QAAM,IAAI,MAAM,OAAO;AACzB;AAEA,MAAM,wBAAwB,YAAmC;AAC/D,MAAI,WAAW;AACb,WAAO;AAAA,EACT;AACA,QAAM,WAAW,MAAM,eAA6B,gBAAgB;AACpE,MAAI,UAAU;AACZ,gBAAY;AACZ,WAAO;AAAA,EACT;AACA,QAAM,UACJ;AACF,QAAM,IAAI,MAAM,OAAO;AACzB;AAEA,MAAM,cAAc,CAClB,KACA,YACW;AACX,QAAM,EAAE,WAAW,UAAU,YAAY,oBAAoB;AAC7D,MAAI,CAAC,QAAQ,YAAY;AACvB,UAAM,IAAI,MAAM,mDAAmD;AAAA,EACrE;AACA,MAAI,CAAC,QAAQ,WAAW;AACtB,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,QAAM,YAAY,UAAU,WAAW,QAAQ,SAAS;AACxD,QAAM,aAAa,WAAW,WAAW,QAAQ,UAAU;AAC3D,QAAM,WAAW,SAAS,WAAW,QAAQ,OAAO;AAEpD,SAAO;AAAA,IACL,aAAa,MAAM;AAAA,IACnB,cAAc,MAAM;AAAA,IACpB,eAAe,MAAM,WAAW;AAAA,IAChC,YAAY,OAAO,CAAA;AAAA,IACnB,kBAAkB,MAAM,CAAA;AAAA,IACxB,MAAM,OAAO,aACX,QAAQ;AAAA,MACN,SAAS,IAAI,OAAM,YAAW;AAC5B,cAAM,YAAY,MAAM,WAAW,KAAK,OAAO;AAC/C,eAAO,IAAI,gBAAgB;AAAA,UACzB,WAAW,WAAW;AAAA,UACtB;AAAA,UACA;AAAA,QAAA,CACD;AAAA,MACH,CAAC;AAAA,IAAA;AAAA,IAEL,mBAAmB,YAAqC;AACtD,YAAM,YAAY,mBAAmB;AAAA,IACvC;AAAA,IACA,gBAAgB,YAAkC;AAChD,YAAM,YAAY,gBAAgB;AAAA,IACpC;AAAA,IACA,mBAAmB,YAA0C;AAC3D,YAAM,YAAY,mBAAmB;AAAA,IACvC;AAAA,IACA,iBAAiB,OAA8B,MAAqB;AAClE,YAAM,YAAY,iBAAiB;AAAA,IACrC;AAAA,IACA,kBAAkB,OAA8B,MAAqB;AACnE,YAAM,YAAY,kBAAkB;AAAA,IACtC;AAAA,IACA,qBAAqB,OAA8B,MAAqB;AACtE,YAAM,YAAY,qBAAqB;AAAA,IACzC;AAAA,IACA,MAAM,OACJ,aACqB;AACrB,YAAM,YAAY,MAAM;AAAA,IAC1B;AAAA,EAAA;AAEJ;AAEO,MAAM,yBAAyB,CACpC,YACW,YAAY,iBAAA,GAAoB,OAAO;AAE7C,MAAM,8BAA8B,OACzC,YACoB,YAAY,MAAM,sBAAA,GAAyB,OAAO;"}
1
+ {"version":3,"file":"standards-sdk.es148.js","sources":["../../src/services/registry-broker/types.ts"],"sourcesContent":["import { z } from 'zod';\nimport type { Signer } from '@hashgraph/sdk';\nimport type { Buffer } from 'buffer';\nimport type {\n AdapterConfigContext,\n AdapterManifest,\n AdapterPackage,\n} from '../../hcs-21/types';\nimport {\n adaptersResponseSchema,\n createSessionResponseSchema,\n encryptionHandshakeResponseSchema,\n detectProtocolResponseSchema,\n dashboardStatsResponseSchema,\n delegationPlanResponseSchema,\n metricsSummaryResponseSchema,\n popularResponseSchema,\n protocolsResponseSchema,\n registerAgentResponseSchema,\n registrationQuoteResponseSchema,\n creditProviderSummarySchema,\n creditProvidersResponseSchema,\n creditBalanceResponseSchema,\n guardBalanceResponseSchema,\n guardBucketBalanceSchema,\n guardEntitlementsSchema,\n guardFeedItemSchema,\n guardFeedResponseSchema,\n guardFeedSummarySchema,\n guardOverviewResponseSchema,\n guardPolicySchema,\n guardPlanIdSchema,\n guardPrincipalSchema,\n guardHistoryArtifactSchema,\n guardReceiptSchema,\n guardReceiptHistoryResponseSchema,\n guardReceiptSyncResponseSchema,\n guardInventoryArtifactSchema,\n guardInventoryResponseSchema,\n guardAbomSummarySchema,\n guardAbomResponseSchema,\n guardTimelineEventSchema,\n guardArtifactTimelineResponseSchema,\n guardReceiptExportSummarySchema,\n guardExportSignatureSchema,\n guardReceiptExportResponseSchema,\n guardAlertPreferencesSchema,\n guardWatchlistItemSchema,\n guardWatchlistLookupResponseSchema,\n guardWatchlistResponseSchema,\n guardPainSignalSchema,\n guardPainSignalListResponseSchema,\n guardPainSignalAggregateSchema,\n guardPainSignalAggregateResponseSchema,\n guardInventoryDiffEntrySchema,\n guardInventoryDiffResponseSchema,\n guardExceptionItemSchema,\n guardExceptionListResponseSchema,\n guardPreflightEvidenceSchema,\n guardPreflightRequestSchema,\n guardPreflightVerdictResponseSchema,\n guardTeamPolicyAuditItemSchema,\n guardTeamPolicyPackSchema,\n guardDeviceSchema,\n guardDeviceListResponseSchema,\n guardRevocationResponseSchema,\n guardSessionResponseSchema,\n guardTrustByHashResponseSchema,\n guardTrustMatchSchema,\n guardTrustResolveResponseSchema,\n creditPurchaseResponseSchema,\n hbarPurchaseIntentResponseSchema,\n x402CreditPurchaseResponseSchema,\n x402MinimumsResponseSchema,\n registriesResponseSchema,\n registrySearchByNamespaceSchema,\n searchFacetsResponseSchema,\n adapterDetailsResponseSchema,\n adapterRegistryAdaptersResponseSchema,\n adapterRegistryCategoriesResponseSchema,\n adapterRegistryCategorySchema,\n adapterRegistryCreateCategoryResponseSchema,\n adapterRegistrySubmitAdapterResponseSchema,\n adapterRegistrySubmitAdapterAcceptedResponseSchema,\n adapterRegistrySubmissionStatusResponseSchema,\n adapterDescriptorSchema,\n adapterChatProfileSchema,\n additionalRegistryCatalogResponseSchema,\n vectorSearchRequestSchema,\n vectorSearchResponseSchema,\n resolveResponseSchema,\n searchResponseSchema,\n sendMessageResponseSchema,\n chatHistorySnapshotResponseSchema,\n chatHistoryCompactionResponseSchema,\n statsResponseSchema,\n sessionEncryptionStatusResponseSchema,\n uaidConnectionStatusSchema,\n uaidValidationResponseSchema,\n websocketStatsResponseSchema,\n ledgerChallengeResponseSchema,\n ledgerVerifyResponseSchema,\n registerAgentPendingResponseSchema,\n registerAgentPartialResponseSchema,\n registerAgentSuccessResponseSchema,\n registrationProgressAdditionalEntrySchema,\n registrationProgressRecordSchema,\n registrationProgressResponseSchema,\n registerEncryptionKeyResponseSchema,\n searchStatusResponseSchema,\n agentFeedbackResponseSchema,\n agentFeedbackEligibilityResponseSchema,\n agentFeedbackSubmissionResponseSchema,\n agentFeedbackIndexResponseSchema,\n agentFeedbackEntriesIndexResponseSchema,\n moltbookOwnerRegistrationUpdateResponseSchema,\n AIAgentType,\n AIAgentCapability,\n registerStatusResponseSchema,\n verificationChallengeDetailsResponseSchema,\n verificationChallengeResponseSchema,\n verificationOwnershipResponseSchema,\n verificationStatusResponseSchema,\n verificationDnsStatusResponseSchema,\n verificationVerifyResponseSchema,\n verificationVerifySenderResponseSchema,\n skillRegistryConfigResponseSchema,\n skillCatalogChannelSchema,\n skillCatalogSortBySchema,\n skillCatalogVersionSummarySchema,\n skillCatalogItemSchema,\n skillCatalogResponseSchema,\n skillRecommendedVersionResponseSchema,\n skillDeprecationRecordSchema,\n skillDeprecationsResponseSchema,\n skillBadgeMetricSchema,\n skillBadgeStyleSchema,\n skillBadgeResponseSchema,\n skillRegistryTagsResponseSchema,\n skillRegistryCategoriesResponseSchema,\n skillResolverManifestResponseSchema,\n skillRegistryFileDescriptorSchema,\n skillRegistryJobStatusResponseSchema,\n skillSecurityBreakdownResponseSchema,\n skillRegistryListResponseSchema,\n skillRegistryMineResponseSchema,\n skillRegistryMyListResponseSchema,\n skillRegistryOwnershipResponseSchema,\n skillRegistryPublishResponseSchema,\n skillRegistryPublishSummarySchema,\n skillRegistryQuoteResponseSchema,\n skillRegistryVersionsResponseSchema,\n skillRegistryVoteStatusResponseSchema,\n skillVerificationDomainProofChallengeResponseSchema,\n skillVerificationDomainProofVerifyResponseSchema,\n skillVerificationRequestCreateResponseSchema,\n skillVerificationStatusResponseSchema,\n skillTrustTierSchema,\n skillStatusNextStepSchema,\n skillPreviewSuggestedNextStepSchema,\n skillPreviewReportSchema,\n skillPreviewRecordSchema,\n skillPreviewLookupResponseSchema,\n skillStatusPreviewMetadataSchema,\n skillStatusChecksSchema,\n skillStatusVerificationSignalsSchema,\n skillStatusProvenanceSignalsSchema,\n skillStatusResponseSchema,\n skillQuotePreviewRangeSchema,\n skillQuotePreviewResponseSchema,\n skillConversionSignalsResponseSchema,\n skillInstallArtifactDescriptorSchema,\n skillInstallResolverDescriptorSchema,\n skillInstallBadgeDescriptorSchema,\n skillInstallShareDescriptorSchema,\n skillInstallSnippetSetSchema,\n skillInstallResponseSchema,\n skillInstallCopyTelemetryResponseSchema,\n} from './schemas';\n\nexport type JsonPrimitive = string | number | boolean | null;\nexport type JsonValue = JsonPrimitive | JsonValue[] | JsonObject;\nexport interface JsonObject {\n [key: string]: JsonValue;\n}\n\nexport interface RegistryBrokerClientOptions {\n baseUrl?: string;\n fetchImplementation?: typeof fetch;\n defaultHeaders?: Record<string, string>;\n apiKey?: string;\n /**\n * Optional account identifier to send as the `x-account-id` header.\n *\n * This is used by some Registry Broker deployments to attribute registrations\n * when no API key / user session is present (for example local docker E2E).\n */\n accountId?: string;\n ledgerApiKey?: string;\n registrationAutoTopUp?: AutoTopUpOptions;\n historyAutoTopUp?: HistoryAutoTopUpOptions;\n encryption?: ClientEncryptionOptions;\n}\n\nexport type ChatHistoryEntry = z.infer<\n typeof createSessionResponseSchema\n>['history'][number];\n\nexport type CipherEnvelope = NonNullable<ChatHistoryEntry['cipherEnvelope']>;\n\nexport type CipherEnvelopeRecipient = CipherEnvelope['recipients'][number];\n\nexport interface EphemeralKeyPair {\n privateKey: string;\n publicKey: string;\n}\n\nexport interface DeriveSharedSecretOptions {\n privateKey: string;\n peerPublicKey: string;\n}\n\nexport type SharedSecretInput = string | Uint8Array | Buffer;\n\nexport interface EncryptCipherEnvelopeOptions {\n plaintext: string;\n sessionId: string;\n recipients: Array<\n Pick<\n CipherEnvelopeRecipient,\n 'uaid' | 'ledgerAccountId' | 'userId' | 'email'\n >\n >;\n sharedSecret: SharedSecretInput;\n associatedData?: string;\n revision?: number;\n}\n\nexport interface DecryptCipherEnvelopeOptions {\n envelope: CipherEnvelope;\n sharedSecret: SharedSecretInput;\n encoding?: BufferEncoding;\n}\n\nexport type SessionEncryptionStatusResponse = z.infer<\n typeof sessionEncryptionStatusResponseSchema\n>;\n\nexport type SessionEncryptionSummary =\n SessionEncryptionStatusResponse['encryption'];\n\nexport type EncryptionHandshakeResponse = z.infer<\n typeof encryptionHandshakeResponseSchema\n>;\n\nexport type EncryptionHandshakeRecord =\n EncryptionHandshakeResponse['handshake'];\n\nexport interface RegisterEncryptionKeyPayload {\n keyType: 'secp256k1' | 'ed25519' | 'x25519';\n publicKey: string;\n uaid?: string;\n ledgerAccountId?: string;\n ledgerNetwork?: string;\n email?: string;\n}\n\nexport type RegisterEncryptionKeyResponse = z.infer<\n typeof registerEncryptionKeyResponseSchema\n>;\n\nexport interface AgentRegistrationRequestMetadata {\n trustScore?: number;\n verified?: boolean;\n avgLatency?: number;\n uptime?: number;\n provider?: string;\n category?: string;\n adapter?: string;\n openConvAICompatible?: boolean;\n customFields?: Record<string, string | number | boolean>;\n nativeId?: string;\n tunnelUrl?: string;\n publicUrl?: string;\n payments?: JsonValue;\n [key: string]: JsonValue | undefined;\n}\n\nexport interface AgentRegistrationRequest {\n profile: JsonObject;\n endpoint?: string;\n protocol?: string;\n communicationProtocol?: string;\n registry?: string;\n additionalRegistries?: string[];\n metadata?: AgentRegistrationRequestMetadata;\n}\n\nexport interface AutoTopUpOptions {\n accountId: string;\n privateKey: string;\n memo?: string;\n}\n\nexport interface HistoryAutoTopUpOptions extends AutoTopUpOptions {\n hbarAmount?: number;\n}\n\nexport type GuardContractVersion = 1;\n\nexport const GUARD_CANONICAL_PATH_PREFIX = '/api/guard' as const;\nexport const GUARD_COMPAT_PATH_PREFIX = '/guard' as const;\n\nexport type GuardPlanId = z.infer<typeof guardPlanIdSchema>;\n\nexport type GuardPrincipal = z.infer<typeof guardPrincipalSchema>;\n\nexport type GuardEntitlements = z.infer<typeof guardEntitlementsSchema>;\n\nexport type GuardBucketBalance = z.infer<typeof guardBucketBalanceSchema>;\n\nexport type GuardSessionResponse = z.infer<typeof guardSessionResponseSchema>;\n\nexport type GuardBalanceResponse = z.infer<typeof guardBalanceResponseSchema>;\n\nexport type GuardFeedItem = z.infer<typeof guardFeedItemSchema>;\n\nexport type GuardFeedSummary = z.infer<typeof guardFeedSummarySchema>;\n\nexport type GuardFeedResponse = z.infer<typeof guardFeedResponseSchema>;\n\nexport type GuardOverviewResponse = z.infer<typeof guardOverviewResponseSchema>;\n\nexport type GuardPolicy = z.infer<typeof guardPolicySchema>;\n\nexport type GuardTrustMatch = z.infer<typeof guardTrustMatchSchema>;\n\nexport type GuardTrustByHashResponse = z.infer<\n typeof guardTrustByHashResponseSchema\n>;\n\nexport interface GuardTrustResolveQuery {\n ecosystem?: string;\n name?: string;\n version?: string;\n}\n\nexport type GuardTrustResolveResponse = z.infer<\n typeof guardTrustResolveResponseSchema\n>;\n\nexport type GuardRevocationResponse = z.infer<\n typeof guardRevocationResponseSchema\n>;\n\nexport type GuardReceipt = z.infer<typeof guardReceiptSchema>;\n\nexport interface GuardReceiptSyncPayload {\n receipts: GuardReceipt[];\n inventory?: GuardInventoryArtifact[];\n}\n\nexport type GuardReceiptSyncResponse = z.infer<\n typeof guardReceiptSyncResponseSchema\n>;\n\nexport type GuardHistoryArtifact = z.infer<typeof guardHistoryArtifactSchema>;\n\nexport type GuardReceiptHistoryResponse = z.infer<\n typeof guardReceiptHistoryResponseSchema\n>;\n\nexport type GuardInventoryArtifact = z.infer<\n typeof guardInventoryArtifactSchema\n>;\n\nexport type GuardInventoryResponse = z.infer<\n typeof guardInventoryResponseSchema\n>;\n\nexport type GuardInventoryDiffEntry = z.infer<\n typeof guardInventoryDiffEntrySchema\n>;\n\nexport type GuardInventoryDiffResponse = z.infer<\n typeof guardInventoryDiffResponseSchema\n>;\n\nexport type GuardAbomSummary = z.infer<typeof guardAbomSummarySchema>;\n\nexport type GuardAbomResponse = z.infer<typeof guardAbomResponseSchema>;\n\nexport type GuardTimelineEvent = z.infer<typeof guardTimelineEventSchema>;\n\nexport type GuardArtifactTimelineResponse = z.infer<\n typeof guardArtifactTimelineResponseSchema\n>;\n\nexport type GuardReceiptExportSummary = z.infer<\n typeof guardReceiptExportSummarySchema\n>;\n\nexport type GuardExportSignature = z.infer<typeof guardExportSignatureSchema>;\n\nexport type GuardReceiptExportResponse = z.infer<\n typeof guardReceiptExportResponseSchema\n>;\n\nexport type GuardAlertPreferences = z.infer<typeof guardAlertPreferencesSchema>;\n\nexport interface GuardAlertPreferencesUpdate {\n emailEnabled?: boolean;\n digestMode?: GuardAlertPreferences['digestMode'];\n watchlistEnabled?: boolean;\n advisoriesEnabled?: boolean;\n repeatedWarningsEnabled?: boolean;\n teamAlertsEnabled?: boolean;\n}\n\nexport type GuardWatchlistItem = z.infer<typeof guardWatchlistItemSchema>;\n\nexport type GuardWatchlistResponse = z.infer<\n typeof guardWatchlistResponseSchema\n>;\n\nexport type GuardWatchlistLookupResponse = z.infer<\n typeof guardWatchlistLookupResponseSchema\n>;\n\nexport type GuardPainSignal = z.infer<typeof guardPainSignalSchema>;\n\nexport type GuardPainSignalAggregate = z.infer<\n typeof guardPainSignalAggregateSchema\n>;\n\nexport type GuardPainSignalListResponse = z.infer<\n typeof guardPainSignalListResponseSchema\n>;\n\nexport type GuardPainSignalAggregateResponse = z.infer<\n typeof guardPainSignalAggregateResponseSchema\n>;\n\nexport type GuardPreflightEvidence = z.infer<\n typeof guardPreflightEvidenceSchema\n>;\n\nexport type GuardPreflightRequest = z.infer<typeof guardPreflightRequestSchema>;\n\nexport type GuardPreflightVerdictResponse = z.infer<\n typeof guardPreflightVerdictResponseSchema\n>;\n\nexport interface GuardPainSignalIngestItem {\n signalId: string;\n signalName: string;\n artifactId: string;\n artifactName: string;\n artifactType: GuardInventoryArtifact['artifactType'];\n harness: string;\n latestSummary: string;\n occurredAt: string;\n count?: number;\n source?: 'scanner';\n publisher?: string;\n}\n\nexport interface GuardWatchlistUpsert {\n artifactId: string;\n artifactName: string;\n artifactType: GuardInventoryArtifact['artifactType'];\n artifactSlug: string;\n reason: string;\n source: GuardWatchlistItem['source'];\n}\n\nexport type GuardExceptionScope = z.infer<\n typeof guardExceptionItemSchema\n>['scope'];\n\nexport type GuardExceptionSource = z.infer<\n typeof guardExceptionItemSchema\n>['source'];\n\nexport type GuardExceptionItem = z.infer<typeof guardExceptionItemSchema>;\n\nexport type GuardExceptionListResponse = z.infer<\n typeof guardExceptionListResponseSchema\n>;\n\nexport type GuardTeamPolicyAuditItem = z.infer<\n typeof guardTeamPolicyAuditItemSchema\n>;\n\nexport type GuardTeamPolicyPack = z.infer<typeof guardTeamPolicyPackSchema>;\n\nexport interface GuardTeamPolicyPackUpdate {\n name?: string;\n sharedHarnessDefaults?: GuardTeamPolicyPack['sharedHarnessDefaults'];\n allowedPublishers?: string[];\n blockedPublishers?: string[];\n blockedDomains?: string[];\n blockedArtifacts?: string[];\n alertChannel?: GuardTeamPolicyPack['alertChannel'];\n}\n\nexport type GuardDevice = z.infer<typeof guardDeviceSchema>;\n\nexport type GuardDeviceListResponse = z.infer<\n typeof guardDeviceListResponseSchema\n>;\n\nexport interface GuardExceptionUpsert {\n scope: GuardExceptionScope;\n harness?: string | null;\n artifactId?: string | null;\n publisher?: string | null;\n reason: string;\n owner: string;\n source: GuardExceptionSource;\n expiresAt: string;\n}\n\nexport interface RegisterAgentOptions {\n autoTopUp?: AutoTopUpOptions;\n}\n\nexport interface RegistrationProgressWaitOptions {\n intervalMs?: number;\n timeoutMs?: number;\n throwOnFailure?: boolean;\n onProgress?: (progress: RegistrationProgressRecord) => void;\n signal?: AbortSignal;\n}\n\nexport type AgentSearchHit = z.infer<\n typeof searchResponseSchema\n>['hits'][number];\n\nexport type AgentProfile = AgentSearchHit['profile'];\n\nexport type SearchResult = z.infer<typeof searchResponseSchema>;\n\nexport interface SearchParams {\n q?: string;\n page?: number;\n limit?: number;\n registry?: string;\n registries?: string[];\n capabilities?: string[];\n protocols?: string[];\n minTrust?: number;\n adapters?: string[];\n sortBy?: string;\n sortOrder?: 'asc' | 'desc' | string;\n type?: 'ai-agents' | 'mcp-servers' | 'all' | (string & {});\n verified?: boolean;\n online?: boolean;\n metadata?: Record<string, Array<string | number | boolean>>;\n}\n\nexport interface DelegationWorkspaceContext {\n openFiles?: string[];\n modifiedFiles?: string[];\n relatedPaths?: string[];\n errors?: string[];\n commands?: string[];\n languages?: string[];\n}\n\nexport interface DelegationPlanFilter {\n capabilities?: string[];\n type?: 'ai-agents' | 'mcp-servers';\n registry?: string;\n registries?: string[];\n protocols?: string[];\n adapters?: string[];\n verifiedOnly?: boolean;\n onlineOnly?: boolean;\n minTrust?: number;\n minTrustSignals?: Record<string, number>;\n metadata?: Record<string, Array<string | number | boolean>>;\n metadataRanges?: Record<string, { min?: number; max?: number }>;\n}\n\nexport interface DelegationPlanRequest {\n task: string;\n context?: string;\n workspace?: DelegationWorkspaceContext;\n limit?: number;\n filter?: DelegationPlanFilter;\n}\n\nexport type DelegationPlanCandidate = z.infer<\n typeof delegationPlanResponseSchema\n>['opportunities'][number]['candidates'][number];\n\nexport type DelegationOpportunity = z.infer<\n typeof delegationPlanResponseSchema\n>['opportunities'][number];\n\nexport type DelegationPlanResponse = z.infer<\n typeof delegationPlanResponseSchema\n>;\n\nexport type RegistryStatsResponse = z.infer<typeof statsResponseSchema>;\n\nexport type RegistriesResponse = z.infer<typeof registriesResponseSchema>;\n\nexport type PopularSearchesResponse = z.infer<typeof popularResponseSchema>;\n\nexport type ResolvedAgentResponse = z.infer<typeof resolveResponseSchema>;\n\nexport type CreateSessionResponse = z.infer<typeof createSessionResponseSchema>;\n\nexport type SendMessageResponse = z.infer<typeof sendMessageResponseSchema>;\nexport type SkillSecurityBreakdownResponse = z.infer<\n typeof skillSecurityBreakdownResponseSchema\n>;\nexport type ChatHistorySnapshotResponse = z.infer<\n typeof chatHistorySnapshotResponseSchema\n>;\nexport type ChatHistoryCompactionResponse = z.infer<\n typeof chatHistoryCompactionResponseSchema\n>;\n\nexport type AgentFeedbackResponse = z.infer<typeof agentFeedbackResponseSchema>;\nexport type AgentFeedbackEligibilityResponse = z.infer<\n typeof agentFeedbackEligibilityResponseSchema\n>;\nexport type AgentFeedbackSubmissionResponse = z.infer<\n typeof agentFeedbackSubmissionResponseSchema\n>;\nexport type AgentFeedbackIndexResponse = z.infer<\n typeof agentFeedbackIndexResponseSchema\n>;\n\nexport type VerificationStatusResponse = z.infer<\n typeof verificationStatusResponseSchema\n>;\nexport type VerificationChallengeResponse = z.infer<\n typeof verificationChallengeResponseSchema\n>;\nexport type VerificationChallengeDetailsResponse = z.infer<\n typeof verificationChallengeDetailsResponseSchema\n>;\nexport type VerificationVerifyResponse = z.infer<\n typeof verificationVerifyResponseSchema\n>;\nexport type VerificationOwnershipResponse = z.infer<\n typeof verificationOwnershipResponseSchema\n>;\nexport type VerificationVerifySenderResponse = z.infer<\n typeof verificationVerifySenderResponseSchema\n>;\nexport type VerificationDnsStatusResponse = z.infer<\n typeof verificationDnsStatusResponseSchema\n>;\n\nexport type RegisterStatusResponse = z.infer<\n typeof registerStatusResponseSchema\n>;\n\nexport type MoltbookOwnerRegistrationUpdateResponse = z.infer<\n typeof moltbookOwnerRegistrationUpdateResponseSchema\n>;\n\nexport type SkillRegistryFileDescriptor = z.infer<\n typeof skillRegistryFileDescriptorSchema\n>;\nexport type SkillRegistryPublishSummary = z.infer<\n typeof skillRegistryPublishSummarySchema\n>;\nexport type SkillRegistryListResponse = z.infer<\n typeof skillRegistryListResponseSchema\n>;\nexport type SkillRegistryMineResponse = z.infer<\n typeof skillRegistryMineResponseSchema\n>;\nexport type SkillRegistryMyListResponse = z.infer<\n typeof skillRegistryMyListResponseSchema\n>;\nexport type SkillRegistryQuoteResponse = z.infer<\n typeof skillRegistryQuoteResponseSchema\n>;\nexport type SkillRegistryPublishResponse = z.infer<\n typeof skillRegistryPublishResponseSchema\n>;\nexport type SkillRegistryJobStatusResponse = z.infer<\n typeof skillRegistryJobStatusResponseSchema\n>;\nexport type SkillRegistryConfigResponse = z.infer<\n typeof skillRegistryConfigResponseSchema\n>;\nexport type SkillCatalogChannel = z.infer<typeof skillCatalogChannelSchema>;\nexport type SkillCatalogSortBy = z.infer<typeof skillCatalogSortBySchema>;\nexport type SkillCatalogVersionSummary = z.infer<\n typeof skillCatalogVersionSummarySchema\n>;\nexport type SkillCatalogItem = z.infer<typeof skillCatalogItemSchema>;\nexport type SkillCatalogResponse = z.infer<typeof skillCatalogResponseSchema>;\nexport type SkillRecommendedVersionResponse = z.infer<\n typeof skillRecommendedVersionResponseSchema\n>;\nexport type SkillDeprecationRecord = z.infer<\n typeof skillDeprecationRecordSchema\n>;\nexport type SkillDeprecationsResponse = z.infer<\n typeof skillDeprecationsResponseSchema\n>;\nexport type SkillBadgeMetric = z.infer<typeof skillBadgeMetricSchema>;\nexport type SkillBadgeStyle = z.infer<typeof skillBadgeStyleSchema>;\nexport type SkillBadgeResponse = z.infer<typeof skillBadgeResponseSchema>;\nexport type SkillRegistryTagsResponse = z.infer<\n typeof skillRegistryTagsResponseSchema\n>;\nexport type SkillRegistryCategoriesResponse = z.infer<\n typeof skillRegistryCategoriesResponseSchema\n>;\nexport type SkillResolverManifestResponse = z.infer<\n typeof skillResolverManifestResponseSchema\n>;\nexport type SkillRegistryOwnershipResponse = z.infer<\n typeof skillRegistryOwnershipResponseSchema\n>;\nexport type SkillRegistryVersionsResponse = z.infer<\n typeof skillRegistryVersionsResponseSchema\n>;\nexport type SkillRegistryVoteStatusResponse = z.infer<\n typeof skillRegistryVoteStatusResponseSchema\n>;\nexport type SkillTrustTier = z.infer<typeof skillTrustTierSchema>;\nexport type SkillStatusNextStep = z.infer<typeof skillStatusNextStepSchema>;\nexport type SkillPreviewSuggestedNextStep = z.infer<\n typeof skillPreviewSuggestedNextStepSchema\n>;\nexport type SkillPreviewReport = z.infer<typeof skillPreviewReportSchema>;\nexport type SkillPreviewRecord = z.infer<typeof skillPreviewRecordSchema>;\nexport type SkillPreviewLookupResponse = z.infer<\n typeof skillPreviewLookupResponseSchema\n>;\nexport type SkillStatusPreviewMetadata = z.infer<\n typeof skillStatusPreviewMetadataSchema\n>;\nexport type SkillStatusChecks = z.infer<typeof skillStatusChecksSchema>;\nexport type SkillStatusVerificationSignals = z.infer<\n typeof skillStatusVerificationSignalsSchema\n>;\nexport type SkillStatusProvenanceSignals = z.infer<\n typeof skillStatusProvenanceSignalsSchema\n>;\nexport type SkillStatusResponse = z.infer<typeof skillStatusResponseSchema>;\nexport type SkillQuotePreviewRange = z.infer<\n typeof skillQuotePreviewRangeSchema\n>;\nexport type SkillQuotePreviewResponse = z.infer<\n typeof skillQuotePreviewResponseSchema\n>;\nexport type SkillConversionSignalsResponse = z.infer<\n typeof skillConversionSignalsResponseSchema\n>;\nexport type SkillInstallArtifactDescriptor = z.infer<\n typeof skillInstallArtifactDescriptorSchema\n>;\nexport type SkillInstallResolverDescriptor = z.infer<\n typeof skillInstallResolverDescriptorSchema\n>;\nexport type SkillInstallBadgeDescriptor = z.infer<\n typeof skillInstallBadgeDescriptorSchema\n>;\nexport type SkillInstallShareDescriptor = z.infer<\n typeof skillInstallShareDescriptorSchema\n>;\nexport type SkillInstallSnippetSet = z.infer<\n typeof skillInstallSnippetSetSchema\n>;\nexport type SkillInstallResponse = z.infer<typeof skillInstallResponseSchema>;\nexport type SkillInstallCopyTelemetryResponse = z.infer<\n typeof skillInstallCopyTelemetryResponseSchema\n>;\n\nexport type SkillVerificationRequestCreateResponse = z.infer<\n typeof skillVerificationRequestCreateResponseSchema\n>;\nexport type SkillVerificationStatusResponse = z.infer<\n typeof skillVerificationStatusResponseSchema\n>;\nexport type SkillVerificationDomainProofChallengeResponse = z.infer<\n typeof skillVerificationDomainProofChallengeResponseSchema\n>;\nexport type SkillVerificationDomainProofVerifyResponse = z.infer<\n typeof skillVerificationDomainProofVerifyResponseSchema\n>;\nexport type SkillVerificationRequest =\n SkillVerificationRequestCreateResponse['request'];\nexport type SkillVerificationTier = SkillVerificationRequest['tier'];\n\nexport type SkillRegistryFileRole =\n | 'skill-md'\n | 'skill-json'\n | 'skill-icon'\n | 'file';\n\nexport interface SkillRegistryFileInput {\n name: string;\n base64: string;\n mimeType?: string | null;\n role?: SkillRegistryFileRole | null;\n}\n\nexport interface SkillRegistryQuoteRequest {\n files: SkillRegistryFileInput[];\n directoryTopicId?: string;\n accountId?: string;\n}\n\nexport interface SkillListOptions {\n name?: string;\n version?: string;\n limit?: number;\n cursor?: string;\n includeFiles?: boolean;\n accountId?: string;\n q?: string;\n tag?: string;\n category?: string;\n featured?: boolean;\n verified?: boolean;\n view?: 'latest' | 'all';\n}\n\nexport interface SkillCatalogQueryOptions {\n q?: string;\n category?: string;\n tags?: string[];\n featured?: boolean;\n verified?: boolean;\n channel?: SkillCatalogChannel;\n sortBy?: SkillCatalogSortBy;\n limit?: number;\n cursor?: string;\n}\n\nexport interface SkillRegistryPublishRequest {\n files: SkillRegistryFileInput[];\n directoryTopicId?: string;\n accountId?: string;\n quoteId?: string;\n publisher?: string | null;\n}\n\nexport interface SkillRegistryVoteRequest {\n name: string;\n upvoted: boolean;\n}\n\nexport interface SkillSecurityBreakdownRequest {\n jobId: string;\n}\n\nexport interface SkillStatusRequest {\n name: string;\n version?: string;\n}\n\nexport interface SkillPreviewLookupRequest {\n name: string;\n version?: string;\n}\n\nexport interface SkillPreviewByRepoRequest {\n repo: string;\n skillDir: string;\n ref?: string;\n}\n\nexport interface SkillQuotePreviewRequest {\n fileCount: number;\n totalBytes: number;\n name?: string;\n version?: string;\n repoUrl?: string;\n skillDir?: string;\n}\n\nexport interface UploadSkillPreviewFromGithubOidcRequest {\n token: string;\n report: SkillPreviewReport;\n}\n\nexport interface SkillInstallCopyTelemetryRequest {\n source?: string;\n installType?:\n | 'cli'\n | 'skillmd'\n | 'manifest'\n | 'claude'\n | 'cursor'\n | 'codex'\n | 'openclaw';\n}\n\nexport interface SkillVerificationRequestCreateRequest {\n name: string;\n version?: string;\n tier: SkillVerificationTier;\n}\n\nexport interface SkillVerificationDomainProofChallengeRequest {\n name: string;\n version?: string;\n domain?: string;\n}\n\nexport interface SkillVerificationDomainProofVerifyRequest {\n name: string;\n version?: string;\n domain?: string;\n challengeToken: string;\n}\n\nexport interface SkillRecommendedVersionSetRequest {\n name: string;\n version: string;\n}\n\nexport interface SkillDeprecationSetRequest {\n name: string;\n version?: string;\n reason: string;\n replacementRef?: string;\n}\n\nexport interface SkillBadgeQuery {\n name: string;\n metric?: SkillBadgeMetric;\n label?: string;\n style?: SkillBadgeStyle;\n}\n\nexport interface MoltbookOwnerRegistrationUpdateRequest {\n registered?: boolean;\n name?: string;\n description?: string;\n endpoint?: string;\n metadata?: JsonObject;\n}\n\nexport interface VerificationDnsVerifyRequest {\n uaid: string;\n persist?: boolean;\n}\n\nexport interface VerificationDnsStatusQuery {\n refresh?: boolean;\n persist?: boolean;\n}\n\nexport type AgentFeedbackEntriesIndexResponse = z.infer<\n typeof agentFeedbackEntriesIndexResponseSchema\n>;\n\nexport interface AgentFeedbackQuery {\n includeRevoked?: boolean;\n}\n\nexport interface AgentFeedbackEligibilityRequest {\n sessionId: string;\n}\n\nexport interface AgentFeedbackSubmissionRequest {\n sessionId: string;\n score: number;\n tag1?: string;\n tag2?: string;\n fileUri?: string;\n fileHash?: string;\n}\n\nexport type RegisterAgentSuccessResponse = z.infer<\n typeof registerAgentSuccessResponseSchema\n>;\nexport type RegisterAgentPendingResponse = z.infer<\n typeof registerAgentPendingResponseSchema\n>;\nexport type RegisterAgentPartialResponse = z.infer<\n typeof registerAgentPartialResponseSchema\n>;\nexport type RegisterAgentResponse = z.infer<typeof registerAgentResponseSchema>;\n\nexport type RegistrationProgressAdditionalEntry = z.infer<\n typeof registrationProgressAdditionalEntrySchema\n>;\nexport type RegistrationProgressRecord = z.infer<\n typeof registrationProgressRecordSchema\n>;\nexport type RegistrationProgressResponse = z.infer<\n typeof registrationProgressResponseSchema\n>;\nexport type RegisterAgentQuoteResponse = z.infer<\n typeof registrationQuoteResponseSchema\n>;\nexport type CreditProviderSummary = z.infer<typeof creditProviderSummarySchema>;\nexport type CreditProvidersResponse = z.infer<\n typeof creditProvidersResponseSchema\n>;\nexport type CreditBalanceResponse = z.infer<typeof creditBalanceResponseSchema>;\nexport interface HbarPurchaseIntentRequest {\n accountId?: string;\n credits?: number;\n hbarAmount?: number;\n memo?: string;\n}\nexport type HbarPurchaseIntentResponse = z.infer<\n typeof hbarPurchaseIntentResponseSchema\n>;\nexport type CreditPurchaseResponse = z.infer<\n typeof creditPurchaseResponseSchema\n>;\nexport type X402CreditPurchaseResponse = z.infer<\n typeof x402CreditPurchaseResponseSchema\n>;\nexport type X402MinimumsResponse = z.infer<typeof x402MinimumsResponseSchema>;\nexport type AdditionalRegistryCatalogResponse = z.infer<\n typeof additionalRegistryCatalogResponseSchema\n>;\nexport type AdditionalRegistryDescriptor =\n AdditionalRegistryCatalogResponse['registries'][number];\nexport type AdditionalRegistryNetworkDescriptor =\n AdditionalRegistryDescriptor['networks'][number];\n\nexport type AdapterDetailsResponse = z.infer<\n typeof adapterDetailsResponseSchema\n>;\n\nexport interface LedgerChallengeRequest {\n accountId: string;\n network: string;\n}\n\nexport type LedgerChallengeResponse = z.infer<\n typeof ledgerChallengeResponseSchema\n>;\n\nexport interface LedgerAuthenticationSignerResult {\n signature: string;\n signatureKind?: 'raw' | 'map' | 'evm';\n publicKey?: string;\n}\n\nexport interface LedgerAuthenticationOptions extends LedgerChallengeRequest {\n signer?: Signer;\n sign?: (\n message: string,\n ) =>\n | LedgerAuthenticationSignerResult\n | Promise<LedgerAuthenticationSignerResult>;\n expiresInMinutes?: number;\n}\n\nexport interface LedgerVerifyRequest extends LedgerChallengeRequest {\n challengeId: string;\n signature: string;\n signatureKind?: 'raw' | 'map' | 'evm';\n publicKey?: string;\n expiresInMinutes?: number;\n}\n\nexport type LedgerVerifyResponse = z.infer<typeof ledgerVerifyResponseSchema>;\n\nexport interface LedgerAuthenticationLogger {\n info?: (message: string) => void;\n warn?: (message: string) => void;\n}\n\nexport interface LedgerCredentialAuthOptions {\n accountId: string;\n network: string;\n signer?: Signer;\n sign?: (\n message: string,\n ) =>\n | LedgerAuthenticationSignerResult\n | Promise<LedgerAuthenticationSignerResult>;\n hederaPrivateKey?: string;\n evmPrivateKey?: string;\n expiresInMinutes?: number;\n setAccountHeader?: boolean;\n label?: string;\n logger?: LedgerAuthenticationLogger;\n}\n\nexport type ProtocolsResponse = z.infer<typeof protocolsResponseSchema>;\n\nexport type DetectProtocolResponse = z.infer<\n typeof detectProtocolResponseSchema\n>;\n\nexport type ProtocolDetectionMessage = JsonObject;\n\nexport type RegistrySearchByNamespaceResponse = z.infer<\n typeof registrySearchByNamespaceSchema\n>;\n\nexport type WebsocketStatsResponse = z.infer<\n typeof websocketStatsResponseSchema\n>;\n\nexport type MetricsSummaryResponse = z.infer<\n typeof metricsSummaryResponseSchema\n>;\n\nexport type UaidValidationResponse = z.infer<\n typeof uaidValidationResponseSchema\n>;\n\nexport type UaidConnectionStatus = z.infer<typeof uaidConnectionStatusSchema>;\n\nexport type DashboardStatsResponse = z.infer<\n typeof dashboardStatsResponseSchema\n>;\n\nexport type VectorSearchFilter = z.infer<\n typeof vectorSearchRequestSchema\n>['filter'];\n\nexport type VectorSearchRequest = z.infer<typeof vectorSearchRequestSchema>;\n\nexport type VectorSearchResponse = z.infer<typeof vectorSearchResponseSchema>;\nexport type SearchStatusResponse = z.infer<typeof searchStatusResponseSchema>;\n\ntype CreateSessionBasePayload = {\n auth?: AgentAuthConfig;\n historyTtlSeconds?: number;\n encryptionRequested?: boolean;\n senderUaid?: string;\n};\n\nexport type CreateSessionRequestPayload =\n | (CreateSessionBasePayload & { uaid: string })\n | (CreateSessionBasePayload & { agentUrl: string });\n\nexport interface CompactHistoryRequestPayload {\n sessionId: string;\n preserveEntries?: number;\n}\n\nexport interface SendMessageEncryptionOptions\n extends Omit<EncryptCipherEnvelopeOptions, 'sessionId'> {\n sessionId?: string;\n}\n\nexport interface SendMessageBasePayload {\n message: string;\n streaming?: boolean;\n auth?: AgentAuthConfig;\n cipherEnvelope?: CipherEnvelope;\n encryption?: SendMessageEncryptionOptions;\n}\n\nexport interface StartEncryptedChatSessionOptions {\n uaid: string;\n senderUaid?: string;\n historyTtlSeconds?: number;\n handshakeTimeoutMs?: number;\n pollIntervalMs?: number;\n onSessionCreated?: (sessionId: string) => void;\n auth?: AgentAuthConfig;\n}\n\nexport interface AcceptEncryptedChatSessionOptions {\n sessionId: string;\n responderUaid?: string;\n handshakeTimeoutMs?: number;\n pollIntervalMs?: number;\n}\n\nexport interface EncryptedChatSendOptions {\n plaintext: string;\n message?: string;\n recipients?: Array<\n Pick<\n CipherEnvelopeRecipient,\n 'uaid' | 'ledgerAccountId' | 'userId' | 'email'\n >\n >;\n streaming?: boolean;\n auth?: AgentAuthConfig;\n}\n\nexport type ConversationMode = 'encrypted' | 'plaintext';\n\nexport interface DecryptedHistoryEntry {\n entry: ChatHistoryEntry;\n plaintext: string | null;\n}\n\nexport interface ChatConversationHandle {\n sessionId: string;\n mode: ConversationMode;\n summary?: SessionEncryptionSummary | null;\n send: (options: EncryptedChatSendOptions) => Promise<SendMessageResponse>;\n decryptHistoryEntry: (entry: ChatHistoryEntry) => string | null;\n fetchHistory: (\n options?: ChatHistoryFetchOptions,\n ) => Promise<DecryptedHistoryEntry[]>;\n}\n\nexport interface EncryptedChatSessionHandle extends ChatConversationHandle {\n summary: SessionEncryptionSummary;\n mode: 'encrypted';\n}\n\nexport type RecipientIdentity = Pick<\n CipherEnvelopeRecipient,\n 'uaid' | 'ledgerAccountId' | 'userId' | 'email'\n>;\n\nexport interface ChatHistoryFetchOptions {\n decrypt?: boolean;\n identity?: RecipientIdentity;\n sharedSecret?: SharedSecretInput;\n}\n\nexport type ChatHistorySnapshotWithDecryptedEntries =\n ChatHistorySnapshotResponse & {\n decryptedHistory?: DecryptedHistoryEntry[];\n };\n\nexport interface ConversationEncryptionOptions {\n preference?: 'preferred' | 'required' | 'disabled';\n handshakeTimeoutMs?: number;\n pollIntervalMs?: number;\n}\n\nexport interface StartConversationOptions {\n uaid: string;\n senderUaid?: string;\n historyTtlSeconds?: number;\n auth?: AgentAuthConfig;\n encryption?: ConversationEncryptionOptions;\n onSessionCreated?: (sessionId: string) => void;\n}\n\nexport interface AcceptConversationOptions {\n sessionId: string;\n responderUaid?: string;\n encryption?: ConversationEncryptionOptions;\n}\n\nexport interface StartChatBaseOptions {\n auth?: AgentAuthConfig;\n historyTtlSeconds?: number;\n encryption?: ConversationEncryptionOptions;\n senderUaid?: string;\n onSessionCreated?: (sessionId: string) => void;\n}\n\nexport type StartChatOptions =\n | (StartChatBaseOptions & { uaid: string; agentUrl?: never })\n | (StartChatBaseOptions & { agentUrl: string; uaid?: never });\n\nexport interface AutoRegisterEncryptionKeyOptions {\n enabled?: boolean;\n keyType?: 'secp256k1';\n publicKey?: string;\n privateKey?: string;\n envVar?: string;\n envPath?: string;\n generateIfMissing?: boolean;\n overwriteEnv?: boolean;\n uaid?: string;\n ledgerAccountId?: string;\n ledgerNetwork?: string;\n email?: string;\n label?: string;\n}\n\nexport interface ClientEncryptionOptions {\n autoRegister?: AutoRegisterEncryptionKeyOptions;\n autoDecryptHistory?: boolean;\n}\n\nexport interface EnsureAgentKeyOptions\n extends Omit<AutoRegisterEncryptionKeyOptions, 'enabled' | 'uaid'> {\n uaid: string;\n}\n\nexport interface InitializeAgentClientOptions\n extends RegistryBrokerClientOptions {\n uaid: string;\n ensureEncryptionKey?: boolean | EnsureAgentKeyOptions;\n}\n\nexport type SendMessageRequestPayload =\n | (SendMessageBasePayload & { uaid: string })\n | (SendMessageBasePayload & { sessionId: string })\n | (SendMessageBasePayload & { agentUrl: string; sessionId?: string });\n\nexport interface EncryptionHandshakeSubmissionPayload {\n role: 'requester' | 'responder';\n keyType: string;\n ephemeralPublicKey: string;\n longTermPublicKey?: string;\n signature?: string;\n uaid?: string;\n userId?: string;\n ledgerAccountId?: string;\n metadata?: Record<string, JsonValue>;\n}\nexport type AgentAuthType = 'bearer' | 'basic' | 'header' | 'apiKey';\n\nexport interface AgentAuthConfig {\n type?: AgentAuthType;\n token?: string;\n username?: string;\n password?: string;\n headerName?: string;\n headerValue?: string;\n headers?: Record<string, string>;\n}\n\nexport type AdaptersResponse = z.infer<typeof adaptersResponseSchema>;\n\nexport type AdapterRegistryCategory = z.infer<\n typeof adapterRegistryCategorySchema\n>;\n\nexport type AdapterRegistryCategoriesResponse = z.infer<\n typeof adapterRegistryCategoriesResponseSchema\n>;\n\nexport type AdapterRegistryAdaptersResponse = z.infer<\n typeof adapterRegistryAdaptersResponseSchema\n>;\n\nexport type AdapterRegistryCreateCategoryResponse = z.infer<\n typeof adapterRegistryCreateCategoryResponseSchema\n>;\n\nexport type AdapterRegistrySubmitAdapterResponse = z.infer<\n typeof adapterRegistrySubmitAdapterResponseSchema\n>;\n\nexport type AdapterRegistrySubmitAdapterAcceptedResponse = z.infer<\n typeof adapterRegistrySubmitAdapterAcceptedResponseSchema\n>;\n\nexport type AdapterRegistrySubmissionStatusResponse = z.infer<\n typeof adapterRegistrySubmissionStatusResponseSchema\n>;\n\nexport interface CreateAdapterRegistryCategoryRequest {\n name: string;\n description?: string;\n type?: 'adapter-type' | 'custom';\n slug?: string;\n metadata?: {\n version?: string;\n name?: string;\n description?: string;\n operator?: {\n account?: string;\n name?: string;\n contact?: string;\n };\n entityTypes?: string[];\n categories?: string[];\n tags?: string[];\n links?: Record<string, string>;\n };\n}\n\nexport interface SubmitAdapterRegistryAdapterRequest {\n adapterId: string;\n adapterName: string;\n entity: string;\n package: AdapterPackage;\n config: AdapterConfigContext;\n stateModel?: string;\n signature?: string;\n manifest: AdapterManifest;\n manifestPointer?: string;\n manifestSequence?: number;\n keywords?: string[];\n categorySlug?: string;\n newCategory?: CreateAdapterRegistryCategoryRequest;\n}\n\nexport type SearchFacetsResponse = z.infer<typeof searchFacetsResponseSchema>;\n"],"names":[],"mappings":"AAsTO,MAAM,8BAA8B;AACpC,MAAM,2BAA2B;"}
@@ -1,90 +1,84 @@
1
- const normalise = (value) => value.trim().toLowerCase();
2
- const HEDERA_NETWORK_ALIASES = /* @__PURE__ */ new Map([
3
- ["hedera:mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
4
- ["mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
5
- ["hedera-mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
6
- ["hedera_mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
7
- ["hedera:testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }],
8
- ["testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }],
9
- ["hedera-testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }],
10
- ["hedera_testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }]
11
- ]);
12
- const EVM_NETWORK_CHAIN_IDS = {
13
- abstract: 2741,
14
- "abstract-testnet": 11124,
15
- base: 8453,
16
- "base-sepolia": 84532,
17
- avalanche: 43114,
18
- "avalanche-fuji": 43113,
19
- iotex: 4689,
20
- sei: 1329,
21
- "sei-testnet": 1328,
22
- polygon: 137,
23
- "polygon-amoy": 80002,
24
- peaq: 3338
25
- };
26
- const CHAIN_ID_TO_ALIAS = new Map(
27
- Object.entries(EVM_NETWORK_CHAIN_IDS).map(([alias, id]) => [id, alias])
28
- );
29
- const parseChainId = (value) => {
30
- if (/^eip155:\d+$/i.test(value)) {
31
- return Number.parseInt(value.split(":")[1], 10);
1
+ import { optionalImportSync, optionalImport } from "./standards-sdk.es164.js";
2
+ const unsupported = (method) => new Error(`${method} is not supported by the in-memory signer`);
3
+ let cachedSdk = null;
4
+ const loadHashgraphSdk = () => {
5
+ if (cachedSdk) {
6
+ return cachedSdk;
32
7
  }
33
- if (/^\d+$/.test(value)) {
34
- return Number.parseInt(value, 10);
8
+ const resolved = optionalImportSync("@hashgraph/sdk");
9
+ if (resolved) {
10
+ cachedSdk = resolved;
11
+ return resolved;
35
12
  }
36
- return void 0;
13
+ const message = "@hashgraph/sdk is required for ledger signing. Install it as a dependency to enable createPrivateKeySigner.";
14
+ throw new Error(message);
37
15
  };
38
- const normaliseEvmNetwork = (value) => {
39
- const trimmed = normalise(value);
40
- let chainId = parseChainId(trimmed);
41
- let alias;
42
- if (chainId === void 0) {
43
- const mapped = EVM_NETWORK_CHAIN_IDS[trimmed];
44
- if (mapped !== void 0) {
45
- chainId = mapped;
46
- alias = trimmed;
47
- }
48
- } else if (CHAIN_ID_TO_ALIAS.has(chainId)) {
49
- alias = CHAIN_ID_TO_ALIAS.get(chainId);
16
+ const loadHashgraphSdkAsync = async () => {
17
+ if (cachedSdk) {
18
+ return cachedSdk;
50
19
  }
51
- if (chainId === void 0) {
52
- throw new Error(
53
- 'Unsupported EVM ledger network. Provide an alias like "base-sepolia" or a canonical eip155:<chainId> string.'
54
- );
20
+ const resolved = await optionalImport("@hashgraph/sdk");
21
+ if (resolved) {
22
+ cachedSdk = resolved;
23
+ return resolved;
55
24
  }
56
- return {
57
- canonical: `eip155:${chainId}`,
58
- kind: "evm",
59
- chainId,
60
- legacyName: alias
61
- };
25
+ const message = "@hashgraph/sdk is required for ledger signing. Install it as a dependency to enable createPrivateKeySigner.";
26
+ throw new Error(message);
62
27
  };
63
- const normaliseHederaNetwork = (value) => {
64
- const trimmed = normalise(value);
65
- const mapping = HEDERA_NETWORK_ALIASES.get(trimmed);
66
- if (!mapping) {
67
- throw new Error(
68
- 'Unsupported Hedera network. Use hedera:mainnet or hedera:testnet (legacy "mainnet"/"testnet" also accepted).'
69
- );
28
+ const buildSigner = (sdk, options) => {
29
+ const { AccountId, LedgerId, PrivateKey, SignerSignature } = sdk;
30
+ if (!options.privateKey) {
31
+ throw new Error("privateKey is required to create a ledger signer.");
32
+ }
33
+ if (!options.accountId) {
34
+ throw new Error("accountId is required to create a ledger signer.");
70
35
  }
36
+ const accountId = AccountId.fromString(options.accountId);
37
+ const privateKey = PrivateKey.fromString(options.privateKey);
38
+ const ledgerId = LedgerId.fromString(options.network);
71
39
  return {
72
- canonical: mapping.canonical,
73
- kind: "hedera",
74
- hederaNetwork: mapping.hederaNetwork
40
+ getLedgerId: () => ledgerId,
41
+ getAccountId: () => accountId,
42
+ getAccountKey: () => privateKey.publicKey,
43
+ getNetwork: () => ({}),
44
+ getMirrorNetwork: () => [],
45
+ sign: async (messages) => Promise.all(
46
+ messages.map(async (message) => {
47
+ const signature = await privateKey.sign(message);
48
+ return new SignerSignature({
49
+ publicKey: privateKey.publicKey,
50
+ signature,
51
+ accountId
52
+ });
53
+ })
54
+ ),
55
+ getAccountBalance: async () => {
56
+ throw unsupported("getAccountBalance");
57
+ },
58
+ getAccountInfo: async () => {
59
+ throw unsupported("getAccountInfo");
60
+ },
61
+ getAccountRecords: async () => {
62
+ throw unsupported("getAccountRecords");
63
+ },
64
+ signTransaction: async (_) => {
65
+ throw unsupported("signTransaction");
66
+ },
67
+ checkTransaction: async (_) => {
68
+ throw unsupported("checkTransaction");
69
+ },
70
+ populateTransaction: async (_) => {
71
+ throw unsupported("populateTransaction");
72
+ },
73
+ call: async (_request) => {
74
+ throw unsupported("call");
75
+ }
75
76
  };
76
77
  };
77
- const canonicalizeLedgerNetwork = (network) => {
78
- if (typeof network !== "string" || network.trim().length === 0) {
79
- throw new Error("Ledger network is required.");
80
- }
81
- const trimmed = normalise(network);
82
- if (trimmed.startsWith("hedera:") || trimmed.includes("hedera-") || trimmed.includes("hedera_") || trimmed === "mainnet" || trimmed === "testnet") {
83
- return normaliseHederaNetwork(trimmed);
84
- }
85
- return normaliseEvmNetwork(trimmed);
86
- };
78
+ const createPrivateKeySigner = (options) => buildSigner(loadHashgraphSdk(), options);
79
+ const createPrivateKeySignerAsync = async (options) => buildSigner(await loadHashgraphSdkAsync(), options);
87
80
  export {
88
- canonicalizeLedgerNetwork
81
+ createPrivateKeySigner,
82
+ createPrivateKeySignerAsync
89
83
  };
90
84
  //# sourceMappingURL=standards-sdk.es149.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es149.js","sources":["../../src/services/registry-broker/ledger-network.ts"],"sourcesContent":["type HederaNetwork = 'mainnet' | 'testnet';\ntype LedgerNetworkKind = 'hedera' | 'evm';\n\nexport interface CanonicalLedgerNetwork {\n canonical: string;\n kind: LedgerNetworkKind;\n hederaNetwork?: HederaNetwork;\n chainId?: number;\n legacyName?: string;\n}\n\nconst normalise = (value: string): string => value.trim().toLowerCase();\n\nconst HEDERA_NETWORK_ALIASES = new Map<\n string,\n { canonical: `hedera:${HederaNetwork}`; hederaNetwork: HederaNetwork }\n>([\n ['hedera:mainnet', { canonical: 'hedera:mainnet', hederaNetwork: 'mainnet' }],\n ['mainnet', { canonical: 'hedera:mainnet', hederaNetwork: 'mainnet' }],\n ['hedera-mainnet', { canonical: 'hedera:mainnet', hederaNetwork: 'mainnet' }],\n ['hedera_mainnet', { canonical: 'hedera:mainnet', hederaNetwork: 'mainnet' }],\n ['hedera:testnet', { canonical: 'hedera:testnet', hederaNetwork: 'testnet' }],\n ['testnet', { canonical: 'hedera:testnet', hederaNetwork: 'testnet' }],\n ['hedera-testnet', { canonical: 'hedera:testnet', hederaNetwork: 'testnet' }],\n ['hedera_testnet', { canonical: 'hedera:testnet', hederaNetwork: 'testnet' }],\n]);\n\nconst EVM_NETWORK_CHAIN_IDS: Record<string, number> = {\n abstract: 2741,\n 'abstract-testnet': 11124,\n base: 8453,\n 'base-sepolia': 84532,\n avalanche: 43114,\n 'avalanche-fuji': 43113,\n iotex: 4689,\n sei: 1329,\n 'sei-testnet': 1328,\n polygon: 137,\n 'polygon-amoy': 80002,\n peaq: 3338,\n};\n\nconst CHAIN_ID_TO_ALIAS = new Map<number, string>(\n Object.entries(EVM_NETWORK_CHAIN_IDS).map(([alias, id]) => [id, alias]),\n);\n\nconst parseChainId = (value: string): number | undefined => {\n if (/^eip155:\\d+$/i.test(value)) {\n return Number.parseInt(value.split(':')[1]!, 10);\n }\n if (/^\\d+$/.test(value)) {\n return Number.parseInt(value, 10);\n }\n return undefined;\n};\n\nconst normaliseEvmNetwork = (value: string): CanonicalLedgerNetwork => {\n const trimmed = normalise(value);\n let chainId = parseChainId(trimmed);\n let alias: string | undefined;\n\n if (chainId === undefined) {\n const mapped = EVM_NETWORK_CHAIN_IDS[trimmed];\n if (mapped !== undefined) {\n chainId = mapped;\n alias = trimmed;\n }\n } else if (CHAIN_ID_TO_ALIAS.has(chainId)) {\n alias = CHAIN_ID_TO_ALIAS.get(chainId);\n }\n\n if (chainId === undefined) {\n throw new Error(\n 'Unsupported EVM ledger network. Provide an alias like \"base-sepolia\" or a canonical eip155:<chainId> string.',\n );\n }\n\n return {\n canonical: `eip155:${chainId}`,\n kind: 'evm',\n chainId,\n legacyName: alias,\n };\n};\n\nconst normaliseHederaNetwork = (value: string): CanonicalLedgerNetwork => {\n const trimmed = normalise(value);\n const mapping = HEDERA_NETWORK_ALIASES.get(trimmed);\n if (!mapping) {\n throw new Error(\n 'Unsupported Hedera network. Use hedera:mainnet or hedera:testnet (legacy \"mainnet\"/\"testnet\" also accepted).',\n );\n }\n return {\n canonical: mapping.canonical,\n kind: 'hedera',\n hederaNetwork: mapping.hederaNetwork,\n };\n};\n\nexport const canonicalizeLedgerNetwork = (\n network: string,\n): CanonicalLedgerNetwork => {\n if (typeof network !== 'string' || network.trim().length === 0) {\n throw new Error('Ledger network is required.');\n }\n const trimmed = normalise(network);\n if (\n trimmed.startsWith('hedera:') ||\n trimmed.includes('hedera-') ||\n trimmed.includes('hedera_') ||\n trimmed === 'mainnet' ||\n trimmed === 'testnet'\n ) {\n return normaliseHederaNetwork(trimmed);\n }\n return normaliseEvmNetwork(trimmed);\n};\n"],"names":[],"mappings":"AAWA,MAAM,YAAY,CAAC,UAA0B,MAAM,KAAA,EAAO,YAAA;AAE1D,MAAM,6CAA6B,IAGjC;AAAA,EACA,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,WAAW,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EACrE,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,WAAW,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EACrE,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAC9E,CAAC;AAED,MAAM,wBAAgD;AAAA,EACpD,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,KAAK;AAAA,EACL,eAAe;AAAA,EACf,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,MAAM;AACR;AAEA,MAAM,oBAAoB,IAAI;AAAA,EAC5B,OAAO,QAAQ,qBAAqB,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC;AACxE;AAEA,MAAM,eAAe,CAAC,UAAsC;AAC1D,MAAI,gBAAgB,KAAK,KAAK,GAAG;AAC/B,WAAO,OAAO,SAAS,MAAM,MAAM,GAAG,EAAE,CAAC,GAAI,EAAE;AAAA,EACjD;AACA,MAAI,QAAQ,KAAK,KAAK,GAAG;AACvB,WAAO,OAAO,SAAS,OAAO,EAAE;AAAA,EAClC;AACA,SAAO;AACT;AAEA,MAAM,sBAAsB,CAAC,UAA0C;AACrE,QAAM,UAAU,UAAU,KAAK;AAC/B,MAAI,UAAU,aAAa,OAAO;AAClC,MAAI;AAEJ,MAAI,YAAY,QAAW;AACzB,UAAM,SAAS,sBAAsB,OAAO;AAC5C,QAAI,WAAW,QAAW;AACxB,gBAAU;AACV,cAAQ;AAAA,IACV;AAAA,EACF,WAAW,kBAAkB,IAAI,OAAO,GAAG;AACzC,YAAQ,kBAAkB,IAAI,OAAO;AAAA,EACvC;AAEA,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAEA,SAAO;AAAA,IACL,WAAW,UAAU,OAAO;AAAA,IAC5B,MAAM;AAAA,IACN;AAAA,IACA,YAAY;AAAA,EAAA;AAEhB;AAEA,MAAM,yBAAyB,CAAC,UAA0C;AACxE,QAAM,UAAU,UAAU,KAAK;AAC/B,QAAM,UAAU,uBAAuB,IAAI,OAAO;AAClD,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AACA,SAAO;AAAA,IACL,WAAW,QAAQ;AAAA,IACnB,MAAM;AAAA,IACN,eAAe,QAAQ;AAAA,EAAA;AAE3B;AAEO,MAAM,4BAA4B,CACvC,YAC2B;AAC3B,MAAI,OAAO,YAAY,YAAY,QAAQ,KAAA,EAAO,WAAW,GAAG;AAC9D,UAAM,IAAI,MAAM,6BAA6B;AAAA,EAC/C;AACA,QAAM,UAAU,UAAU,OAAO;AACjC,MACE,QAAQ,WAAW,SAAS,KAC5B,QAAQ,SAAS,SAAS,KAC1B,QAAQ,SAAS,SAAS,KAC1B,YAAY,aACZ,YAAY,WACZ;AACA,WAAO,uBAAuB,OAAO;AAAA,EACvC;AACA,SAAO,oBAAoB,OAAO;AACpC;"}
1
+ {"version":3,"file":"standards-sdk.es149.js","sources":["../../src/services/registry-broker/private-key-signer.ts"],"sourcesContent":["import type {\n Signer,\n AccountBalance,\n AccountInfo,\n Transaction,\n TransactionRecord,\n SignerSignature,\n} from '@hashgraph/sdk';\nimport { optionalImport, optionalImportSync } from '../../utils/dynamic-import';\n\nconst unsupported = (method: string): Error =>\n new Error(`${method} is not supported by the in-memory signer`);\n\nexport interface PrivateKeySignerOptions {\n accountId: string;\n privateKey: string;\n network: 'mainnet' | 'testnet';\n}\n\ntype HashgraphSdk = typeof import('@hashgraph/sdk');\n\nlet cachedSdk: HashgraphSdk | null = null;\n\nconst loadHashgraphSdk = (): HashgraphSdk => {\n if (cachedSdk) {\n return cachedSdk;\n }\n const resolved = optionalImportSync<HashgraphSdk>('@hashgraph/sdk');\n if (resolved) {\n cachedSdk = resolved;\n return resolved;\n }\n\n const message =\n '@hashgraph/sdk is required for ledger signing. Install it as a dependency to enable createPrivateKeySigner.';\n throw new Error(message);\n};\n\nconst loadHashgraphSdkAsync = async (): Promise<HashgraphSdk> => {\n if (cachedSdk) {\n return cachedSdk;\n }\n const resolved = await optionalImport<HashgraphSdk>('@hashgraph/sdk');\n if (resolved) {\n cachedSdk = resolved;\n return resolved;\n }\n const message =\n '@hashgraph/sdk is required for ledger signing. Install it as a dependency to enable createPrivateKeySigner.';\n throw new Error(message);\n};\n\nconst buildSigner = (\n sdk: HashgraphSdk,\n options: PrivateKeySignerOptions,\n): Signer => {\n const { AccountId, LedgerId, PrivateKey, SignerSignature } = sdk;\n if (!options.privateKey) {\n throw new Error('privateKey is required to create a ledger signer.');\n }\n if (!options.accountId) {\n throw new Error('accountId is required to create a ledger signer.');\n }\n const accountId = AccountId.fromString(options.accountId);\n const privateKey = PrivateKey.fromString(options.privateKey);\n const ledgerId = LedgerId.fromString(options.network);\n\n return {\n getLedgerId: () => ledgerId,\n getAccountId: () => accountId,\n getAccountKey: () => privateKey.publicKey,\n getNetwork: () => ({}),\n getMirrorNetwork: () => [],\n sign: async (messages: Uint8Array[]): Promise<SignerSignature[]> =>\n Promise.all(\n messages.map(async message => {\n const signature = await privateKey.sign(message);\n return new SignerSignature({\n publicKey: privateKey.publicKey,\n signature,\n accountId,\n });\n }),\n ),\n getAccountBalance: async (): Promise<AccountBalance> => {\n throw unsupported('getAccountBalance');\n },\n getAccountInfo: async (): Promise<AccountInfo> => {\n throw unsupported('getAccountInfo');\n },\n getAccountRecords: async (): Promise<TransactionRecord[]> => {\n throw unsupported('getAccountRecords');\n },\n signTransaction: async <T extends Transaction>(_: T): Promise<T> => {\n throw unsupported('signTransaction');\n },\n checkTransaction: async <T extends Transaction>(_: T): Promise<T> => {\n throw unsupported('checkTransaction');\n },\n populateTransaction: async <T extends Transaction>(_: T): Promise<T> => {\n throw unsupported('populateTransaction');\n },\n call: async <RequestT, ResponseT, OutputT>(\n _request: unknown,\n ): Promise<OutputT> => {\n throw unsupported('call');\n },\n };\n};\n\nexport const createPrivateKeySigner = (\n options: PrivateKeySignerOptions,\n): Signer => buildSigner(loadHashgraphSdk(), options);\n\nexport const createPrivateKeySignerAsync = async (\n options: PrivateKeySignerOptions,\n): Promise<Signer> => buildSigner(await loadHashgraphSdkAsync(), options);\n"],"names":[],"mappings":";AAUA,MAAM,cAAc,CAAC,WACnB,IAAI,MAAM,GAAG,MAAM,2CAA2C;AAUhE,IAAI,YAAiC;AAErC,MAAM,mBAAmB,MAAoB;AAC3C,MAAI,WAAW;AACb,WAAO;AAAA,EACT;AACA,QAAM,WAAW,mBAAiC,gBAAgB;AAClE,MAAI,UAAU;AACZ,gBAAY;AACZ,WAAO;AAAA,EACT;AAEA,QAAM,UACJ;AACF,QAAM,IAAI,MAAM,OAAO;AACzB;AAEA,MAAM,wBAAwB,YAAmC;AAC/D,MAAI,WAAW;AACb,WAAO;AAAA,EACT;AACA,QAAM,WAAW,MAAM,eAA6B,gBAAgB;AACpE,MAAI,UAAU;AACZ,gBAAY;AACZ,WAAO;AAAA,EACT;AACA,QAAM,UACJ;AACF,QAAM,IAAI,MAAM,OAAO;AACzB;AAEA,MAAM,cAAc,CAClB,KACA,YACW;AACX,QAAM,EAAE,WAAW,UAAU,YAAY,oBAAoB;AAC7D,MAAI,CAAC,QAAQ,YAAY;AACvB,UAAM,IAAI,MAAM,mDAAmD;AAAA,EACrE;AACA,MAAI,CAAC,QAAQ,WAAW;AACtB,UAAM,IAAI,MAAM,kDAAkD;AAAA,EACpE;AACA,QAAM,YAAY,UAAU,WAAW,QAAQ,SAAS;AACxD,QAAM,aAAa,WAAW,WAAW,QAAQ,UAAU;AAC3D,QAAM,WAAW,SAAS,WAAW,QAAQ,OAAO;AAEpD,SAAO;AAAA,IACL,aAAa,MAAM;AAAA,IACnB,cAAc,MAAM;AAAA,IACpB,eAAe,MAAM,WAAW;AAAA,IAChC,YAAY,OAAO,CAAA;AAAA,IACnB,kBAAkB,MAAM,CAAA;AAAA,IACxB,MAAM,OAAO,aACX,QAAQ;AAAA,MACN,SAAS,IAAI,OAAM,YAAW;AAC5B,cAAM,YAAY,MAAM,WAAW,KAAK,OAAO;AAC/C,eAAO,IAAI,gBAAgB;AAAA,UACzB,WAAW,WAAW;AAAA,UACtB;AAAA,UACA;AAAA,QAAA,CACD;AAAA,MACH,CAAC;AAAA,IAAA;AAAA,IAEL,mBAAmB,YAAqC;AACtD,YAAM,YAAY,mBAAmB;AAAA,IACvC;AAAA,IACA,gBAAgB,YAAkC;AAChD,YAAM,YAAY,gBAAgB;AAAA,IACpC;AAAA,IACA,mBAAmB,YAA0C;AAC3D,YAAM,YAAY,mBAAmB;AAAA,IACvC;AAAA,IACA,iBAAiB,OAA8B,MAAqB;AAClE,YAAM,YAAY,iBAAiB;AAAA,IACrC;AAAA,IACA,kBAAkB,OAA8B,MAAqB;AACnE,YAAM,YAAY,kBAAkB;AAAA,IACtC;AAAA,IACA,qBAAqB,OAA8B,MAAqB;AACtE,YAAM,YAAY,qBAAqB;AAAA,IACzC;AAAA,IACA,MAAM,OACJ,aACqB;AACrB,YAAM,YAAY,MAAM;AAAA,IAC1B;AAAA,EAAA;AAEJ;AAEO,MAAM,yBAAyB,CACpC,YACW,YAAY,iBAAA,GAAoB,OAAO;AAE7C,MAAM,8BAA8B,OACzC,YACoB,YAAY,MAAM,sBAAA,GAAyB,OAAO;"}
@@ -1,63 +1,90 @@
1
- const HOL_CHAT_PROTOCOL_ID = "hol-chat";
2
- const isRecord = (value) => Boolean(value) && typeof value === "object" && !Array.isArray(value);
3
- const isHolChatOp = (value) => {
4
- if (!isRecord(value)) {
5
- return false;
1
+ const normalise = (value) => value.trim().toLowerCase();
2
+ const HEDERA_NETWORK_ALIASES = /* @__PURE__ */ new Map([
3
+ ["hedera:mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
4
+ ["mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
5
+ ["hedera-mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
6
+ ["hedera_mainnet", { canonical: "hedera:mainnet", hederaNetwork: "mainnet" }],
7
+ ["hedera:testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }],
8
+ ["testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }],
9
+ ["hedera-testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }],
10
+ ["hedera_testnet", { canonical: "hedera:testnet", hederaNetwork: "testnet" }]
11
+ ]);
12
+ const EVM_NETWORK_CHAIN_IDS = {
13
+ abstract: 2741,
14
+ "abstract-testnet": 11124,
15
+ base: 8453,
16
+ "base-sepolia": 84532,
17
+ avalanche: 43114,
18
+ "avalanche-fuji": 43113,
19
+ iotex: 4689,
20
+ sei: 1329,
21
+ "sei-testnet": 1328,
22
+ polygon: 137,
23
+ "polygon-amoy": 80002,
24
+ peaq: 3338
25
+ };
26
+ const CHAIN_ID_TO_ALIAS = new Map(
27
+ Object.entries(EVM_NETWORK_CHAIN_IDS).map(([alias, id]) => [id, alias])
28
+ );
29
+ const parseChainId = (value) => {
30
+ if (/^eip155:\d+$/i.test(value)) {
31
+ return Number.parseInt(value.split(":")[1], 10);
6
32
  }
7
- if (value.p !== HOL_CHAT_PROTOCOL_ID) {
8
- return false;
33
+ if (/^\d+$/.test(value)) {
34
+ return Number.parseInt(value, 10);
9
35
  }
10
- if (typeof value.request_id !== "string" || value.request_id.trim().length === 0) {
11
- return false;
36
+ return void 0;
37
+ };
38
+ const normaliseEvmNetwork = (value) => {
39
+ const trimmed = normalise(value);
40
+ let chainId = parseChainId(trimmed);
41
+ let alias;
42
+ if (chainId === void 0) {
43
+ const mapped = EVM_NETWORK_CHAIN_IDS[trimmed];
44
+ if (mapped !== void 0) {
45
+ chainId = mapped;
46
+ alias = trimmed;
47
+ }
48
+ } else if (CHAIN_ID_TO_ALIAS.has(chainId)) {
49
+ alias = CHAIN_ID_TO_ALIAS.get(chainId);
12
50
  }
13
- const op = value.op;
14
- if (op !== "payment_request" && op !== "payment_approve" && op !== "payment_decline" && op !== "payment_result" && op !== "job_status") {
15
- return false;
51
+ if (chainId === void 0) {
52
+ throw new Error(
53
+ 'Unsupported EVM ledger network. Provide an alias like "base-sepolia" or a canonical eip155:<chainId> string.'
54
+ );
16
55
  }
17
- return true;
56
+ return {
57
+ canonical: `eip155:${chainId}`,
58
+ kind: "evm",
59
+ chainId,
60
+ legacyName: alias
61
+ };
18
62
  };
19
- const parseHolChatOps = (ops) => {
20
- if (!Array.isArray(ops)) {
21
- return [];
63
+ const normaliseHederaNetwork = (value) => {
64
+ const trimmed = normalise(value);
65
+ const mapping = HEDERA_NETWORK_ALIASES.get(trimmed);
66
+ if (!mapping) {
67
+ throw new Error(
68
+ 'Unsupported Hedera network. Use hedera:mainnet or hedera:testnet (legacy "mainnet"/"testnet" also accepted).'
69
+ );
22
70
  }
23
- return ops.filter(isHolChatOp).map((op) => {
24
- const next = {
25
- p: HOL_CHAT_PROTOCOL_ID,
26
- op: op.op,
27
- request_id: op.request_id.trim()
28
- };
29
- if (typeof op.m === "string" && op.m.trim().length > 0) {
30
- next.m = op.m.trim();
31
- }
32
- if (isRecord(op.data)) {
33
- next.data = { ...op.data };
34
- }
35
- return next;
36
- });
71
+ return {
72
+ canonical: mapping.canonical,
73
+ kind: "hedera",
74
+ hederaNetwork: mapping.hederaNetwork
75
+ };
76
+ };
77
+ const canonicalizeLedgerNetwork = (network) => {
78
+ if (typeof network !== "string" || network.trim().length === 0) {
79
+ throw new Error("Ledger network is required.");
80
+ }
81
+ const trimmed = normalise(network);
82
+ if (trimmed.startsWith("hedera:") || trimmed.includes("hedera-") || trimmed.includes("hedera_") || trimmed === "mainnet" || trimmed === "testnet") {
83
+ return normaliseHederaNetwork(trimmed);
84
+ }
85
+ return normaliseEvmNetwork(trimmed);
37
86
  };
38
- const buildPaymentApproveMessage = (input) => JSON.stringify({
39
- p: HOL_CHAT_PROTOCOL_ID,
40
- op: "payment_approve",
41
- request_id: input.requestId,
42
- data: { job_id: input.jobId }
43
- });
44
- const buildPaymentDeclineMessage = (input) => JSON.stringify({
45
- p: HOL_CHAT_PROTOCOL_ID,
46
- op: "payment_decline",
47
- request_id: input.requestId
48
- });
49
- const buildJobStatusMessage = (input) => JSON.stringify({
50
- p: HOL_CHAT_PROTOCOL_ID,
51
- op: "job_status",
52
- request_id: input.requestId,
53
- data: { job_id: input.jobId }
54
- });
55
87
  export {
56
- HOL_CHAT_PROTOCOL_ID,
57
- buildJobStatusMessage,
58
- buildPaymentApproveMessage,
59
- buildPaymentDeclineMessage,
60
- isHolChatOp,
61
- parseHolChatOps
88
+ canonicalizeLedgerNetwork
62
89
  };
63
90
  //# sourceMappingURL=standards-sdk.es150.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"standards-sdk.es150.js","sources":["../../src/services/registry-broker/hol-chat-ops.ts"],"sourcesContent":["export const HOL_CHAT_PROTOCOL_ID = 'hol-chat' as const;\n\nexport type HolChatOpName =\n | 'payment_request'\n | 'payment_approve'\n | 'payment_decline'\n | 'payment_result'\n | 'job_status';\n\nexport interface HolChatOpBase {\n p: typeof HOL_CHAT_PROTOCOL_ID;\n op: HolChatOpName;\n request_id: string;\n m?: string;\n data?: Record<string, unknown>;\n}\n\nexport type HolChatOp = HolChatOpBase;\n\nconst isRecord = (value: unknown): value is Record<string, unknown> =>\n Boolean(value) && typeof value === 'object' && !Array.isArray(value);\n\nexport const isHolChatOp = (value: unknown): value is HolChatOp => {\n if (!isRecord(value)) {\n return false;\n }\n if (value.p !== HOL_CHAT_PROTOCOL_ID) {\n return false;\n }\n if (\n typeof value.request_id !== 'string' ||\n value.request_id.trim().length === 0\n ) {\n return false;\n }\n const op = value.op;\n if (\n op !== 'payment_request' &&\n op !== 'payment_approve' &&\n op !== 'payment_decline' &&\n op !== 'payment_result' &&\n op !== 'job_status'\n ) {\n return false;\n }\n return true;\n};\n\nexport const parseHolChatOps = (ops: unknown): HolChatOp[] => {\n if (!Array.isArray(ops)) {\n return [];\n }\n return ops.filter(isHolChatOp).map(op => {\n const next: HolChatOp = {\n p: HOL_CHAT_PROTOCOL_ID,\n op: op.op,\n request_id: op.request_id.trim(),\n };\n if (typeof op.m === 'string' && op.m.trim().length > 0) {\n next.m = op.m.trim();\n }\n if (isRecord(op.data)) {\n next.data = { ...op.data };\n }\n return next;\n });\n};\n\nexport const buildPaymentApproveMessage = (input: {\n requestId: string;\n jobId: number;\n}): string =>\n JSON.stringify({\n p: HOL_CHAT_PROTOCOL_ID,\n op: 'payment_approve',\n request_id: input.requestId,\n data: { job_id: input.jobId },\n });\n\nexport const buildPaymentDeclineMessage = (input: {\n requestId: string;\n}): string =>\n JSON.stringify({\n p: HOL_CHAT_PROTOCOL_ID,\n op: 'payment_decline',\n request_id: input.requestId,\n });\n\nexport const buildJobStatusMessage = (input: {\n requestId: string;\n jobId: number;\n}): string =>\n JSON.stringify({\n p: HOL_CHAT_PROTOCOL_ID,\n op: 'job_status',\n request_id: input.requestId,\n data: { job_id: input.jobId },\n });\n"],"names":[],"mappings":"AAAO,MAAM,uBAAuB;AAmBpC,MAAM,WAAW,CAAC,UAChB,QAAQ,KAAK,KAAK,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK;AAE9D,MAAM,cAAc,CAAC,UAAuC;AACjE,MAAI,CAAC,SAAS,KAAK,GAAG;AACpB,WAAO;AAAA,EACT;AACA,MAAI,MAAM,MAAM,sBAAsB;AACpC,WAAO;AAAA,EACT;AACA,MACE,OAAO,MAAM,eAAe,YAC5B,MAAM,WAAW,KAAA,EAAO,WAAW,GACnC;AACA,WAAO;AAAA,EACT;AACA,QAAM,KAAK,MAAM;AACjB,MACE,OAAO,qBACP,OAAO,qBACP,OAAO,qBACP,OAAO,oBACP,OAAO,cACP;AACA,WAAO;AAAA,EACT;AACA,SAAO;AACT;AAEO,MAAM,kBAAkB,CAAC,QAA8B;AAC5D,MAAI,CAAC,MAAM,QAAQ,GAAG,GAAG;AACvB,WAAO,CAAA;AAAA,EACT;AACA,SAAO,IAAI,OAAO,WAAW,EAAE,IAAI,CAAA,OAAM;AACvC,UAAM,OAAkB;AAAA,MACtB,GAAG;AAAA,MACH,IAAI,GAAG;AAAA,MACP,YAAY,GAAG,WAAW,KAAA;AAAA,IAAK;AAEjC,QAAI,OAAO,GAAG,MAAM,YAAY,GAAG,EAAE,KAAA,EAAO,SAAS,GAAG;AACtD,WAAK,IAAI,GAAG,EAAE,KAAA;AAAA,IAChB;AACA,QAAI,SAAS,GAAG,IAAI,GAAG;AACrB,WAAK,OAAO,EAAE,GAAG,GAAG,KAAA;AAAA,IACtB;AACA,WAAO;AAAA,EACT,CAAC;AACH;AAEO,MAAM,6BAA6B,CAAC,UAIzC,KAAK,UAAU;AAAA,EACb,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,YAAY,MAAM;AAAA,EAClB,MAAM,EAAE,QAAQ,MAAM,MAAA;AACxB,CAAC;AAEI,MAAM,6BAA6B,CAAC,UAGzC,KAAK,UAAU;AAAA,EACb,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,YAAY,MAAM;AACpB,CAAC;AAEI,MAAM,wBAAwB,CAAC,UAIpC,KAAK,UAAU;AAAA,EACb,GAAG;AAAA,EACH,IAAI;AAAA,EACJ,YAAY,MAAM;AAAA,EAClB,MAAM,EAAE,QAAQ,MAAM,MAAA;AACxB,CAAC;"}
1
+ {"version":3,"file":"standards-sdk.es150.js","sources":["../../src/services/registry-broker/ledger-network.ts"],"sourcesContent":["type HederaNetwork = 'mainnet' | 'testnet';\ntype LedgerNetworkKind = 'hedera' | 'evm';\n\nexport interface CanonicalLedgerNetwork {\n canonical: string;\n kind: LedgerNetworkKind;\n hederaNetwork?: HederaNetwork;\n chainId?: number;\n legacyName?: string;\n}\n\nconst normalise = (value: string): string => value.trim().toLowerCase();\n\nconst HEDERA_NETWORK_ALIASES = new Map<\n string,\n { canonical: `hedera:${HederaNetwork}`; hederaNetwork: HederaNetwork }\n>([\n ['hedera:mainnet', { canonical: 'hedera:mainnet', hederaNetwork: 'mainnet' }],\n ['mainnet', { canonical: 'hedera:mainnet', hederaNetwork: 'mainnet' }],\n ['hedera-mainnet', { canonical: 'hedera:mainnet', hederaNetwork: 'mainnet' }],\n ['hedera_mainnet', { canonical: 'hedera:mainnet', hederaNetwork: 'mainnet' }],\n ['hedera:testnet', { canonical: 'hedera:testnet', hederaNetwork: 'testnet' }],\n ['testnet', { canonical: 'hedera:testnet', hederaNetwork: 'testnet' }],\n ['hedera-testnet', { canonical: 'hedera:testnet', hederaNetwork: 'testnet' }],\n ['hedera_testnet', { canonical: 'hedera:testnet', hederaNetwork: 'testnet' }],\n]);\n\nconst EVM_NETWORK_CHAIN_IDS: Record<string, number> = {\n abstract: 2741,\n 'abstract-testnet': 11124,\n base: 8453,\n 'base-sepolia': 84532,\n avalanche: 43114,\n 'avalanche-fuji': 43113,\n iotex: 4689,\n sei: 1329,\n 'sei-testnet': 1328,\n polygon: 137,\n 'polygon-amoy': 80002,\n peaq: 3338,\n};\n\nconst CHAIN_ID_TO_ALIAS = new Map<number, string>(\n Object.entries(EVM_NETWORK_CHAIN_IDS).map(([alias, id]) => [id, alias]),\n);\n\nconst parseChainId = (value: string): number | undefined => {\n if (/^eip155:\\d+$/i.test(value)) {\n return Number.parseInt(value.split(':')[1]!, 10);\n }\n if (/^\\d+$/.test(value)) {\n return Number.parseInt(value, 10);\n }\n return undefined;\n};\n\nconst normaliseEvmNetwork = (value: string): CanonicalLedgerNetwork => {\n const trimmed = normalise(value);\n let chainId = parseChainId(trimmed);\n let alias: string | undefined;\n\n if (chainId === undefined) {\n const mapped = EVM_NETWORK_CHAIN_IDS[trimmed];\n if (mapped !== undefined) {\n chainId = mapped;\n alias = trimmed;\n }\n } else if (CHAIN_ID_TO_ALIAS.has(chainId)) {\n alias = CHAIN_ID_TO_ALIAS.get(chainId);\n }\n\n if (chainId === undefined) {\n throw new Error(\n 'Unsupported EVM ledger network. Provide an alias like \"base-sepolia\" or a canonical eip155:<chainId> string.',\n );\n }\n\n return {\n canonical: `eip155:${chainId}`,\n kind: 'evm',\n chainId,\n legacyName: alias,\n };\n};\n\nconst normaliseHederaNetwork = (value: string): CanonicalLedgerNetwork => {\n const trimmed = normalise(value);\n const mapping = HEDERA_NETWORK_ALIASES.get(trimmed);\n if (!mapping) {\n throw new Error(\n 'Unsupported Hedera network. Use hedera:mainnet or hedera:testnet (legacy \"mainnet\"/\"testnet\" also accepted).',\n );\n }\n return {\n canonical: mapping.canonical,\n kind: 'hedera',\n hederaNetwork: mapping.hederaNetwork,\n };\n};\n\nexport const canonicalizeLedgerNetwork = (\n network: string,\n): CanonicalLedgerNetwork => {\n if (typeof network !== 'string' || network.trim().length === 0) {\n throw new Error('Ledger network is required.');\n }\n const trimmed = normalise(network);\n if (\n trimmed.startsWith('hedera:') ||\n trimmed.includes('hedera-') ||\n trimmed.includes('hedera_') ||\n trimmed === 'mainnet' ||\n trimmed === 'testnet'\n ) {\n return normaliseHederaNetwork(trimmed);\n }\n return normaliseEvmNetwork(trimmed);\n};\n"],"names":[],"mappings":"AAWA,MAAM,YAAY,CAAC,UAA0B,MAAM,KAAA,EAAO,YAAA;AAE1D,MAAM,6CAA6B,IAGjC;AAAA,EACA,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,WAAW,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EACrE,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,WAAW,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EACrE,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAAA,EAC5E,CAAC,kBAAkB,EAAE,WAAW,kBAAkB,eAAe,WAAW;AAC9E,CAAC;AAED,MAAM,wBAAgD;AAAA,EACpD,UAAU;AAAA,EACV,oBAAoB;AAAA,EACpB,MAAM;AAAA,EACN,gBAAgB;AAAA,EAChB,WAAW;AAAA,EACX,kBAAkB;AAAA,EAClB,OAAO;AAAA,EACP,KAAK;AAAA,EACL,eAAe;AAAA,EACf,SAAS;AAAA,EACT,gBAAgB;AAAA,EAChB,MAAM;AACR;AAEA,MAAM,oBAAoB,IAAI;AAAA,EAC5B,OAAO,QAAQ,qBAAqB,EAAE,IAAI,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,IAAI,KAAK,CAAC;AACxE;AAEA,MAAM,eAAe,CAAC,UAAsC;AAC1D,MAAI,gBAAgB,KAAK,KAAK,GAAG;AAC/B,WAAO,OAAO,SAAS,MAAM,MAAM,GAAG,EAAE,CAAC,GAAI,EAAE;AAAA,EACjD;AACA,MAAI,QAAQ,KAAK,KAAK,GAAG;AACvB,WAAO,OAAO,SAAS,OAAO,EAAE;AAAA,EAClC;AACA,SAAO;AACT;AAEA,MAAM,sBAAsB,CAAC,UAA0C;AACrE,QAAM,UAAU,UAAU,KAAK;AAC/B,MAAI,UAAU,aAAa,OAAO;AAClC,MAAI;AAEJ,MAAI,YAAY,QAAW;AACzB,UAAM,SAAS,sBAAsB,OAAO;AAC5C,QAAI,WAAW,QAAW;AACxB,gBAAU;AACV,cAAQ;AAAA,IACV;AAAA,EACF,WAAW,kBAAkB,IAAI,OAAO,GAAG;AACzC,YAAQ,kBAAkB,IAAI,OAAO;AAAA,EACvC;AAEA,MAAI,YAAY,QAAW;AACzB,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AAEA,SAAO;AAAA,IACL,WAAW,UAAU,OAAO;AAAA,IAC5B,MAAM;AAAA,IACN;AAAA,IACA,YAAY;AAAA,EAAA;AAEhB;AAEA,MAAM,yBAAyB,CAAC,UAA0C;AACxE,QAAM,UAAU,UAAU,KAAK;AAC/B,QAAM,UAAU,uBAAuB,IAAI,OAAO;AAClD,MAAI,CAAC,SAAS;AACZ,UAAM,IAAI;AAAA,MACR;AAAA,IAAA;AAAA,EAEJ;AACA,SAAO;AAAA,IACL,WAAW,QAAQ;AAAA,IACnB,MAAM;AAAA,IACN,eAAe,QAAQ;AAAA,EAAA;AAE3B;AAEO,MAAM,4BAA4B,CACvC,YAC2B;AAC3B,MAAI,OAAO,YAAY,YAAY,QAAQ,KAAA,EAAO,WAAW,GAAG;AAC9D,UAAM,IAAI,MAAM,6BAA6B;AAAA,EAC/C;AACA,QAAM,UAAU,UAAU,OAAO;AACjC,MACE,QAAQ,WAAW,SAAS,KAC5B,QAAQ,SAAS,SAAS,KAC1B,QAAQ,SAAS,SAAS,KAC1B,YAAY,aACZ,YAAY,WACZ;AACA,WAAO,uBAAuB,OAAO;AAAA,EACvC;AACA,SAAO,oBAAoB,OAAO;AACpC;"}