@pkcprotocol/pkc-js 0.0.75 → 0.0.77

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 (178) hide show
  1. package/README.md +10 -0
  2. package/dist/browser/clients/rpc-client/pkc-rpc-client.d.ts +3 -1
  3. package/dist/browser/clients/rpc-client/pkc-rpc-client.js +12 -1
  4. package/dist/browser/clients/rpc-client/pkc-rpc-client.js.map +1 -1
  5. package/dist/browser/clients/rpc-client/rpc-schema-util.d.ts +18 -0
  6. package/dist/browser/clients/rpc-client/rpc-schema-util.js +5 -1
  7. package/dist/browser/clients/rpc-client/rpc-schema-util.js.map +1 -1
  8. package/dist/browser/clients/rpc-client/schema.d.ts +15 -0
  9. package/dist/browser/clients/rpc-client/schema.js +20 -0
  10. package/dist/browser/clients/rpc-client/schema.js.map +1 -1
  11. package/dist/browser/clients/rpc-client/types.d.ts +3 -2
  12. package/dist/browser/community/community-client-manager.js +9 -9
  13. package/dist/browser/community/community-client-manager.js.map +1 -1
  14. package/dist/browser/community/rpc-local-community.d.ts +6 -1
  15. package/dist/browser/community/rpc-local-community.js +32 -0
  16. package/dist/browser/community/rpc-local-community.js.map +1 -1
  17. package/dist/browser/community/schema.d.ts +15 -0
  18. package/dist/browser/community/schema.js +16 -1
  19. package/dist/browser/community/schema.js.map +1 -1
  20. package/dist/browser/community/types.d.ts +14 -1
  21. package/dist/browser/constants.d.ts +3 -1
  22. package/dist/browser/constants.js +9 -1
  23. package/dist/browser/constants.js.map +1 -1
  24. package/dist/browser/errors.d.ts +11 -1
  25. package/dist/browser/errors.js +11 -1
  26. package/dist/browser/errors.js.map +1 -1
  27. package/dist/browser/generated-version.d.ts +1 -1
  28. package/dist/browser/generated-version.js +1 -1
  29. package/dist/browser/index-with-compile-cache.d.ts +2 -0
  30. package/dist/browser/index-with-compile-cache.js +1 -0
  31. package/dist/browser/index-with-compile-cache.js.map +1 -1
  32. package/dist/browser/index.d.ts +3 -0
  33. package/dist/browser/index.js +8 -0
  34. package/dist/browser/index.js.map +1 -1
  35. package/dist/browser/pkc/pkc.js +37 -3
  36. package/dist/browser/pkc/pkc.js.map +1 -1
  37. package/dist/browser/pkc-error.d.ts +1 -1
  38. package/dist/browser/rpc/src/index.d.ts +4 -1
  39. package/dist/browser/rpc/src/index.js +29 -1
  40. package/dist/browser/rpc/src/index.js.map +1 -1
  41. package/dist/browser/rpc/src/lib/pkc-js/index.d.ts +1 -0
  42. package/dist/browser/runtime/node/community/local-community/anchor-publishing.d.ts +9 -0
  43. package/dist/browser/runtime/node/community/local-community/anchor-publishing.js +197 -0
  44. package/dist/browser/runtime/node/community/local-community/anchor-publishing.js.map +1 -0
  45. package/dist/browser/runtime/node/community/local-community/cleanup.d.ts +2 -1
  46. package/dist/browser/runtime/node/community/local-community/cleanup.js +81 -30
  47. package/dist/browser/runtime/node/community/local-community/cleanup.js.map +1 -1
  48. package/dist/browser/runtime/node/community/local-community/comment-updates.js +5 -0
  49. package/dist/browser/runtime/node/community/local-community/comment-updates.js.map +1 -1
  50. package/dist/browser/runtime/node/community/local-community/db-state.js +22 -4
  51. package/dist/browser/runtime/node/community/local-community/db-state.js.map +1 -1
  52. package/dist/browser/runtime/node/community/local-community/identity.d.ts +2 -0
  53. package/dist/browser/runtime/node/community/local-community/identity.js +13 -0
  54. package/dist/browser/runtime/node/community/local-community/identity.js.map +1 -0
  55. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js +11 -28
  56. package/dist/browser/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  57. package/dist/browser/runtime/node/community/local-community/lifecycle.js +24 -0
  58. package/dist/browser/runtime/node/community/local-community/lifecycle.js.map +1 -1
  59. package/dist/browser/runtime/node/community/local-community/publication-store.js +7 -3
  60. package/dist/browser/runtime/node/community/local-community/publication-store.js.map +1 -1
  61. package/dist/browser/runtime/node/community/local-community/publication-validation.js +6 -2
  62. package/dist/browser/runtime/node/community/local-community/publication-validation.js.map +1 -1
  63. package/dist/browser/runtime/node/community/local-community.d.ts +5 -1
  64. package/dist/browser/runtime/node/community/local-community.js +47 -6
  65. package/dist/browser/runtime/node/community/local-community.js.map +1 -1
  66. package/dist/browser/runtime/node/setup-kubo-address-rewriter-and-http-router.js +21 -3
  67. package/dist/browser/runtime/node/setup-kubo-address-rewriter-and-http-router.js.map +1 -1
  68. package/dist/browser/schema/schema-util.d.ts +6 -0
  69. package/dist/browser/schema/schema.d.ts +1 -0
  70. package/dist/browser/schema/schema.js +11 -0
  71. package/dist/browser/schema/schema.js.map +1 -1
  72. package/dist/browser/signer/index.d.ts +1 -0
  73. package/dist/browser/signer/index.js +1 -0
  74. package/dist/browser/signer/index.js.map +1 -1
  75. package/dist/browser/signer/ipns-record.d.ts +7 -0
  76. package/dist/browser/signer/ipns-record.js +34 -0
  77. package/dist/browser/signer/ipns-record.js.map +1 -0
  78. package/dist/browser/signer/signatures.d.ts +2 -2
  79. package/dist/browser/signer/signatures.js +18 -6
  80. package/dist/browser/signer/signatures.js.map +1 -1
  81. package/dist/browser/test/test-util.d.ts +4 -0
  82. package/dist/browser/util.js +13 -4
  83. package/dist/browser/util.js.map +1 -1
  84. package/dist/bundled/bundle-manifest.json +43 -38
  85. package/dist/bundled/chunks/{helia-for-pkc-BPj1zAUb.js → helia-for-pkc-HklWh03v.js} +3 -3
  86. package/dist/bundled/chunks/{local-community-D4efR9XJ.js → local-community-BIjlDWkC.js} +235 -50
  87. package/dist/bundled/chunks/{local-community-ChTkd8lH.js → local-community-CVm32rYh.js} +1 -1
  88. package/dist/bundled/chunks/{node-BK6GBM0d.js → node-tGwhcLcm.js} +48 -10
  89. package/dist/bundled/chunks/{rpc-local-community-O94vseOA.js → rpc-local-community-BmD9viua.js} +74 -16
  90. package/dist/bundled/chunks/{schema-wNdSno5O.js → schema-Bu4z3MGE.js} +32 -8
  91. package/dist/bundled/chunks/{util-iNnH2bP5.js → util-DIVqZjOO.js} +1 -1
  92. package/dist/bundled/index-with-compile-cache.js +2 -1
  93. package/dist/bundled/index.js +2 -2
  94. package/dist/bundled/rpc/src/index.js +27 -4
  95. package/dist/node/clients/rpc-client/pkc-rpc-client.d.ts +3 -1
  96. package/dist/node/clients/rpc-client/pkc-rpc-client.js +12 -1
  97. package/dist/node/clients/rpc-client/pkc-rpc-client.js.map +1 -1
  98. package/dist/node/clients/rpc-client/rpc-schema-util.d.ts +18 -0
  99. package/dist/node/clients/rpc-client/rpc-schema-util.js +5 -1
  100. package/dist/node/clients/rpc-client/rpc-schema-util.js.map +1 -1
  101. package/dist/node/clients/rpc-client/schema.d.ts +15 -0
  102. package/dist/node/clients/rpc-client/schema.js +20 -0
  103. package/dist/node/clients/rpc-client/schema.js.map +1 -1
  104. package/dist/node/clients/rpc-client/types.d.ts +3 -2
  105. package/dist/node/community/community-client-manager.js +9 -9
  106. package/dist/node/community/community-client-manager.js.map +1 -1
  107. package/dist/node/community/rpc-local-community.d.ts +6 -1
  108. package/dist/node/community/rpc-local-community.js +32 -0
  109. package/dist/node/community/rpc-local-community.js.map +1 -1
  110. package/dist/node/community/schema.d.ts +15 -0
  111. package/dist/node/community/schema.js +16 -1
  112. package/dist/node/community/schema.js.map +1 -1
  113. package/dist/node/community/types.d.ts +14 -1
  114. package/dist/node/constants.d.ts +3 -1
  115. package/dist/node/constants.js +9 -1
  116. package/dist/node/constants.js.map +1 -1
  117. package/dist/node/errors.d.ts +11 -1
  118. package/dist/node/errors.js +11 -1
  119. package/dist/node/errors.js.map +1 -1
  120. package/dist/node/generated-version.d.ts +1 -1
  121. package/dist/node/generated-version.js +1 -1
  122. package/dist/node/index-with-compile-cache.d.ts +2 -0
  123. package/dist/node/index-with-compile-cache.js +1 -0
  124. package/dist/node/index-with-compile-cache.js.map +1 -1
  125. package/dist/node/index.d.ts +3 -0
  126. package/dist/node/index.js +8 -0
  127. package/dist/node/index.js.map +1 -1
  128. package/dist/node/pkc/pkc.js +37 -3
  129. package/dist/node/pkc/pkc.js.map +1 -1
  130. package/dist/node/pkc-error.d.ts +1 -1
  131. package/dist/node/rpc/src/index.d.ts +4 -1
  132. package/dist/node/rpc/src/index.js +29 -1
  133. package/dist/node/rpc/src/index.js.map +1 -1
  134. package/dist/node/rpc/src/lib/pkc-js/index.d.ts +1 -0
  135. package/dist/node/runtime/node/community/local-community/anchor-publishing.d.ts +9 -0
  136. package/dist/node/runtime/node/community/local-community/anchor-publishing.js +197 -0
  137. package/dist/node/runtime/node/community/local-community/anchor-publishing.js.map +1 -0
  138. package/dist/node/runtime/node/community/local-community/cleanup.d.ts +2 -1
  139. package/dist/node/runtime/node/community/local-community/cleanup.js +81 -30
  140. package/dist/node/runtime/node/community/local-community/cleanup.js.map +1 -1
  141. package/dist/node/runtime/node/community/local-community/comment-updates.js +5 -0
  142. package/dist/node/runtime/node/community/local-community/comment-updates.js.map +1 -1
  143. package/dist/node/runtime/node/community/local-community/db-state.js +22 -4
  144. package/dist/node/runtime/node/community/local-community/db-state.js.map +1 -1
  145. package/dist/node/runtime/node/community/local-community/identity.d.ts +2 -0
  146. package/dist/node/runtime/node/community/local-community/identity.js +13 -0
  147. package/dist/node/runtime/node/community/local-community/identity.js.map +1 -0
  148. package/dist/node/runtime/node/community/local-community/ipns-publishing.js +11 -28
  149. package/dist/node/runtime/node/community/local-community/ipns-publishing.js.map +1 -1
  150. package/dist/node/runtime/node/community/local-community/lifecycle.js +24 -0
  151. package/dist/node/runtime/node/community/local-community/lifecycle.js.map +1 -1
  152. package/dist/node/runtime/node/community/local-community/publication-store.js +7 -3
  153. package/dist/node/runtime/node/community/local-community/publication-store.js.map +1 -1
  154. package/dist/node/runtime/node/community/local-community/publication-validation.js +6 -2
  155. package/dist/node/runtime/node/community/local-community/publication-validation.js.map +1 -1
  156. package/dist/node/runtime/node/community/local-community.d.ts +5 -1
  157. package/dist/node/runtime/node/community/local-community.js +47 -6
  158. package/dist/node/runtime/node/community/local-community.js.map +1 -1
  159. package/dist/node/runtime/node/setup-kubo-address-rewriter-and-http-router.js +21 -3
  160. package/dist/node/runtime/node/setup-kubo-address-rewriter-and-http-router.js.map +1 -1
  161. package/dist/node/schema/schema-util.d.ts +6 -0
  162. package/dist/node/schema/schema.d.ts +1 -0
  163. package/dist/node/schema/schema.js +11 -0
  164. package/dist/node/schema/schema.js.map +1 -1
  165. package/dist/node/signer/index.d.ts +1 -0
  166. package/dist/node/signer/index.js +1 -0
  167. package/dist/node/signer/index.js.map +1 -1
  168. package/dist/node/signer/ipns-record.d.ts +7 -0
  169. package/dist/node/signer/ipns-record.js +34 -0
  170. package/dist/node/signer/ipns-record.js.map +1 -0
  171. package/dist/node/signer/signatures.d.ts +2 -2
  172. package/dist/node/signer/signatures.js +18 -6
  173. package/dist/node/signer/signatures.js.map +1 -1
  174. package/dist/node/test/test-util.d.ts +4 -0
  175. package/dist/node/util.js +13 -4
  176. package/dist/node/util.js.map +1 -1
  177. package/package.json +2 -2
  178. package/dist/bundled/chunks/{src-BKg5Lhod.js → src-BEjAH2gY.js} +1 -1
@@ -1,7 +1,7 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { B as isIpfsCid, Cn as CommentUpdateForChallengeVerificationSchema, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dt as refreshTrackedCommentAliases, E as createAbortError, En as CommentUpdateSchema, Et as listUpdatingCommunities, Fr as stringifyPrimitive, H as isIpns, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Nr as joinValues, Pr as parsedType, Pt as untrackUpdatingComment, Q as isStringDomain, Qn as n$1, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, Sr as setErrorMap, St as findUpdatingComment, Tt as listUpdatingComments, Xn as n$2, _r as PKCError, _t as timestamp, a as ChallengeRequestMessageSchema, b as areEquivalentCommunityAddresses, br as require_supports_color, cn as PubsubTopicSchema, ct as resolveWhenPredicateIsTrue, dr as require_retry, er as t$1, fr as FailedToFetchCommentIpfsFromGatewaysError, ft as shortifyAddress, ir as r, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, mt as sleepUntilTimeoutOrAbort, nn as CommunityIpfsSchema, nr as e$1, ot as removeUndefinedValuesRecursively, pt as shortifyCid, r as ChallengeMessageSchema, s as ChallengeVerificationMessageSchema, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as e, ut as retryKuboIpfsAdd, vn as CommentIpfsSchema, vr as messages, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wt as listStartedCommunities, xt as findStartedCommunity, y as version_default, yr as logger_default, z as isAbortError } from "./schema-wNdSno5O.js";
3
- import { $ as RepliesPages, $n as t$5, $t as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, An as RpcCidParamSchema, At as verifyCommunityEdit, B as setNativeFunctions$1, Bn as RpcFetchCidResultSchema, Bt as getCommunityPublicKeyFromWire, Cn as parseRpcCommentEventWithPKCErrorIfItFails, Ct as verifyChallengeVerification, D as createKuboRpcClient, Dn as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Dt as verifyCommentPubsubMessage, Et as verifyCommentModeration, Fn as RpcExportCommunityModLogsParamSchema, Gn as RpcUnsubscribeParamSchema, H as CommentClientsManager, Hn as RpcResolveAuthorNameResultSchema, Ht as decode, I as listCommunitiesSync, In as RpcExportCommunityModLogsResultSchema, It as normalizeCreatePublicationAuthor, Kn as t$4, L as monitorCommunitiesDirectory, Ln as RpcExportCommunityParamSchema, Lt as buildRuntimeCommunityFields, Mn as RpcCommunityIdentifierParamSchema, Mt as buildRuntimeAuthor, N as getDefaultDataPath, Nn as RpcCommunityPageParamSchema, Nt as cleanWireAuthor, On as RpcAuthorNameParamSchema, Ot as verifyCommentUpdate, Pn as RpcEditCommunityParamSchema, Pt as getAuthorNameFromRuntime, Q as parseRawPages, Qn as t$2, Rn as RpcExportCommunityResultSchema, Rt as getCommunityAddressFromRecord, Sn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Tn as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Tt as verifyCommentIpfs, Un as RpcSubscriptionIdResultSchema, V as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Vn as RpcPublishChallengeAnswersParamSchema, Vt as normalizeCommunityInputFromCommunity, Wn as RpcSuccessResultSchema, Wt as getBufferedPKCAddressFromPublicKey, X as findCommentInPageInstanceRecursively, Xn as n$3, Xt as parseCidStringSchemaWithPKCErrorIfItFails, Y as extractCommunityRuntimeFieldsFromParsedPages, Yn as t$3, _n as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, at as PKCTypedEmitter, bn as parseDecryptedChallengeWithPKCErrorIfItFails, c as AddressesRewriterProxyServer, ct as signChallengeAnswer, dn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, en as parseCommentIpfsSchemaWithPKCErrorIfItFails, et as PublicationClientsManager, f as KeyvBetterSqlite3, fn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, ft as signComment, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, hn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, in as parseCommunityAddressWithPKCErrorIfItFails, ir as require_undici, jn as RpcCommentRepliesPageParamSchema, jt as verifyVote, kn as RpcCancelExportParamSchema, ln as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, m as decodeRpcChallengePubsubMsg, mt as signCommentModeration, n as RpcRemoteCommunity, nn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, nt as InflightFetchManager, o as TrackedInstanceRegistry, ot as require_lib$1, p as decodeRpcChallengeAnswerPubsubMsg, pt as signCommentEdit, qt as getPKCAddressFromPublicKeySync, rn as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, rr as nativeFunctions$2, s as LRUCache, sn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, st as cleanUpBeforePublishing, t as RpcLocalCommunity, tt as PKCClientsManager, u as RemoteCommunity, un as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, ut as signChallengeRequest, v as createSigner, vn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, vt as signCommunityEdit, wn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, wt as verifyCommentEdit, x as encryptEd25519AesGcm, xn as parseJsonWithPKCErrorIfFails, xt as verifyChallengeMessage, y as decryptEd25519AesGcm, yn as parseDecryptedChallengeVerification, yt as signVote, zn as RpcFetchCidParamSchema, zt as getCommunityNameFromWire } from "./rpc-local-community-O94vseOA.js";
4
- import { o as getHeliaDebugContext } from "./util-iNnH2bP5.js";
2
+ import { $n as n$1, B as isIpfsCid, Cr as setErrorMap, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dn as CommentUpdateSchema, Dt as refreshTrackedCommentAliases, E as createAbortError, Et as listUpdatingCommunities, Fr as parsedType, H as isIpns, Ir as stringifyPrimitive, It as require_sha256, L as hideClassPrivateProps, Lt as TimeoutError, Pr as joinValues, Pt as untrackUpdatingComment, Q as isStringDomain, Qt as CommunityAnchorSchema, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, St as findUpdatingComment, Tt as listUpdatingComments, Zn as n$2, _t as timestamp, a as ChallengeRequestMessageSchema, ar as r, b as areEquivalentCommunityAddresses, br as logger_default, ct as resolveWhenPredicateIsTrue, fr as require_retry, ft as shortifyAddress, jt as trackUpdatingComment, k as doesDomainAddressHaveCapitalLetter, ln as PubsubTopicSchema, mt as sleepUntilTimeoutOrAbort, nr as e, ot as removeUndefinedValuesRecursively, pr as FailedToFetchCommentIpfsFromGatewaysError, pt as shortifyCid, r as ChallengeMessageSchema, rn as CommunityIpfsSchema, rr as e$1, s as ChallengeVerificationMessageSchema, st as replaceXWithY, t as ChallengeAnswerMessageSchema, tr as t$1, ut as retryKuboIpfsAdd, vr as PKCError, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wn as CommentUpdateForChallengeVerificationSchema, wt as listStartedCommunities, xr as require_supports_color, xt as findStartedCommunity, y as version_default, yn as CommentIpfsSchema, yr as messages, z as isAbortError } from "./schema-Bu4z3MGE.js";
3
+ import { $ as parseRawPages, $n as t$3, An as RpcAuthorNameParamSchema, Bn as RpcExportCommunityResultSchema, Bt as getCommunityNameFromWire, Cn as parsePKCUserOptionsSchemaWithPKCErrorIfItFails, Dt as verifyCommentModeration, En as parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails, Et as verifyCommentIpfs, Fn as RpcCommunityPageParamSchema, Ft as getAuthorNameFromRuntime, Gn as RpcPublishedAnchorRecordResultSchema, Gt as getBufferedPKCAddressFromPublicKey, H as tryToDeleteCommunitiesThatFailedToBeDeletedBefore, Hn as RpcFetchCidResultSchema, Ht as normalizeCommunityInputFromCommunity, In as RpcEditCommunityParamSchema, Jn as RpcSuccessResultSchema, Jt as getPKCAddressFromPublicKeySync, Kn as RpcResolveAuthorNameResultSchema, L as listCommunitiesSync, Ln as RpcExportCommunityModLogsParamSchema, Lt as normalizeCreatePublicationAuthor, Mn as RpcCidParamSchema, Mt as verifyVote, Nn as RpcCommentRepliesPageParamSchema, Nt as buildRuntimeAuthor, O as createKuboRpcClient, On as parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails, Ot as verifyCommentPubsubMessage, P as getDefaultDataPath, Pn as RpcCommunityIdentifierParamSchema, Pt as cleanWireAuthor, R as monitorCommunitiesDirectory, Rn as RpcExportCommunityModLogsResultSchema, Rt as buildRuntimeCommunityFields, S as encryptEd25519AesGcm, Sn as parseJsonWithPKCErrorIfFails, St as verifyChallengeMessage, Tn as parseRpcCommentUpdateEventWithPKCErrorIfItFails, Tt as verifyCommentEdit, U as CommentClientsManager, Un as RpcPublishAnchorRecordParamSchema, Ut as decode, V as setNativeFunctions$1, Vn as RpcFetchCidParamSchema, Vt as getCommunityPublicKeyFromWire, Wn as RpcPublishChallengeAnswersParamSchema, X as extractCommunityRuntimeFieldsFromParsedPages, Xn as t$4, Yn as RpcUnsubscribeParamSchema, Z as findCommentInPageInstanceRecursively, Zt as parseCidStringSchemaWithPKCErrorIfItFails, _n as parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, a as pkcJsChallenges, an as parseCommunityAddressWithPKCErrorIfItFails, b as decryptEd25519AesGcm, bn as parseDecryptedChallengeVerification, bt as signVote, c as AddressesRewriterProxyServer, cn as parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, cr as require_undici, ct as cleanUpBeforePublishing, dn as parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails, dt as signChallengeRequest, en as parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails, er as n$3, et as RepliesPages, f as KeyvBetterSqlite3, fn as parseCreateCommentOptionsSchemaWithPKCErrorIfItFails, g as decodeRpcChallengeVerificationPubsubMsg, gn as parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails, h as decodeRpcChallengeRequestPubsubMsg, ht as signCommentModeration, in as parseCommentPubsubMessagePublicationWithPKCErrorIfItFails, jn as RpcCancelExportParamSchema, jt as verifyCommunityEdit, kn as RpcAnchorPublishPreparationResultSchema, kt as verifyCommentUpdate, lt as signChallengeAnswer, m as decodeRpcChallengePubsubMsg, mt as signCommentEdit, n as RpcRemoteCommunity, nr as t$2, nt as PKCClientsManager, o as TrackedInstanceRegistry, ot as PKCTypedEmitter, p as decodeRpcChallengeAnswerPubsubMsg, pn as parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails, pt as signComment, qn as RpcSubscriptionIdResultSchema, rn as parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails, rr as t$5, rt as InflightFetchManager, s as LRUCache, sr as nativeFunctions$2, st as require_lib$1, t as RpcLocalCommunity, tn as parseCommentIpfsSchemaWithPKCErrorIfItFails, tt as PublicationClientsManager, u as RemoteCommunity, un as parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails, v as createSigner, vn as parseCreateVoteOptionsSchemaWithPKCErrorIfItFails, wn as parseRpcCommentEventWithPKCErrorIfItFails, wt as verifyChallengeVerification, xn as parseDecryptedChallengeWithPKCErrorIfItFails, y as createAnchorIpnsRecord$1, yn as parseDecryptedChallengeAnswerWithPKCErrorIfItFails, yt as signCommunityEdit, zn as RpcExportCommunityParamSchema, zt as getCommunityAddressFromRecord } from "./rpc-local-community-BmD9viua.js";
4
+ import { o as getHeliaDebugContext } from "./util-DIVqZjOO.js";
5
5
  import path from "path";
6
6
  import assert from "assert";
7
7
  import fs from "fs";
@@ -2118,6 +2118,9 @@ const parseRpcResolveAuthorNameResult = (result) => RpcResolveAuthorNameResultSc
2118
2118
  const parseRpcFetchCidResult = (result) => RpcFetchCidResultSchema.loose().parse(result);
2119
2119
  const parseRpcSuccessResult = (result) => RpcSuccessResultSchema.loose().parse(result);
2120
2120
  const parseRpcSubscriptionIdResult = (result) => RpcSubscriptionIdResultSchema.loose().parse(result);
2121
+ const parseRpcPublishAnchorRecordParam = (params) => RpcPublishAnchorRecordParamSchema.loose().parse(params);
2122
+ const parseRpcAnchorPublishPreparationResult = (result) => RpcAnchorPublishPreparationResultSchema.loose().parse(result);
2123
+ const parseRpcPublishedAnchorRecordResult = (result) => RpcPublishedAnchorRecordResultSchema.loose().parse(result);
2121
2124
  const parseRpcExportCommunityParam = (params) => RpcExportCommunityParamSchema.loose().parse(params);
2122
2125
  const parseRpcCancelExportParam = (params) => RpcCancelExportParamSchema.loose().parse(params);
2123
2126
  const parseRpcExportCommunityResult = (result) => RpcExportCommunityResultSchema.loose().parse(result);
@@ -2363,6 +2366,14 @@ var PKCRpcClient = class extends import_lib.TypedEmitter {
2363
2366
  const parsedStopCommunityArgs = parseRpcCommunityIdentifierParam(communityIdentifier);
2364
2367
  return parseRpcSuccessResult(await this._webSocketClient.call("stopCommunity", [parsedStopCommunityArgs]));
2365
2368
  }
2369
+ async prepareAnchorPublish(communityIdentifier) {
2370
+ const parsedArgs = parseRpcCommunityIdentifierParam(communityIdentifier);
2371
+ return parseRpcAnchorPublishPreparationResult(await this._webSocketClient.call("prepareAnchorPublish", [parsedArgs]));
2372
+ }
2373
+ async publishAnchorRecord(args) {
2374
+ const parsedArgs = parseRpcPublishAnchorRecordParam(args);
2375
+ return parseRpcPublishedAnchorRecordResult(await this._webSocketClient.call("publishAnchorRecord", [parsedArgs]));
2376
+ }
2366
2377
  async editCommunity(args) {
2367
2378
  parseRpcEditCommunityParam(args);
2368
2379
  const wireArgs = {
@@ -8516,6 +8527,7 @@ var import_tcp_port_used = /* @__PURE__ */ __toESM((/* @__PURE__ */ __commonJSMi
8516
8527
  return deferred.promise;
8517
8528
  }
8518
8529
  })))(), 1);
8530
+ const MAX_TCP_PORT = 65535;
8519
8531
  function _mergeRouterConfigs(existingConfig, newConfig) {
8520
8532
  if (!existingConfig?.Routers) return newConfig;
8521
8533
  const existingRoutersByEndpoint = /* @__PURE__ */ new Map();
@@ -8647,7 +8659,8 @@ async function setupKuboAddressesRewriterAndHttpRouters(pkc) {
8647
8659
  logger_default("pkc-js:node:setupKuboAddressesRewriterAndHttpRouters");
8648
8660
  const httpRouterProxyUrls = [];
8649
8661
  const proxyServers = [];
8650
- let addressesRewriterStartPort = 19575;
8662
+ const parsedStartPortOverride = Number(process.env.PKC_ADDRESSES_REWRITER_START_PORT);
8663
+ let addressesRewriterStartPort = Number.isInteger(parsedStartPortOverride) && parsedStartPortOverride > 0 && parsedStartPortOverride <= MAX_TCP_PORT ? parsedStartPortOverride : 19575;
8651
8664
  for (const httpRouter of pkc.httpRoutersOptions) {
8652
8665
  if (pkc.destroyed) break;
8653
8666
  const startedProxyUrl = await _getStartedProxyUrl(pkc, httpRouter);
@@ -8657,7 +8670,10 @@ async function setupKuboAddressesRewriterAndHttpRouters(pkc) {
8657
8670
  }
8658
8671
  let port = addressesRewriterStartPort;
8659
8672
  const hostname = "127.0.0.1";
8660
- while (await import_tcp_port_used.check(port, hostname)) port++;
8673
+ while (await import_tcp_port_used.check(port, hostname)) {
8674
+ port++;
8675
+ if (port > MAX_TCP_PORT) throw Error(`No free loopback port for the addresses rewriter proxy between ${addressesRewriterStartPort} and ${MAX_TCP_PORT}`);
8676
+ }
8661
8677
  const addressesRewriterProxyServer = new AddressesRewriterProxyServer({
8662
8678
  kuboClients: Object.values(pkc.clients.kuboRpcClients).map((kubo) => kubo._client),
8663
8679
  port,
@@ -8901,7 +8917,7 @@ var PKC$1 = class extends PKCTypedEmitter {
8901
8917
  this.clients.libp2pJsClients = {};
8902
8918
  if (!this.libp2pJsClientsOptions) return;
8903
8919
  if (!this.httpRoutersOptions) throw Error("httpRoutersOptions is required for libp2pJsClient");
8904
- const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-BPj1zAUb.js");
8920
+ const { createLibp2pJsClientOrUseExistingOne } = await import("./helia-for-pkc-HklWh03v.js");
8905
8921
  for (const clientOptions of this.libp2pJsClientsOptions) {
8906
8922
  const heliaNode = await createLibp2pJsClientOrUseExistingOne({
8907
8923
  ...clientOptions,
@@ -9150,7 +9166,7 @@ var PKC$1 = class extends PKCTypedEmitter {
9150
9166
  const log = logger_default("pkc-js:pkc:createLocalCommunity");
9151
9167
  log.trace("Received community options to create a local community instance:", options);
9152
9168
  if (!this._canCreateNewLocalCommunity()) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", { pkcOptions: this._userPKCOptions });
9153
- const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-ChTkd8lH.js");
9169
+ const { LocalCommunity, createNewLocalCommunityDb, updateInstancePropsWithStartedCommunityOrDb } = await import("./local-community-CVm32rYh.js");
9154
9170
  const isLocalCommunity = (await listCommunitiesSync(this)).includes(options.address);
9155
9171
  const community = new LocalCommunity(this);
9156
9172
  if (isLocalCommunity) {
@@ -9182,11 +9198,22 @@ var PKC$1 = class extends PKCTypedEmitter {
9182
9198
  const hasName = "name" in parsedOptions && typeof parsedOptions.name === "string";
9183
9199
  const hasPublicKey = "publicKey" in parsedOptions && typeof parsedOptions.publicKey === "string";
9184
9200
  const hasSigner = "signer" in parsedOptions && parsedOptions.signer !== void 0;
9201
+ const anchor = parsedOptions.anchor ?? void 0;
9202
+ const hasAnchor = anchor !== void 0;
9203
+ if (hasAnchor) {
9204
+ const parsedAnchor = CommunityAnchorSchema.safeParse(anchor);
9205
+ if (!parsedAnchor.success) throw new PKCError("ERR_ANCHOR_PUBLIC_KEY_IS_INVALID", {
9206
+ anchor,
9207
+ zodError: parsedAnchor.error
9208
+ });
9209
+ }
9210
+ if (hasAnchor && hasSigner) throw new PKCError("ERR_CAN_NOT_CREATE_A_COMMUNITY_WITH_BOTH_SIGNER_AND_ANCHOR", { ...parsedOptions });
9185
9211
  const hasIdentifier = hasAddress || hasName || hasPublicKey;
9212
+ if (hasAnchor && hasIdentifier) throw new PKCError("ERR_CAN_NOT_CREATE_A_COMMUNITY_WITH_BOTH_ANCHOR_AND_IDENTIFIER", { ...parsedOptions });
9186
9213
  const effectiveAddress = parsedOptions.address || parsedOptions.name || parsedOptions.publicKey;
9187
9214
  if (effectiveAddress && doesDomainAddressHaveCapitalLetter(effectiveAddress)) throw new PKCError("ERR_COMMUNITY_NAME_HAS_CAPITAL_LETTER", { ...parsedOptions });
9188
9215
  const canCreateLocalCommunity = this._canCreateNewLocalCommunity();
9189
- if (hasSigner && !canCreateLocalCommunity) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", {
9216
+ if ((hasSigner || hasAnchor) && !canCreateLocalCommunity) throw new PKCError("ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY", {
9190
9217
  pkcOptions: this._userPKCOptions,
9191
9218
  isEnvNode: Boolean(process),
9192
9219
  hasDataPath: Boolean(this.dataPath)
@@ -9195,7 +9222,16 @@ var PKC$1 = class extends PKCTypedEmitter {
9195
9222
  const parsedRemoteOptions = parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails(options);
9196
9223
  return this._createRemoteCommunityInstance(parsedRemoteOptions);
9197
9224
  }
9198
- if (hasIdentifier && !hasSigner) {
9225
+ if (hasAnchor) {
9226
+ const minterSigner = await this.createSigner();
9227
+ const localOptions = {
9228
+ ...parsedOptions,
9229
+ signer: minterSigner,
9230
+ address: anchor.publicKey
9231
+ };
9232
+ log(`Creating a delegated local community with anchor (${anchor.publicKey}) and minter (${minterSigner.address})`);
9233
+ return this._createLocalCommunity(localOptions);
9234
+ } else if (hasIdentifier && !hasSigner) {
9199
9235
  const localCommunityAddress = (await listCommunitiesSync(this)).find((localAddr) => areEquivalentCommunityAddresses(localAddr, effectiveAddress));
9200
9236
  if (localCommunityAddress) return this._createLocalCommunity({ address: localCommunityAddress });
9201
9237
  else {
@@ -9668,10 +9704,12 @@ PKC.nativeFunctions = {
9668
9704
  PKC.getShortCid = getShortCidValue;
9669
9705
  PKC.getShortAddress = getShortAddressValue;
9670
9706
  PKC.challenges = pkcJsChallenges;
9707
+ PKC.createAnchorIpnsRecord = createAnchorIpnsRecord$1;
9671
9708
  const setNativeFunctions = PKC.setNativeFunctions;
9672
9709
  const nativeFunctions = PKC.nativeFunctions;
9673
9710
  const getShortCid = PKC.getShortCid;
9674
9711
  const getShortAddress = PKC.getShortAddress;
9675
9712
  const challenges = PKC.challenges;
9713
+ const createAnchorIpnsRecord = PKC.createAnchorIpnsRecord;
9676
9714
  //#endregion
9677
- export { parseRpcUnsubscribeParam as _, nativeFunctions as a, parseRpcCancelExportParam as c, parseRpcCommunityIdentifierParam as d, parseRpcCommunityPageParam as f, parseRpcPublishChallengeAnswersParam as g, parseRpcExportCommunityParam as h, getShortCid as i, parseRpcCidParam as l, parseRpcExportCommunityModLogsParam as m, challenges as n, setNativeFunctions as o, parseRpcEditCommunityParam as p, getShortAddress as r, parseRpcAuthorNameParam as s, PKC as t, parseRpcCommentRepliesPageParam as u };
9715
+ export { parseRpcPublishAnchorRecordParam as _, getShortCid as a, parseRpcAuthorNameParam as c, parseRpcCommentRepliesPageParam as d, parseRpcCommunityIdentifierParam as f, parseRpcExportCommunityParam as g, parseRpcExportCommunityModLogsParam as h, getShortAddress as i, parseRpcCancelExportParam as l, parseRpcEditCommunityParam as m, challenges as n, nativeFunctions as o, parseRpcCommunityPageParam as p, createAnchorIpnsRecord as r, setNativeFunctions as s, PKC as t, parseRpcCidParam as u, parseRpcPublishChallengeAnswersParam as v, parseRpcUnsubscribeParam as y };
@@ -1,5 +1,5 @@
1
1
  import { i as __toESM, n as __exportAll, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
- import { $ as pubsubTopicToDhtKey, $t as CommunityEditOptionsSchema, A as extractNetworkErrorDetails, An as CreateCommentOptionsWithRefinementSchema, Ar as record, At as trackStartedCommunity, B as isIpfsCid, Bn as CreateCommentEditOptionsWithRefinementSchema, Cr as _enum, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dn as CommentUpdateSignedPropertyNames, Dr as literal, E as createAbortError, En as CommentUpdateSchema, Er as custom, Et as listUpdatingCommunities, Ft as untrackUpdatingCommunity, Gn as CidPathSchema, Gt as CommentModerationPubsubMessagePublicationSchema, H as isIpns, Hn as AuthorCommentIpfsReservedFields, Ht as CommunityEditPubsubMessagePublicationSchema, I as getPostUpdateTimestampRange, In as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, It as require_sha256$1, Jn as CommunityAuthorChallengeReservedFieldNames, Jt as CommentModerationsTableRowSchema, Kn as CidStringSchema, L as hideClassPrivateProps, Mn as ModQueuePageIpfsSchema, Mt as trackUpdatingCommunity, Nn as PageIpfsSchema, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, Or as number, Ot as refreshTrackedCommunityAliases, Pn as CommentEditChallengeRequestToEncryptSchema, Q as isStringDomain, Qn as n$9, Qt as CommunityChallengeSettingSchema, R as ipnsNameToIpnsOverPubsubTopic, Rn as CommentEditSignedPropertyNames, Rt as pTimeout, Sn as CommentUpdateChallengeReservedFieldNames, St as findUpdatingComment, Tn as CommentUpdateReservedFields, Tr as boolean, U as isIpnsPath, Ut as CreateCommunityEditPublicationOptionsWithRefinementSchema, V as isIpfsPath, Vn as AuthorAddressSchema, Vt as CommunityEditPublicationSignedPropertyNames, Wn as ChallengeAnswersSchema, Wt as CommentModerationChallengeRequestToEncryptSchema, X as isRequestPubsubPublicationOfPost, Xn as n$10, Xt as ChallengeFileFactorySchema, Yn as CreateSignerSchema, Yt as CreateCommentModerationOptionsWithRefinementSchema, Z as isRequestPubsubPublicationOfReply, Zt as ChallengeFileSchema, _ as PKCUserOptionBaseSchema, _n as CommentIpfsReservedFields, _r as PKCError, _t as timestamp, an as CreateRemoteCommunityFunctionArgumentSchema, ar as t$12, b as areEquivalentCommunityAddresses, bn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, br as require_supports_color, c as ChallengeVerificationMessageSignedPropertyNames, cr as t$10, ct as resolveWhenPredicateIsTrue, dn as VoteChallengeRequestToEncryptSchema, dr as require_retry$1, en as CommunityExportRecordsSchema, er as t$13, f as DecryptedChallengeSchema, fn as VotePubsubMessagePublicationSchema, fr as FailedToFetchCommentIpfsFromGatewaysError, ft as shortifyAddress, g as PKCParsedOptionsSchema, gn as CommentChallengeRequestToEncryptSchema, gr as FailedToFetchPageIpfsFromGatewaysError, gt as throwIfAbortSignalAborted, h as NameResolverSerializedSchema, hr as FailedToFetchGenericIpfsFromGatewaysError, i as ChallengeMessageSignedPropertyNames, in as CreateNewLocalCommunityUserOptionsSchema, ir as r$8, it as removeNullUndefinedEmptyObjectsValuesRecursively, j as fetchAndValidateIpnsRecordFromGateway, jn as GetPageParamSchema, jr as string, k as doesDomainAddressHaveCapitalLetter, kr as object, l as DecryptedChallengeAnswerSchema, ln as RpcRemoteCommunityUpdateEventResultSchema, lr as t$9, m as NameResolveCacheOptionsSchema, mn as VoteSignedPropertyNames, mr as FailedToFetchCommunityFromGatewaysError, mt as sleepUntilTimeoutOrAbort, n as ChallengeAnswerMessageSignedPropertyNames, nn as CommunityIpfsSchema, nr as e$5, o as ChallengeRequestMessageSignedPropertyNames, on as CreateRpcCommunityFunctionArgumentSchema, or as n$8, p as DecryptedChallengeVerificationSchema, pr as FailedToFetchCommentUpdateFromGatewaysError, pt as shortifyCid, qn as CommunityAddressSchema, qt as CommentModerationSignedPropertyNames, rn as CommunitySignedPropertyNames, rr as t$11, sn as ExportCommunityModLogsOptionsSchema, sr as r$7, tn as CommunityIpfsReservedFields, tr as e$6, tt as raceAgainstAbort, un as CreateVoteUserOptionsWithRefinementSchema, ur as e$4, v as PKCUserOptionsSchema, vn as CommentIpfsSchema, vr as messages, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wn as CommentUpdateForChallengeVerificationSignedPropertyNames, wr as array, wt as listStartedCommunities, x as calculateIpfsCidV0, xn as CommentSignedPropertyNames, xr as require_ms$1, xt as findStartedCommunity, yr as logger_default, z as isAbortError, zt as CommunityEditPublicationChallengeRequestToEncryptSchema } from "./schema-wNdSno5O.js";
2
+ import { $ as pubsubTopicToDhtKey, $n as n$9, $t as CommunityChallengeSettingSchema, A as extractNetworkErrorDetails, Ar as object, At as trackStartedCommunity, B as isIpfsCid, Cn as CommentUpdateChallengeReservedFieldNames, Ct as findUpdatingCommunity, D as deepMergeRuntimeFields, Dn as CommentUpdateSchema, Dr as custom, E as createAbortError, En as CommentUpdateReservedFields, Er as boolean, Et as listUpdatingCommunities, Fn as CommentEditChallengeRequestToEncryptSchema, Ft as untrackUpdatingCommunity, Gn as ChallengeAnswersSchema, Gt as CommentModerationPubsubMessagePublicationSchema, H as isIpns, Hn as AuthorAddressSchema, Ht as CommunityEditPubsubMessagePublicationSchema, I as getPostUpdateTimestampRange, It as require_sha256$1, Jn as CommunityAddressSchema, Jt as CommentModerationsTableRowSchema, Kn as CidPathSchema, L as hideClassPrivateProps, Ln as CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema, Mn as GetPageParamSchema, Mr as string, Mt as trackUpdatingCommunity, Nn as ModQueuePageIpfsSchema, Nt as untrackStartedCommunity, O as derivePublicationFromChallengeRequest, On as CommentUpdateSignedPropertyNames, Or as literal, Ot as refreshTrackedCommunityAliases, Pn as PageIpfsSchema, Q as isStringDomain, R as ipnsNameToIpnsOverPubsubTopic, Rt as pTimeout, Sn as CommentSignedPropertyNames, Sr as require_ms$1, St as findUpdatingComment, Tn as CommentUpdateForChallengeVerificationSignedPropertyNames, Tr as array, U as isIpnsPath, Un as AuthorCommentIpfsReservedFields, Ut as CreateCommunityEditPublicationOptionsWithRefinementSchema, V as isIpfsPath, Vn as CreateCommentEditOptionsWithRefinementSchema, Vt as CommunityEditPublicationSignedPropertyNames, Wt as CommentModerationChallengeRequestToEncryptSchema, X as isRequestPubsubPublicationOfPost, Xn as CreateSignerSchema, Xt as ChallengeFileFactorySchema, Yn as CommunityAuthorChallengeReservedFieldNames, Yt as CreateCommentModerationOptionsWithRefinementSchema, Z as isRequestPubsubPublicationOfReply, Zn as n$10, Zt as ChallengeFileSchema, _ as PKCUserOptionBaseSchema, _n as CommentChallengeRequestToEncryptSchema, _r as FailedToFetchPageIpfsFromGatewaysError, _t as timestamp, an as CreateNewLocalCommunityUserOptionsSchema, ar as r$8, b as areEquivalentCommunityAddresses, br as logger_default, c as ChallengeVerificationMessageSignedPropertyNames, cn as ExportCommunityModLogsOptionsSchema, cr as r$7, ct as resolveWhenPredicateIsTrue, dn as CreateVoteUserOptionsWithRefinementSchema, dr as e$4, en as CommunityEditOptionsSchema, f as DecryptedChallengeSchema, fn as VoteChallengeRequestToEncryptSchema, fr as require_retry$1, ft as shortifyAddress, g as PKCParsedOptionsSchema, gr as FailedToFetchGenericIpfsFromGatewaysError, gt as throwIfAbortSignalAborted, h as NameResolverSerializedSchema, hn as VoteSignedPropertyNames, hr as FailedToFetchCommunityFromGatewaysError, i as ChallengeMessageSignedPropertyNames, in as CommunitySignedPropertyNames, ir as t$11, it as removeNullUndefinedEmptyObjectsValuesRecursively, j as fetchAndValidateIpnsRecordFromGateway, jn as CreateCommentOptionsWithRefinementSchema, jr as record, k as doesDomainAddressHaveCapitalLetter, kr as number, l as DecryptedChallengeAnswerSchema, lr as t$10, m as NameResolveCacheOptionsSchema, mr as FailedToFetchCommentUpdateFromGatewaysError, mt as sleepUntilTimeoutOrAbort, n as ChallengeAnswerMessageSignedPropertyNames, nn as CommunityIpfsReservedFields, nr as e$6, o as ChallengeRequestMessageSignedPropertyNames, on as CreateRemoteCommunityFunctionArgumentSchema, or as t$12, p as DecryptedChallengeVerificationSchema, pn as VotePubsubMessagePublicationSchema, pr as FailedToFetchCommentIpfsFromGatewaysError, pt as shortifyCid, qn as CidStringSchema, qt as CommentModerationSignedPropertyNames, rn as CommunityIpfsSchema, rr as e$5, sn as CreateRpcCommunityFunctionArgumentSchema, sr as n$8, tn as CommunityExportRecordsSchema, tr as t$13, tt as raceAgainstAbort, un as RpcRemoteCommunityUpdateEventResultSchema, ur as t$9, v as PKCUserOptionsSchema, vn as CommentIpfsReservedFields, vr as PKCError, vt as waitForUpdateInCommunityInstanceWithErrorAndTimeout, wr as _enum, wt as listStartedCommunities, x as calculateIpfsCidV0, xn as CommentPubsubMessageWithFlexibleAuthorRefinementSchema, xr as require_supports_color, xt as findStartedCommunity, yn as CommentIpfsSchema, yr as messages, z as isAbortError, zn as CommentEditSignedPropertyNames, zt as CommunityEditPublicationChallengeRequestToEncryptSchema } from "./schema-Bu4z3MGE.js";
3
3
  import { t as all } from "./src-CYIMjhjK.js";
4
4
  import http from "node:http";
5
5
  import { createHash } from "node:crypto";
@@ -15,10 +15,10 @@ import { Agent } from "https";
15
15
  import { Agent as Agent$1 } from "http";
16
16
  import Database from "better-sqlite3";
17
17
  import { CID } from "multiformats/cid";
18
+ import { peerIdFromMultihash, peerIdFromPrivateKey, peerIdFromPublicKey, peerIdFromString } from "@libp2p/peer-id";
18
19
  import * as Digest from "multiformats/hashes/digest";
19
20
  import { of } from "typestub-ipfs-only-hash";
20
21
  import { toString } from "uint8arrays/to-string";
21
- import { peerIdFromMultihash, peerIdFromPrivateKey, peerIdFromPublicKey, peerIdFromString } from "@libp2p/peer-id";
22
22
  import { privateKeyFromProtobuf, privateKeyFromRaw, privateKeyToProtobuf, publicKeyFromRaw, publicKeyToProtobuf } from "@libp2p/crypto/keys";
23
23
  import { fromString } from "uint8arrays/from-string";
24
24
  import { bases } from "multiformats/basics";
@@ -91003,6 +91003,8 @@ var STORAGE_KEYS;
91003
91003
  STORAGE_KEYS[STORAGE_KEYS["LAST_IPNS_RECORD"] = 2] = "LAST_IPNS_RECORD";
91004
91004
  STORAGE_KEYS[STORAGE_KEYS["COMBINED_HASH_OF_PENDING_COMMENTS"] = 3] = "COMBINED_HASH_OF_PENDING_COMMENTS";
91005
91005
  STORAGE_KEYS[STORAGE_KEYS["EXPORTS"] = 4] = "EXPORTS";
91006
+ STORAGE_KEYS[STORAGE_KEYS["ANCHOR_IPNS_RECORD"] = 5] = "ANCHOR_IPNS_RECORD";
91007
+ STORAGE_KEYS[STORAGE_KEYS["HIGHEST_ACCEPTED_ANCHOR_SEQUENCE"] = 6] = "HIGHEST_ACCEPTED_ANCHOR_SEQUENCE";
91006
91008
  })(STORAGE_KEYS || (STORAGE_KEYS = {}));
91007
91009
  //#endregion
91008
91010
  //#region node_modules/safe-stable-stringify/index.js
@@ -91692,6 +91694,21 @@ const RpcCommunitiesChangeEventResultSchema = object({ communities: array(string
91692
91694
  const RpcFetchCidResultSchema = object({ content: string() });
91693
91695
  const RpcResolveAuthorNameResultSchema = object({ resolvedAuthorName: string().nullable() });
91694
91696
  const RpcSuccessResultSchema = object({ success: literal(true) });
91697
+ const RpcPublishAnchorRecordParamSchema = object({
91698
+ name: string().min(1).optional(),
91699
+ publicKey: string().min(1).optional(),
91700
+ recordBase64: string().min(1)
91701
+ }).refine((args) => args.name || args.publicKey, "At least one of name or publicKey must be provided");
91702
+ const RpcAnchorPublishPreparationResultSchema = object({
91703
+ nextSequence: string().min(1),
91704
+ currentAnchorRecordSequence: string().min(1),
91705
+ hasPersistedAnchorRecord: boolean()
91706
+ });
91707
+ const RpcPublishedAnchorRecordResultSchema = object({
91708
+ sequence: string().min(1),
91709
+ value: string().min(1),
91710
+ anchorPublicKey: string().min(1)
91711
+ });
91695
91712
  const RpcSubscriptionIdResultSchema = object({ subscriptionId: SubscriptionIdSchema });
91696
91713
  const RpcExportCommunityParamSchema = object({
91697
91714
  name: string().min(1).optional(),
@@ -97797,8 +97814,11 @@ function _allFieldsOfRecordInSignedPropertyNames(record) {
97797
97814
  for (const field of fieldsOfRecord) if (!record.signature.signedPropertyNames.includes(field)) return false;
97798
97815
  return true;
97799
97816
  }
97800
- async function verifyCommunity({ community, communityIpnsName, resolveAuthorNames, clientsManager, validatePages, cacheIfValid, abortSignal }) {
97817
+ async function verifyCommunity({ community, communityIpnsHops, resolveAuthorNames, clientsManager, validatePages, cacheIfValid, abortSignal }) {
97801
97818
  const log = logger_default("pkc-js:signatures:verifyCommunity");
97819
+ if (!Array.isArray(communityIpnsHops) || communityIpnsHops.length === 0) throw Error("verifyCommunity needs a non-empty communityIpnsHops to verify a community record against");
97820
+ const communityIdentityIpnsName = communityIpnsHops[0];
97821
+ const terminalIpnsName = communityIpnsHops[communityIpnsHops.length - 1];
97802
97822
  if (!_allFieldsOfRecordInSignedPropertyNames(community)) return {
97803
97823
  valid: false,
97804
97824
  reason: messages.ERR_COMMUNITY_RECORD_INCLUDES_FIELD_NOT_IN_SIGNED_PROPERTY_NAMES
@@ -97812,11 +97832,11 @@ async function verifyCommunity({ community, communityIpnsName, resolveAuthorName
97812
97832
  reason: messages.ERR_COMMUNITY_SIGNATURE_IS_INVALID
97813
97833
  };
97814
97834
  const cacheIfValidWithDefault = typeof cacheIfValid === "boolean" ? cacheIfValid : true;
97815
- const cacheKey = (0, import_sha256.sha256)(community.signature.signature + validatePages + communityIpnsName);
97835
+ const cacheKey = (0, import_sha256.sha256)(community.signature.signature + validatePages + communityIpnsHops.join(","));
97816
97836
  if (cacheIfValidWithDefault && clientsManager._pkc._memCaches.communityVerificationCache.get(cacheKey)) return { valid: true };
97817
- const communityAddress = community.name || getPKCAddressFromPublicKeySync(community.signature.publicKey);
97837
+ const communityAddress = community.name || communityIdentityIpnsName;
97818
97838
  const communityForPages = {
97819
- publicKey: getPKCAddressFromPublicKeySync(community.signature.publicKey),
97839
+ publicKey: communityIdentityIpnsName,
97820
97840
  name: community.name,
97821
97841
  signature: community.signature
97822
97842
  };
@@ -97848,7 +97868,7 @@ async function verifyCommunity({ community, communityIpnsName, resolveAuthorName
97848
97868
  };
97849
97869
  }
97850
97870
  }
97851
- const communityPeerId = peerIdFromString(communityIpnsName);
97871
+ const communityPeerId = peerIdFromString(terminalIpnsName);
97852
97872
  const signaturePeerId = getPeerIdFromPublicKey(community.signature.publicKey);
97853
97873
  if (!communityPeerId.equals(signaturePeerId)) return {
97854
97874
  valid: false,
@@ -101950,7 +101970,7 @@ async function moveCommunityDbToDeletedDirectory(communityAddress, pkc) {
101950
101970
  }
101951
101971
  async function createKuboRpcClient(kuboRpcClientOptions) {
101952
101972
  logger_default("pkc-js:pkc:createKuboRpcClient").trace("Creating a new kubo client on node with options", kuboRpcClientOptions);
101953
- const { create: CreateKuboRpcClient } = await import("./src-BKg5Lhod.js");
101973
+ const { create: CreateKuboRpcClient } = await import("./src-BEjAH2gY.js");
101954
101974
  const Agent$2 = typeof kuboRpcClientOptions.url === "string" && kuboRpcClientOptions.url.startsWith("https") || kuboRpcClientOptions?.protocol === "https" || kuboRpcClientOptions.url instanceof URL && kuboRpcClientOptions?.url?.protocol === "https:" || kuboRpcClientOptions.url?.toString()?.includes("https") ? Agent : Agent$1;
101955
101975
  const onehourMs = 1e3 * 60 * 60;
101956
101976
  return CreateKuboRpcClient({
@@ -124316,6 +124336,18 @@ const decryptEd25519AesGcmPublicKeyBuffer = async (encrypted, privateKeyBase64,
124316
124336
  return decrypted;
124317
124337
  };
124318
124338
  //#endregion
124339
+ //#region dist/node/signer/ipns-record.js
124340
+ const ANCHOR_IPNS_RECORD_LIFETIME_MS = 100 * 365 * 24 * 60 * 60 * 1e3;
124341
+ async function createAnchorIpnsRecord({ anchorSigner, minterIpnsName, sequence }) {
124342
+ const { createIPNSRecord, marshalIPNSRecord } = await import("ipns");
124343
+ if (typeof minterIpnsName !== "string" || !minterIpnsName) throw Error("minterIpnsName must be a non-empty IPNS name");
124344
+ peerIdFromString(minterIpnsName);
124345
+ const seq = BigInt(sequence);
124346
+ if (seq < 0n) throw Error("sequence of an anchor IPNS record can not be negative");
124347
+ const ipfsKey = await getIpfsKeyFromPrivateKey(anchorSigner.privateKey);
124348
+ return marshalIPNSRecord(await createIPNSRecord(privateKeyFromProtobuf(new Uint8Array(ipfsKey)), `/ipns/${minterIpnsName}`, seq, ANCHOR_IPNS_RECORD_LIFETIME_MS));
124349
+ }
124350
+ //#endregion
124319
124351
  //#region dist/node/signer/index.js
124320
124352
  var Signer = class {
124321
124353
  constructor(props) {
@@ -125017,7 +125049,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
125017
125049
  abortSignal: this._community._getStopAbortSignal()
125018
125050
  });
125019
125051
  this._community.ipnsHops = ipnsHops;
125020
- const terminalIpnsName = ipnsHops[ipnsHops.length - 1];
125052
+ ipnsHops[ipnsHops.length - 1];
125021
125053
  log.trace(`Resolved community IPNS`, ipnsName, `to CID`, latestCommunityCid, `via hops`, ipnsHops);
125022
125054
  if (this._updateCidsAlreadyLoaded.has(latestCommunityCid)) {
125023
125055
  log.trace("Resolved community IPNS", ipnsName, "to a cid that we already loaded before. No need to fetch its ipfs", latestCommunityCid);
@@ -125050,8 +125082,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
125050
125082
  const communityIpfs = parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails(parseJsonWithPKCErrorIfFails(rawCommunityJsonString));
125051
125083
  const errInRecord = await this._findErrorInCommunityRecord({
125052
125084
  communityJson: communityIpfs,
125053
- anchorIpnsName: ipnsName,
125054
- terminalIpnsName,
125085
+ communityIpnsHops: ipnsHops,
125055
125086
  cidOfCommunityIpns: latestCommunityCid
125056
125087
  });
125057
125088
  if (errInRecord) throw errInRecord;
@@ -125129,8 +125160,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
125129
125160
  gatewayFetches[gatewayUrl].ipnsHops = ipnsHops;
125130
125161
  const errorWithinRecord = await this._findErrorInCommunityRecord({
125131
125162
  communityJson: communityIpfs,
125132
- anchorIpnsName: ipnsName,
125133
- terminalIpnsName,
125163
+ communityIpnsHops: ipnsHops,
125134
125164
  cidOfCommunityIpns: calculatedCommunityCidFromBody
125135
125165
  });
125136
125166
  if (errorWithinRecord) {
@@ -125300,7 +125330,9 @@ var CommunityClientsManager = class extends PKCClientsManager {
125300
125330
  });
125301
125331
  }
125302
125332
  }
125303
- async _findErrorInCommunityRecord({ communityJson, anchorIpnsName, terminalIpnsName, cidOfCommunityIpns }) {
125333
+ async _findErrorInCommunityRecord({ communityJson, communityIpnsHops, cidOfCommunityIpns }) {
125334
+ const anchorIpnsName = communityIpnsHops[0];
125335
+ const terminalIpnsName = communityIpnsHops[communityIpnsHops.length - 1];
125304
125336
  const communityInstanceAddress = this._getCommunityAddressFromInstance();
125305
125337
  const recordAddress = this._deriveAddressFromWireRecord(communityJson);
125306
125338
  const addressMatchesInstance = this._areEquivalentCommunityAddresses(recordAddress, communityInstanceAddress);
@@ -125329,7 +125361,7 @@ var CommunityClientsManager = class extends PKCClientsManager {
125329
125361
  });
125330
125362
  const verificationOpts = {
125331
125363
  community: communityJson,
125332
- communityIpnsName: terminalIpnsName,
125364
+ communityIpnsHops,
125333
125365
  resolveAuthorNames: this._pkc.resolveAuthorNames,
125334
125366
  clientsManager: this,
125335
125367
  validatePages: this._pkc.validatePages,
@@ -129421,6 +129453,8 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
129421
129453
  community: this.raw.communityIpfs,
129422
129454
  localCommunity: {
129423
129455
  signer: this.signer,
129456
+ anchor: this.anchor,
129457
+ anchorRecordSequence: this.anchorRecordSequence,
129424
129458
  settings: this.settings,
129425
129459
  _usingDefaultChallenge: this._usingDefaultChallenge,
129426
129460
  address: this.address,
@@ -129440,13 +129474,21 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
129440
129474
  ...this._toJSONIpfsBaseNoPosts(),
129441
129475
  address: this.address,
129442
129476
  signer: this.signer,
129477
+ anchor: this.anchor,
129478
+ anchorRecordSequence: this.anchorRecordSequence,
129443
129479
  settings: this.settings,
129444
129480
  _usingDefaultChallenge: this._usingDefaultChallenge,
129445
129481
  started: this.started,
129446
129482
  startedState: this.startedState
129447
129483
  } };
129448
129484
  }
129485
+ _replayAnchorIntoIpnsHops(localProps) {
129486
+ this.anchor = localProps.anchor;
129487
+ this.anchorRecordSequence = localProps.anchorRecordSequence;
129488
+ if (localProps.anchor) this.ipnsHops = [localProps.anchor.publicKey, localProps.signer.address];
129489
+ }
129449
129490
  initRpcInternalCommunityBeforeFirstUpdateNoMerge(newProps) {
129491
+ this._replayAnchorIntoIpnsHops(newProps.localCommunity);
129450
129492
  this.initRemoteCommunityPropsNoMerge(newProps.localCommunity);
129451
129493
  if (newProps.localCommunity.address) this.setAddress(newProps.localCommunity.address);
129452
129494
  this.signer = newProps.localCommunity.signer;
@@ -129456,6 +129498,7 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
129456
129498
  this.raw.localCommunity = newProps;
129457
129499
  }
129458
129500
  initRpcInternalCommunityAfterFirstUpdateNoMerge(newProps) {
129501
+ this._replayAnchorIntoIpnsHops(newProps.localCommunity);
129459
129502
  super.initCommunityIpfsPropsNoMerge(newProps.community);
129460
129503
  if (newProps.localCommunity.address) this.setAddress(newProps.localCommunity.address);
129461
129504
  this.signer = newProps.localCommunity.signer;
@@ -129583,6 +129626,21 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
129583
129626
  this.started = false;
129584
129627
  untrackStartedCommunity(this._pkc, this);
129585
129628
  }
129629
+ async prepareAnchorPublish() {
129630
+ return this._pkc._pkcRpcClient.prepareAnchorPublish({
129631
+ name: this.name,
129632
+ publicKey: this.publicKey
129633
+ });
129634
+ }
129635
+ async publishAnchorRecord(recordBytes) {
129636
+ const result = await this._pkc._pkcRpcClient.publishAnchorRecord({
129637
+ name: this.name,
129638
+ publicKey: this.publicKey,
129639
+ recordBase64: toString(recordBytes, "base64")
129640
+ });
129641
+ this.anchorRecordSequence = result.sequence;
129642
+ return result;
129643
+ }
129586
129644
  async stop() {
129587
129645
  this.posts._stop();
129588
129646
  if (this.state === "updating") return super.stop();
@@ -129728,4 +129786,4 @@ var RpcLocalCommunity = class extends RpcRemoteCommunity {
129728
129786
  }
129729
129787
  };
129730
129788
  //#endregion
129731
- export { RepliesPages as $, t$8 as $n, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as $t, deriveDbPosts as A, RpcCidParamSchema as An, verifyCommunityEdit as At, setNativeFunctions as B, RpcFetchCidResultSchema as Bn, getCommunityPublicKeyFromWire as Bt, BackupAbortError as C, parseRpcCommentEventWithPKCErrorIfItFails as Cn, verifyChallengeVerification as Ct, createKuboRpcClient as D, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as Dn, verifyCommentPubsubMessage as Dt, calculateInlineRepliesBudget as E, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as En, verifyCommentModeration as Et, importSignerIntoKuboNode as F, RpcExportCommunityModLogsParamSchema as Fn, getAuthorNameFromWire as Ft, REPLY_REPLIES_SORT_TYPES as G, RpcUnsubscribeParamSchema as Gn, getIpfsKeyFromPrivateKey as Gt, CommentClientsManager as H, RpcResolveAuthorNameResultSchema as Hn, decode as Ht, listCommunitiesSync as I, RpcExportCommunityModLogsResultSchema as In, normalizeCreatePublicationAuthor as It, buildPagesRuntimeFields as J, r as Jn, getPublicKeyFromPrivateKey as Jt, TIMEFRAMES_TO_SECONDS as K, t$2 as Kn, getPKCAddressFromPublicKey as Kt, monitorCommunitiesDirectory as L, RpcExportCommunityParamSchema as Ln, buildRuntimeCommunityFields as Lt, getDefaultCommunityDbConfig as M, RpcCommunityIdentifierParamSchema as Mn, buildRuntimeAuthor as Mt, getDefaultDataPath as N, RpcCommunityPageParamSchema as Nn, cleanWireAuthor as Nt, deleteOldCommunityInWindows as O, RpcAuthorNameParamSchema as On, verifyCommentUpdate as Ot, getThumbnailPropsOfLink as P, RpcEditCommunityParamSchema as Pn, getAuthorNameFromRuntime as Pt, parseRawPages as Q, t$7 as Qn, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Qt, moveCommunityDbToDeletedDirectory as R, RpcExportCommunityResultSchema as Rn, getCommunityAddressFromRecord as Rt, encryptEd25519AesGcmPublicKeyBuffer as S, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as Sn, verifyChallengeRequest as St, calculateExpectedSignatureSize as T, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as Tn, verifyCommentIpfs as Tt, POSTS_SORT_TYPES as U, RpcSubscriptionIdResultSchema as Un, encode as Ut, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as V, RpcPublishChallengeAnswersParamSchema as Vn, normalizeCommunityInputFromCommunity as Vt, POST_REPLIES_SORT_TYPES as W, RpcSuccessResultSchema as Wn, getBufferedPKCAddressFromPublicKey as Wt, findCommentInPageInstanceRecursively as X, n$5 as Xn, parseCidStringSchemaWithPKCErrorIfItFails as Xt, extractCommunityRuntimeFieldsFromParsedPages as Y, t$5 as Yn, createSchemaRowParser as Yt, iterateOverPageCidsToFindAllCids as Z, n$6 as Zn, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Zt, SignerWithPublicKeyAddress as _, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as _n, signCommunity as _t, pkcJsChallenges as a, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as an, PKCTypedEmitter as at, decryptEd25519AesGcmPublicKeyBuffer as b, parseDecryptedChallengeWithPKCErrorIfItFails as bn, verifyChallengeAnswer as bt, AddressesRewriterProxyServer as c, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as cn, signChallengeAnswer as ct, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as d, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as dn, signChallengeVerification as dt, parseCommentIpfsSchemaWithPKCErrorIfItFails as en, stringify as er, PublicationClientsManager as et, KeyvBetterSqlite3 as f, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as fn, signComment as ft, decodeRpcChallengeVerificationPubsubMsg as g, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as gn, signCommentUpdateForChallengeVerification as gt, decodeRpcChallengeRequestPubsubMsg as h, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as hn, signCommentUpdate as ht, getCommunityChallengeFromCommunityChallengeSettings as i, parseCommunityAddressWithPKCErrorIfItFails as in, require_undici as ir, pLimit as it, deriveDbReplies as j, RpcCommentRepliesPageParamSchema as jn, verifyVote as jt, deriveCommentIpfsFromCommentTableRow as k, RpcCancelExportParamSchema as kn, verifyCommunity as kt, normalizeSelfAddrsForProvider as l, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as ln, signChallengeMessage as lt, decodeRpcChallengePubsubMsg as m, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as mn, signCommentModeration as mt, RpcRemoteCommunity as n, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as nn, require_lodash_merge as nr, InflightFetchManager as nt, TrackedInstanceRegistry as o, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as on, require_lib$1 as ot, decodeRpcChallengeAnswerPubsubMsg as p, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as pn, signCommentEdit as pt, buildPageRuntimeFields as q, t$4 as qn, getPKCAddressFromPublicKeySync as qt, getChallengeVerification as r, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as rn, nativeFunctions$1 as rr, pRetry as rt, LRUCache as s, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as sn, cleanUpBeforePublishing as st, RpcLocalCommunity as t, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as tn, STORAGE_KEYS as tr, PKCClientsManager as tt, RemoteCommunity as u, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as un, signChallengeRequest as ut, createSigner as v, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as vn, signCommunityEdit as vt, backupCommunityDb as w, parseRpcCommentUpdateEventWithPKCErrorIfItFails as wn, verifyCommentEdit as wt, encryptEd25519AesGcm as x, parseJsonWithPKCErrorIfFails as xn, verifyChallengeMessage as xt, decryptEd25519AesGcm as y, parseDecryptedChallengeVerification as yn, signVote as yt, resolveDbPostsCidRefs as z, RpcFetchCidParamSchema as zn, getCommunityNameFromWire$1 as zt };
129789
+ export { parseRawPages as $, t$5 as $n, parseCommentEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as $t, deriveCommentIpfsFromCommentTableRow as A, RpcAuthorNameParamSchema as An, verifyCommunity as At, resolveDbPostsCidRefs as B, RpcExportCommunityResultSchema as Bn, getCommunityNameFromWire$1 as Bt, encryptEd25519AesGcmPublicKeyBuffer as C, parsePKCUserOptionsSchemaWithPKCErrorIfItFails as Cn, verifyChallengeRequest as Ct, calculateInlineRepliesBudget as D, parseVoteChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Dn, verifyCommentModeration as Dt, calculateExpectedSignatureSize as E, parseSetNewSettingsPKCWsServerSchemaWithPKCErrorIfItFails as En, verifyCommentIpfs as Et, getThumbnailPropsOfLink as F, RpcCommunityPageParamSchema as Fn, getAuthorNameFromRuntime as Ft, POST_REPLIES_SORT_TYPES as G, RpcPublishedAnchorRecordResultSchema as Gn, getBufferedPKCAddressFromPublicKey as Gt, tryToDeleteCommunitiesThatFailedToBeDeletedBefore as H, RpcFetchCidResultSchema as Hn, normalizeCommunityInputFromCommunity as Ht, importSignerIntoKuboNode as I, RpcEditCommunityParamSchema as In, getAuthorNameFromWire as It, buildPageRuntimeFields as J, RpcSuccessResultSchema as Jn, getPKCAddressFromPublicKeySync as Jt, REPLY_REPLIES_SORT_TYPES as K, RpcResolveAuthorNameResultSchema as Kn, getIpfsKeyFromPrivateKey as Kt, listCommunitiesSync as L, RpcExportCommunityModLogsParamSchema as Ln, normalizeCreatePublicationAuthor as Lt, deriveDbReplies as M, RpcCidParamSchema as Mn, verifyVote as Mt, getDefaultCommunityDbConfig as N, RpcCommentRepliesPageParamSchema as Nn, buildRuntimeAuthor as Nt, createKuboRpcClient as O, parseVotePubsubMessagePublicationSchemaWithPKCErrorIfItFails as On, verifyCommentPubsubMessage as Ot, getDefaultDataPath as P, RpcCommunityIdentifierParamSchema as Pn, cleanWireAuthor as Pt, iterateOverPageCidsToFindAllCids as Q, r as Qn, parseCommentChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as Qt, monitorCommunitiesDirectory as R, RpcExportCommunityModLogsResultSchema as Rn, buildRuntimeCommunityFields as Rt, encryptEd25519AesGcm as S, parseJsonWithPKCErrorIfFails as Sn, verifyChallengeMessage as St, backupCommunityDb as T, parseRpcCommentUpdateEventWithPKCErrorIfItFails as Tn, verifyCommentEdit as Tt, CommentClientsManager as U, RpcPublishAnchorRecordParamSchema as Un, decode as Ut, setNativeFunctions as V, RpcFetchCidParamSchema as Vn, getCommunityPublicKeyFromWire as Vt, POSTS_SORT_TYPES as W, RpcPublishChallengeAnswersParamSchema as Wn, encode as Wt, extractCommunityRuntimeFieldsFromParsedPages as X, t$2 as Xn, createSchemaRowParser as Xt, buildPagesRuntimeFields as Y, RpcUnsubscribeParamSchema as Yn, getPublicKeyFromPrivateKey as Yt, findCommentInPageInstanceRecursively as Z, t$4 as Zn, parseCidStringSchemaWithPKCErrorIfItFails as Zt, SignerWithPublicKeyAddress as _, parseCreateRpcCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as _n, signCommentUpdateForChallengeVerification as _t, pkcJsChallenges as a, parseCommunityAddressWithPKCErrorIfItFails as an, STORAGE_KEYS as ar, pLimit as at, decryptEd25519AesGcm as b, parseDecryptedChallengeVerification as bn, signVote as bt, AddressesRewriterProxyServer as c, parseCommunityEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as cn, require_undici as cr, cleanUpBeforePublishing as ct, MAX_FILE_SIZE_BYTES_FOR_COMMUNITY_IPFS as d, parseCreateCommentModerationOptionsSchemaWithPKCErrorIfItFails as dn, signChallengeRequest as dt, parseCommentEditPubsubMessagePublicationSchemaWithPKCErrorIfItFails as en, n$5 as er, RepliesPages as et, KeyvBetterSqlite3 as f, parseCreateCommentOptionsSchemaWithPKCErrorIfItFails as fn, signChallengeVerification as ft, decodeRpcChallengeVerificationPubsubMsg as g, parseCreateRemoteCommunityFunctionArgumentSchemaWithPKCErrorIfItFails as gn, signCommentUpdate as gt, decodeRpcChallengeRequestPubsubMsg as h, parseCreatePKCWsServerOptionsSchemaWithPKCErrorIfItFails as hn, signCommentModeration as ht, getCommunityChallengeFromCommunityChallengeSettings as i, parseCommentPubsubMessagePublicationWithPKCErrorIfItFails as in, stringify as ir, pRetry as it, deriveDbPosts as j, RpcCancelExportParamSchema as jn, verifyCommunityEdit as jt, deleteOldCommunityInWindows as k, RpcAnchorPublishPreparationResultSchema as kn, verifyCommentUpdate as kt, normalizeSelfAddrsForProvider as l, parseCommunityIpfsSchemaPassthroughWithPKCErrorIfItFails as ln, signChallengeAnswer as lt, decodeRpcChallengePubsubMsg as m, parseCreateNewLocalCommunityUserOptionsSchemaWithPKCErrorIfItFails as mn, signCommentEdit as mt, RpcRemoteCommunity as n, parseCommentModerationChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as nn, t$7 as nr, PKCClientsManager as nt, TrackedInstanceRegistry as o, parseCommunityEditChallengeRequestToEncryptSchemaWithPKCErrorIfItFails as on, require_lodash_merge as or, PKCTypedEmitter as ot, decodeRpcChallengeAnswerPubsubMsg as p, parseCreateCommunityEditPublicationOptionsSchemaWithPKCErrorIfItFails as pn, signComment as pt, TIMEFRAMES_TO_SECONDS as q, RpcSubscriptionIdResultSchema as qn, getPKCAddressFromPublicKey as qt, getChallengeVerification as r, parseCommentModerationPubsubMessagePublicationSchemaWithPKCErrorIfItFails as rn, t$8 as rr, InflightFetchManager as rt, LRUCache as s, parseCommunityEditOptionsSchemaWithPKCErrorIfItFails as sn, nativeFunctions$1 as sr, require_lib$1 as st, RpcLocalCommunity as t, parseCommentIpfsSchemaWithPKCErrorIfItFails as tn, n$6 as tr, PublicationClientsManager as tt, RemoteCommunity as u, parseCreateCommentEditOptionsSchemaWithPKCErrorIfItFails as un, signChallengeMessage as ut, createSigner as v, parseCreateVoteOptionsSchemaWithPKCErrorIfItFails as vn, signCommunity as vt, BackupAbortError as w, parseRpcCommentEventWithPKCErrorIfItFails as wn, verifyChallengeVerification as wt, decryptEd25519AesGcmPublicKeyBuffer as x, parseDecryptedChallengeWithPKCErrorIfItFails as xn, verifyChallengeAnswer as xt, createAnchorIpnsRecord as y, parseDecryptedChallengeAnswerWithPKCErrorIfItFails as yn, signCommunityEdit as yt, moveCommunityDbToDeletedDirectory as z, RpcExportCommunityParamSchema as zn, getCommunityAddressFromRecord as zt };
@@ -1,12 +1,12 @@
1
1
  import { i as __toESM, r as __require, t as __commonJSMin } from "./chunk-2rV9d50f.js";
2
2
  import { Buffer } from "buffer";
3
3
  import { CID } from "multiformats/cid";
4
+ import { peerIdFromString } from "@libp2p/peer-id";
4
5
  import * as Digest from "multiformats/hashes/digest";
5
6
  import { base58btc } from "multiformats/bases/base58";
6
7
  import { of } from "typestub-ipfs-only-hash";
7
8
  import { toString } from "uint8arrays/to-string";
8
9
  import { base32 } from "multiformats/bases/base32";
9
- import { peerIdFromString } from "@libp2p/peer-id";
10
10
  Object.freeze({ status: "aborted" });
11
11
  function $constructor(name, initializer, params) {
12
12
  function init(inst, def) {
@@ -5156,7 +5156,7 @@ var messages;
5156
5156
  messages["ERR_TIMEOUT_WAITING_FOR_PUBSUB_TOPIC_PEERS"] = "Timeout waiting for propagation of pubsub topic peers";
5157
5157
  messages["ERR_PUBSUB_TOPIC_PEER_WAIT_ABORTED"] = "Aborted while waiting for a peer to subscribe to a pubsub topic";
5158
5158
  messages["ERR_IPNS_DIRECT_FETCH_ABORTED"] = "Aborted while fetching an IPNS record directly from subscribers/providers";
5159
- messages["ERR_TIMED_OUT_RM_MFS_FILE"] = "Timed out removing MFS paths. We may need to nuke the whole MFS directory and republish everything";
5159
+ messages["ERR_TIMED_OUT_RM_MFS_FILE"] = "Timed out removing MFS paths";
5160
5160
  messages["ERR_ABORTED_RESOLVING_TEXT_RECORD"] = "Aborted resolving text record on domain";
5161
5161
  messages["ERR_CALLED_COMMUNITY_STOP_WITHOUT_UPDATE"] = "community.stop() called without calling update() first";
5162
5162
  messages["ERR_PKC_MISSING_NATIVE_FUNCTIONS"] = "missing nativeFunctions required to create a community";
@@ -5166,6 +5166,15 @@ var messages;
5166
5166
  messages["ERR_FAILED_TO_SET_CONFIG_ON_KUBO_NODE"] = "Failed to set config on kubo node";
5167
5167
  messages["ERR_FAILED_TO_SHUTDOWN_KUBO_NODE"] = "Failed to shutdown kubo node";
5168
5168
  messages["ERR_CAN_NOT_CREATE_A_LOCAL_COMMUNITY"] = "Can't create a new local community with the provided arguments";
5169
+ messages["ERR_CAN_NOT_CREATE_A_COMMUNITY_WITH_BOTH_SIGNER_AND_ANCHOR"] = "Can't create a community with both a signer and an anchor: a signer means the node holds the identity key, an anchor means the owner does";
5170
+ messages["ERR_CAN_NOT_CREATE_A_COMMUNITY_WITH_BOTH_ANCHOR_AND_IDENTIFIER"] = "Can't create a community with both an anchor and an address/name/publicKey: a delegated community is keyed by its anchor, so any other identifier would be silently ignored";
5171
+ messages["ERR_ANCHOR_PUBLIC_KEY_IS_INVALID"] = "anchor.publicKey is not a valid IPNS name: it becomes the community's address, so it has to be the same B58 representation community.publicKey uses";
5172
+ messages["ERR_COMMUNITY_IS_NOT_DELEGATED"] = "This community has no anchor, so it publishes under its own key and has no anchor record to prepare or publish";
5173
+ messages["ERR_UNABLE_TO_DETERMINE_ANCHOR_SEQUENCE"] = "Unable to determine the next anchor record sequence: neither this node nor the network knows one, and answering 0 could produce a record that can never win";
5174
+ messages["ERR_ANCHOR_IPNS_RECORD_IS_INVALID"] = "The anchor IPNS record is malformed or is not signed by the community's anchor key";
5175
+ messages["ERR_ANCHOR_IPNS_RECORD_POINTS_TO_DIFFERENT_MINTER"] = "The anchor IPNS record does not point at this node's minter key for this community";
5176
+ messages["ERR_ANCHOR_IPNS_RECORD_SEQUENCE_IS_NOT_GREATER"] = "The anchor IPNS record's sequence is not strictly greater than the highest already accepted (replay or rollback)";
5177
+ messages["ERR_DELEGATED_COMMUNITY_HAS_NO_ANCHOR_RECORD"] = "Can't start a delegated community before its anchor record has been published: nothing points the anchor at this node's minter, so the community would not be resolvable";
5169
5178
  messages["ERR_COMMUNITY_ADDRESS_IS_PROVIDED_AS_NULL_OR_UNDEFINED"] = "User provided options.address in createCommunity that is either undefined or null";
5170
5179
  messages["ERR_UNABLE_TO_DERIVE_PUBSUB_COMMENT_PUBLICATION_FROM_JSONIFIED_COMMENT"] = "User provided a jsonfied (cloned) Comment and we're unable to derive request.comment from it. This is an implementation error";
5171
5180
  messages["ERR_UNABLE_TO_DERIVE_PUBSUB_COMMENT_EDIT_PUBLICATION_FROM_JSONIFIED_COMMENT_EDIT"] = "User provided a jsonfied (cloned) CommentEdit and we're unable to derive request.commentEdit from it. This is an implementation error";
@@ -5479,6 +5488,7 @@ var messages;
5479
5488
  messages["ERR_RPC_CLIENT_TRYING_TO_STOP_REMOTE_COMMUNITY"] = "RPC client is attempting to stop a remote community";
5480
5489
  messages["ERR_RPC_CLIENT_TRYING_TO_EDIT_REMOTE_COMMUNITY"] = "RPC client is attempting to edit remote community";
5481
5490
  messages["ERR_RPC_CLIENT_TRYING_TO_DELETE_REMOTE_COMMUNITY"] = "RPC client is attempting to delete remote community";
5491
+ messages["ERR_RPC_CLIENT_TRYING_TO_USE_ANCHOR_METHOD_ON_NON_LOCAL_COMMUNITY"] = "RPC client is attempting to prepare or publish an anchor record for a community this node does not host locally";
5482
5492
  messages["ERR_GENERIC_RPC_CLIENT_CALL_ERROR"] = "RPC client received an unknown error when executing call over websocket";
5483
5493
  messages["ERR_RPC_CALL_TIMED_OUT"] = "RPC client call timed out without receiving a response from the RPC server";
5484
5494
  messages["ERR_RPC_CLIENT_CHALLENGE_NAME_NOT_AVAILABLE_ON_SERVER"] = "The challenge name is not available on the RPC server. Available challenges are listed in details.availableChallenges";
@@ -6104,6 +6114,13 @@ const isIpfsCid$1 = (value) => {
6104
6114
  return false;
6105
6115
  }
6106
6116
  };
6117
+ const isIpnsName = (value) => {
6118
+ try {
6119
+ return Boolean(peerIdFromString(value));
6120
+ } catch {
6121
+ return false;
6122
+ }
6123
+ };
6107
6124
  const CidStringSchema = string().refine((arg) => isIpfsCid$1(arg), messages.ERR_CID_IS_INVALID);
6108
6125
  const CidPathSchema = string().transform((arg) => arg.split("/")[2]).refine((arg) => isIpfsCid$1(arg), messages.ERR_CID_IS_INVALID);
6109
6126
  const ChainTickerSchema$1 = string().min(1);
@@ -6708,8 +6725,10 @@ const CommunityEditOptionsSchema = CommunityIpfsSchema.pick({
6708
6725
  settings: CommunitySettingsSchema.optional(),
6709
6726
  roles: CommunityRolesToEditSchema.optional()
6710
6727
  }).partial().strict();
6728
+ const CommunityAnchorSchema = object({ publicKey: string().refine((arg) => isIpnsName(arg), messages.ERR_ANCHOR_PUBLIC_KEY_IS_INVALID) }).strict();
6711
6729
  const CreateNewLocalCommunityUserOptionsSchema = CommunityEditOptionsSchema.omit({ address: true }).extend({
6712
6730
  signer: CreateSignerSchema.optional(),
6731
+ anchor: CommunityAnchorSchema.optional(),
6713
6732
  roles: CommunityIpfsSchema.shape.roles
6714
6733
  }).strict();
6715
6734
  CreateNewLocalCommunityUserOptionsSchema.extend({
@@ -6766,6 +6785,7 @@ const CommunityIpfsReservedFields = r$2([
6766
6785
  "shortAddress",
6767
6786
  "nameResolved",
6768
6787
  "ipnsHops",
6788
+ "anchor",
6769
6789
  "raw",
6770
6790
  "shortCommunityAddress",
6771
6791
  "deleted",
@@ -15740,7 +15760,11 @@ async function retryKuboIpfsAdd({ ipfsClient: kuboRpcClient, log, content, input
15740
15760
  }
15741
15761
  async function writeKuboFilesWithTimeout({ ipfsClient: kuboRpcClient, log, path, content, inputNumOfRetries, options, timeoutMs }) {
15742
15762
  const numOfRetries = inputNumOfRetries ?? 3;
15743
- const timeoutMilliseconds = timeoutMs ?? 15e3;
15763
+ const timeoutMilliseconds = timeoutMs ?? 6e4;
15764
+ const writeOptions = {
15765
+ timeout: timeoutMilliseconds,
15766
+ ...options
15767
+ };
15744
15768
  return new Promise((resolve, reject) => {
15745
15769
  const operation = import_retry.operation({
15746
15770
  retries: numOfRetries,
@@ -15749,9 +15773,9 @@ async function writeKuboFilesWithTimeout({ ipfsClient: kuboRpcClient, log, path,
15749
15773
  });
15750
15774
  operation.attempt(async (currentAttempt) => {
15751
15775
  try {
15752
- await pTimeout(kuboRpcClient.files.write(path, content, options), {
15753
- milliseconds: timeoutMilliseconds,
15754
- message: `Timed out writing to MFS path ${path} after ${timeoutMilliseconds}ms`
15776
+ await pTimeout(kuboRpcClient.files.write(path, content, writeOptions), {
15777
+ milliseconds: timeoutMilliseconds + 5e3,
15778
+ message: `Timed out writing to MFS path ${path} after ${timeoutMilliseconds + 5e3}ms`
15755
15779
  });
15756
15780
  resolve();
15757
15781
  } catch (error) {
@@ -16035,7 +16059,7 @@ function extractNetworkErrorDetails(err, depth = 0) {
16035
16059
  }
16036
16060
  //#endregion
16037
16061
  //#region dist/node/generated-version.js
16038
- const version = "0.0.75";
16062
+ const version = "0.0.77";
16039
16063
  //#endregion
16040
16064
  //#region dist/node/version.js
16041
16065
  const protocolVersion = ProtocolVersionSchema.parse("1.0.0");
@@ -16189,4 +16213,4 @@ const DecryptedChallengeVerificationSchema = object({
16189
16213
  }).strict();
16190
16214
  const ChallengeVerificationMessageSignedPropertyNames = t$3(n$3(ChallengeVerificationMessageSchema.shape, ["signature"]));
16191
16215
  //#endregion
16192
- export { pubsubTopicToDhtKey as $, t$2 as $n, CommunityEditOptionsSchema as $t, extractNetworkErrorDetails as A, CreateCommentOptionsWithRefinementSchema as An, record as Ar, trackStartedCommunity as At, isIpfsCid as B, CreateCommentEditOptionsWithRefinementSchema as Bn, CommunityEditPublicationPubsubReservedFields as Bt, contentContainsMarkdownAudio as C, CommentUpdateForChallengeVerificationSchema as Cn, _enum as Cr, findUpdatingCommunity as Ct, deepMergeRuntimeFields as D, CommentUpdateSignedPropertyNames as Dn, literal as Dr, refreshTrackedCommentAliases as Dt, createAbortError as E, CommentUpdateSchema as En, custom as Er, listUpdatingCommunities as Et, getIpnsRecordInLocalKuboNode as F, CommentEditPubsubMessagePublicationSchema as Fn, stringifyPrimitive as Fr, untrackUpdatingCommunity as Ft, isLinkOfAudio as G, CidPathSchema as Gn, CommentModerationPubsubMessagePublicationSchema as Gt, isIpns as H, AuthorCommentIpfsReservedFields as Hn, CommunityEditPubsubMessagePublicationSchema as Ht, getPostUpdateTimestampRange as I, CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema as In, require_sha256 as It, isLinkOfVideo as J, CommunityAuthorChallengeReservedFieldNames as Jn, CommentModerationsTableRowSchema as Jt, isLinkOfImage as K, CidStringSchema as Kn, CommentModerationReservedFields as Kt, hideClassPrivateProps as L, CommentEditReservedFields as Ln, TimeoutError as Lt, genToArray as M, ModQueuePageIpfsSchema as Mn, ZodError as Mr, trackUpdatingCommunity as Mt, getEquivalentCommunityAddresses as N, PageIpfsSchema as Nn, joinValues as Nr, untrackStartedCommunity as Nt, derivePublicationFromChallengeRequest as O, CommentUpdateTableRowSchema as On, number as Or, refreshTrackedCommunityAliases as Ot, getErrorCodeFromMessage as P, CommentEditChallengeRequestToEncryptSchema as Pn, parsedType as Pr, untrackUpdatingComment as Pt, isStringDomain as Q, n$3 as Qn, CommunityChallengeSettingSchema as Qt, ipnsNameToIpnsOverPubsubTopic as R, CommentEditSignedPropertyNames as Rn, pTimeout as Rt, calculateStringSizeSameAsIpfsAddCidV0 as S, CommentUpdateChallengeReservedFieldNames as Sn, setErrorMap as Sr, findUpdatingComment as St, contentContainsMarkdownVideos as T, CommentUpdateReservedFields as Tn, boolean as Tr, listUpdatingComments as Tt, isIpnsPath as U, AuthorReservedFields as Un, CreateCommunityEditPublicationOptionsWithRefinementSchema as Ut, isIpfsPath as V, AuthorAddressSchema as Vn, CommunityEditPublicationSignedPropertyNames as Vt, isLinkOfAnimatedImage as W, ChallengeAnswersSchema as Wn, CommentModerationChallengeRequestToEncryptSchema as Wt, isRequestPubsubPublicationOfPost as X, n as Xn, ChallengeFileFactorySchema as Xt, isLinkValid as Y, CreateSignerSchema as Yn, CreateCommentModerationOptionsWithRefinementSchema as Yt, isRequestPubsubPublicationOfReply as Z, t$1 as Zn, ChallengeFileSchema as Zt, PKCUserOptionBaseSchema as _, CommentIpfsReservedFields as _n, PKCError as _r, timestamp as _t, ChallengeRequestMessageSchema as a, CreateRemoteCommunityFunctionArgumentSchema as an, t$5 as ar, removeNullUndefinedValues as at, areEquivalentCommunityAddresses as b, CommentPubsubMessageWithFlexibleAuthorRefinementSchema as bn, require_supports_color as br, findCommunityInRegistry as bt, ChallengeVerificationMessageSignedPropertyNames as c, PubsubTopicSchema as cn, t$7 as cr, resolveWhenPredicateIsTrue as ct, DecryptedChallengeRequestSchema as d, VoteChallengeRequestToEncryptSchema as dn, require_retry as dr, retryKuboIpfsAddAndProvide as dt, CommunityExportRecordsSchema as en, t$3 as er, pubsubTopicToDhtKeyCid as et, DecryptedChallengeSchema as f, VotePubsubMessagePublicationSchema as fn, FailedToFetchCommentIpfsFromGatewaysError as fr, shortifyAddress as ft, PKCParsedOptionsSchema as g, CommentChallengeRequestToEncryptSchema as gn, FailedToFetchPageIpfsFromGatewaysError as gr, throwIfAbortSignalAborted as gt, NameResolverSerializedSchema as h, VoteTablesRowSchema as hn, FailedToFetchGenericIpfsFromGatewaysError as hr, statMfsPathSafely as ht, ChallengeMessageSignedPropertyNames as i, CreateNewLocalCommunityUserOptionsSchema as in, r$2 as ir, removeNullUndefinedEmptyObjectsValuesRecursively as it, fetchAndValidateIpnsRecordFromGateway as j, GetPageParamSchema as jn, string as jr, trackUpdatingComment as jt, doesDomainAddressHaveCapitalLetter as k, CommentsTableRowSchema as kn, object as kr, syncCommunityRegistryEntry as kt, DecryptedChallengeAnswerSchema as l, RpcRemoteCommunityUpdateEventResultSchema as ln, t$8 as lr, retryKuboBlockPutPinAndProvidePubsubTopic as lt, NameResolveCacheOptionsSchema as m, VoteSignedPropertyNames as mn, FailedToFetchCommunityFromGatewaysError as mr, sleepUntilTimeoutOrAbort as mt, ChallengeAnswerMessageSignedPropertyNames as n, CommunityIpfsSchema as nn, e$2 as nr, removeBlocksFromKuboNode as nt, ChallengeRequestMessageSignedPropertyNames as o, CreateRpcCommunityFunctionArgumentSchema as on, n$7 as or, removeUndefinedValuesRecursively as ot, DecryptedChallengeVerificationSchema as p, VotePubsubReservedFields as pn, FailedToFetchCommentUpdateFromGatewaysError as pr, shortifyCid as pt, isLinkOfMedia as q, CommunityAddressSchema as qn, CommentModerationSignedPropertyNames as qt, ChallengeMessageSchema as r, CommunitySignedPropertyNames as rn, t$4 as rr, removeMfsFilesSafely as rt, ChallengeVerificationMessageSchema as s, ExportCommunityModLogsOptionsSchema as sn, r$4 as sr, replaceXWithY as st, ChallengeAnswerMessageSchema as t, CommunityIpfsReservedFields as tn, e as tr, raceAgainstAbort as tt, DecryptedChallengeRequestPublicationSchema as u, CreateVoteUserOptionsWithRefinementSchema as un, e$4 as ur, retryKuboIpfsAdd as ut, PKCUserOptionsSchema as v, CommentIpfsSchema as vn, messages as vr, waitForUpdateInCommunityInstanceWithErrorAndTimeout as vt, contentContainsMarkdownImages as w, CommentUpdateForChallengeVerificationSignedPropertyNames as wn, array as wr, listStartedCommunities as wt, calculateIpfsCidV0 as x, CommentSignedPropertyNames as xn, require_ms as xr, findStartedCommunity as xt, version_default as y, CommentPubsubMessageReservedFields as yn, logger_default as yr, writeKuboFilesWithTimeout as yt, isAbortError as z, CommentEditsTableRowSchema as zn, CommunityEditPublicationChallengeRequestToEncryptSchema as zt };
16216
+ export { pubsubTopicToDhtKey as $, n$3 as $n, CommunityChallengeSettingSchema as $t, extractNetworkErrorDetails as A, CommentsTableRowSchema as An, object as Ar, trackStartedCommunity as At, isIpfsCid as B, CommentEditsTableRowSchema as Bn, CommunityEditPublicationPubsubReservedFields as Bt, contentContainsMarkdownAudio as C, CommentUpdateChallengeReservedFieldNames as Cn, setErrorMap as Cr, findUpdatingCommunity as Ct, deepMergeRuntimeFields as D, CommentUpdateSchema as Dn, custom as Dr, refreshTrackedCommentAliases as Dt, createAbortError as E, CommentUpdateReservedFields as En, boolean as Er, listUpdatingCommunities as Et, getIpnsRecordInLocalKuboNode as F, CommentEditChallengeRequestToEncryptSchema as Fn, parsedType as Fr, untrackUpdatingCommunity as Ft, isLinkOfAudio as G, ChallengeAnswersSchema as Gn, CommentModerationPubsubMessagePublicationSchema as Gt, isIpns as H, AuthorAddressSchema as Hn, CommunityEditPubsubMessagePublicationSchema as Ht, getPostUpdateTimestampRange as I, CommentEditPubsubMessagePublicationSchema as In, stringifyPrimitive as Ir, require_sha256 as It, isLinkOfVideo as J, CommunityAddressSchema as Jn, CommentModerationsTableRowSchema as Jt, isLinkOfImage as K, CidPathSchema as Kn, CommentModerationReservedFields as Kt, hideClassPrivateProps as L, CommentEditPubsubMessagePublicationWithFlexibleAuthorSchema as Ln, TimeoutError as Lt, genToArray as M, GetPageParamSchema as Mn, string as Mr, trackUpdatingCommunity as Mt, getEquivalentCommunityAddresses as N, ModQueuePageIpfsSchema as Nn, ZodError as Nr, untrackStartedCommunity as Nt, derivePublicationFromChallengeRequest as O, CommentUpdateSignedPropertyNames as On, literal as Or, refreshTrackedCommunityAliases as Ot, getErrorCodeFromMessage as P, PageIpfsSchema as Pn, joinValues as Pr, untrackUpdatingComment as Pt, isStringDomain as Q, t$1 as Qn, CommunityAnchorSchema as Qt, ipnsNameToIpnsOverPubsubTopic as R, CommentEditReservedFields as Rn, pTimeout as Rt, calculateStringSizeSameAsIpfsAddCidV0 as S, CommentSignedPropertyNames as Sn, require_ms as Sr, findUpdatingComment as St, contentContainsMarkdownVideos as T, CommentUpdateForChallengeVerificationSignedPropertyNames as Tn, array as Tr, listUpdatingComments as Tt, isIpnsPath as U, AuthorCommentIpfsReservedFields as Un, CreateCommunityEditPublicationOptionsWithRefinementSchema as Ut, isIpfsPath as V, CreateCommentEditOptionsWithRefinementSchema as Vn, CommunityEditPublicationSignedPropertyNames as Vt, isLinkOfAnimatedImage as W, AuthorReservedFields as Wn, CommentModerationChallengeRequestToEncryptSchema as Wt, isRequestPubsubPublicationOfPost as X, CreateSignerSchema as Xn, ChallengeFileFactorySchema as Xt, isLinkValid as Y, CommunityAuthorChallengeReservedFieldNames as Yn, CreateCommentModerationOptionsWithRefinementSchema as Yt, isRequestPubsubPublicationOfReply as Z, n as Zn, ChallengeFileSchema as Zt, PKCUserOptionBaseSchema as _, CommentChallengeRequestToEncryptSchema as _n, FailedToFetchPageIpfsFromGatewaysError as _r, timestamp as _t, ChallengeRequestMessageSchema as a, CreateNewLocalCommunityUserOptionsSchema as an, r$2 as ar, removeNullUndefinedValues as at, areEquivalentCommunityAddresses as b, CommentPubsubMessageReservedFields as bn, logger_default as br, findCommunityInRegistry as bt, ChallengeVerificationMessageSignedPropertyNames as c, ExportCommunityModLogsOptionsSchema as cn, r$4 as cr, resolveWhenPredicateIsTrue as ct, DecryptedChallengeRequestSchema as d, CreateVoteUserOptionsWithRefinementSchema as dn, e$4 as dr, retryKuboIpfsAddAndProvide as dt, CommunityEditOptionsSchema as en, t$2 as er, pubsubTopicToDhtKeyCid as et, DecryptedChallengeSchema as f, VoteChallengeRequestToEncryptSchema as fn, require_retry as fr, shortifyAddress as ft, PKCParsedOptionsSchema as g, VoteTablesRowSchema as gn, FailedToFetchGenericIpfsFromGatewaysError as gr, throwIfAbortSignalAborted as gt, NameResolverSerializedSchema as h, VoteSignedPropertyNames as hn, FailedToFetchCommunityFromGatewaysError as hr, statMfsPathSafely as ht, ChallengeMessageSignedPropertyNames as i, CommunitySignedPropertyNames as in, t$4 as ir, removeNullUndefinedEmptyObjectsValuesRecursively as it, fetchAndValidateIpnsRecordFromGateway as j, CreateCommentOptionsWithRefinementSchema as jn, record as jr, trackUpdatingComment as jt, doesDomainAddressHaveCapitalLetter as k, CommentUpdateTableRowSchema as kn, number as kr, syncCommunityRegistryEntry as kt, DecryptedChallengeAnswerSchema as l, PubsubTopicSchema as ln, t$7 as lr, retryKuboBlockPutPinAndProvidePubsubTopic as lt, NameResolveCacheOptionsSchema as m, VotePubsubReservedFields as mn, FailedToFetchCommentUpdateFromGatewaysError as mr, sleepUntilTimeoutOrAbort as mt, ChallengeAnswerMessageSignedPropertyNames as n, CommunityIpfsReservedFields as nn, e as nr, removeBlocksFromKuboNode as nt, ChallengeRequestMessageSignedPropertyNames as o, CreateRemoteCommunityFunctionArgumentSchema as on, t$5 as or, removeUndefinedValuesRecursively as ot, DecryptedChallengeVerificationSchema as p, VotePubsubMessagePublicationSchema as pn, FailedToFetchCommentIpfsFromGatewaysError as pr, shortifyCid as pt, isLinkOfMedia as q, CidStringSchema as qn, CommentModerationSignedPropertyNames as qt, ChallengeMessageSchema as r, CommunityIpfsSchema as rn, e$2 as rr, removeMfsFilesSafely as rt, ChallengeVerificationMessageSchema as s, CreateRpcCommunityFunctionArgumentSchema as sn, n$7 as sr, replaceXWithY as st, ChallengeAnswerMessageSchema as t, CommunityExportRecordsSchema as tn, t$3 as tr, raceAgainstAbort as tt, DecryptedChallengeRequestPublicationSchema as u, RpcRemoteCommunityUpdateEventResultSchema as un, t$8 as ur, retryKuboIpfsAdd as ut, PKCUserOptionsSchema as v, CommentIpfsReservedFields as vn, PKCError as vr, waitForUpdateInCommunityInstanceWithErrorAndTimeout as vt, contentContainsMarkdownImages as w, CommentUpdateForChallengeVerificationSchema as wn, _enum as wr, listStartedCommunities as wt, calculateIpfsCidV0 as x, CommentPubsubMessageWithFlexibleAuthorRefinementSchema as xn, require_supports_color as xr, findStartedCommunity as xt, version_default as y, CommentIpfsSchema as yn, messages as yr, writeKuboFilesWithTimeout as yt, isAbortError as z, CommentEditSignedPropertyNames as zn, CommunityEditPublicationChallengeRequestToEncryptSchema as zt };
@@ -1,4 +1,4 @@
1
- import { _r as PKCError, et as pubsubTopicToDhtKeyCid } from "./schema-wNdSno5O.js";
1
+ import { et as pubsubTopicToDhtKeyCid, vr as PKCError } from "./schema-Bu4z3MGE.js";
2
2
  import { ipnsSelector } from "ipns/selector";
3
3
  import { equals } from "uint8arrays/equals";
4
4
  //#region dist/node/helia/util.js
@@ -15,5 +15,6 @@ const nativeFunctions = index.nativeFunctions;
15
15
  const getShortCid = index.getShortCid;
16
16
  const getShortAddress = index.getShortAddress;
17
17
  const challenges = index.challenges;
18
+ const createAnchorIpnsRecord = index.createAnchorIpnsRecord;
18
19
  //#endregion
19
- export { challenges, index_with_compile_cache_default as default, getShortAddress, getShortCid, nativeFunctions, setNativeFunctions };
20
+ export { challenges, createAnchorIpnsRecord, index_with_compile_cache_default as default, getShortAddress, getShortCid, nativeFunctions, setNativeFunctions };