@seedprotocol/publish 0.6.7 → 0.6.8

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 (255) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +69 -11
  3. package/dist/chainConfig-3sSqEVQh.js +1433 -0
  4. package/dist/chainConfig-3sSqEVQh.js.map +1 -0
  5. package/dist/chainConfig-3wlYarAG.js +1433 -0
  6. package/dist/chainConfig-3wlYarAG.js.map +1 -0
  7. package/dist/chainConfig-BRcsMopd.js +1442 -0
  8. package/dist/chainConfig-BRcsMopd.js.map +1 -0
  9. package/dist/chainConfig-BYm5OXpk.js +1433 -0
  10. package/dist/chainConfig-BYm5OXpk.js.map +1 -0
  11. package/dist/chainConfig-CfVGYAsY.js +1311 -0
  12. package/dist/chainConfig-CfVGYAsY.js.map +1 -0
  13. package/dist/chainConfig-DDA4YmAB.js +1424 -0
  14. package/dist/chainConfig-DDA4YmAB.js.map +1 -0
  15. package/dist/config-CPBd5C_b.js +1201 -0
  16. package/dist/config-CPBd5C_b.js.map +1 -0
  17. package/dist/config-DkIapO94.js +955 -0
  18. package/dist/config-DkIapO94.js.map +1 -0
  19. package/dist/config-EQZZNH9H.js +955 -0
  20. package/dist/config-EQZZNH9H.js.map +1 -0
  21. package/dist/config.d.ts +85 -6
  22. package/dist/config.d.ts.map +1 -1
  23. package/dist/ensureAutomationSessionKey-BMHLKfjj.js +85 -0
  24. package/dist/ensureAutomationSessionKey-BMHLKfjj.js.map +1 -0
  25. package/dist/ensureAutomationSessionKey-BZ9_3FMW.js +86 -0
  26. package/dist/ensureAutomationSessionKey-BZ9_3FMW.js.map +1 -0
  27. package/dist/ensureAutomationSessionKey-C8D7BFjU.js +85 -0
  28. package/dist/ensureAutomationSessionKey-C8D7BFjU.js.map +1 -0
  29. package/dist/ensureAutomationSessionKey-CClLVX2w.js +85 -0
  30. package/dist/ensureAutomationSessionKey-CClLVX2w.js.map +1 -0
  31. package/dist/ensureAutomationSessionKey-CNNN1jBQ.js +85 -0
  32. package/dist/ensureAutomationSessionKey-CNNN1jBQ.js.map +1 -0
  33. package/dist/ensureAutomationSessionKey-D8Gki6U6.js +85 -0
  34. package/dist/ensureAutomationSessionKey-D8Gki6U6.js.map +1 -0
  35. package/dist/ensureAutomationSessionKey-DEH7nwUc.js +86 -0
  36. package/dist/ensureAutomationSessionKey-DEH7nwUc.js.map +1 -0
  37. package/dist/ensureAutomationSessionKey-Dhvbii2M.js +86 -0
  38. package/dist/ensureAutomationSessionKey-Dhvbii2M.js.map +1 -0
  39. package/dist/ensureAutomationSessionKey-Dyfk8qVp.js +85 -0
  40. package/dist/ensureAutomationSessionKey-Dyfk8qVp.js.map +1 -0
  41. package/dist/ensureModularPublishBootstrap-5HJDqJJM.js +24 -0
  42. package/dist/ensureModularPublishBootstrap-5HJDqJJM.js.map +1 -0
  43. package/dist/ensureModularPublishBootstrap-BW8jKN_A.js +24 -0
  44. package/dist/ensureModularPublishBootstrap-BW8jKN_A.js.map +1 -0
  45. package/dist/ensureModularPublishBootstrap-Btih5xbB.js +129 -0
  46. package/dist/ensureModularPublishBootstrap-Btih5xbB.js.map +1 -0
  47. package/dist/ensureModularPublishBootstrap-CI4U08Gc.js +129 -0
  48. package/dist/ensureModularPublishBootstrap-CI4U08Gc.js.map +1 -0
  49. package/dist/ensureModularPublishBootstrap-CcU-hXll.js +128 -0
  50. package/dist/ensureModularPublishBootstrap-CcU-hXll.js.map +1 -0
  51. package/dist/ensureModularPublishBootstrap-CdrykHAi.js +24 -0
  52. package/dist/ensureModularPublishBootstrap-CdrykHAi.js.map +1 -0
  53. package/dist/ensureModularPublishBootstrap-DGBKVGg5.js +24 -0
  54. package/dist/ensureModularPublishBootstrap-DGBKVGg5.js.map +1 -0
  55. package/dist/ensureModularPublishBootstrap-DaREOqSc.js +129 -0
  56. package/dist/ensureModularPublishBootstrap-DaREOqSc.js.map +1 -0
  57. package/dist/ensureModularPublishBootstrap-DxIG-LUP.js +24 -0
  58. package/dist/ensureModularPublishBootstrap-DxIG-LUP.js.map +1 -0
  59. package/dist/ensureSmartWalletThenPublish-BSYzckyS.js +49 -0
  60. package/dist/ensureSmartWalletThenPublish-BSYzckyS.js.map +1 -0
  61. package/dist/ensureSmartWalletThenPublish-Bf8FN1un.js +49 -0
  62. package/dist/ensureSmartWalletThenPublish-Bf8FN1un.js.map +1 -0
  63. package/dist/ensureSmartWalletThenPublish-Bl415Ss6.js +48 -0
  64. package/dist/ensureSmartWalletThenPublish-Bl415Ss6.js.map +1 -0
  65. package/dist/ensureSmartWalletThenPublish-CE7acryB.js +49 -0
  66. package/dist/ensureSmartWalletThenPublish-CE7acryB.js.map +1 -0
  67. package/dist/ensureSmartWalletThenPublish-D5GSZRyZ.js +48 -0
  68. package/dist/ensureSmartWalletThenPublish-D5GSZRyZ.js.map +1 -0
  69. package/dist/ensureSmartWalletThenPublish-DAomriGc.js +48 -0
  70. package/dist/ensureSmartWalletThenPublish-DAomriGc.js.map +1 -0
  71. package/dist/ensureSmartWalletThenPublish-DaZf3q5S.js +48 -0
  72. package/dist/ensureSmartWalletThenPublish-DaZf3q5S.js.map +1 -0
  73. package/dist/ensureSmartWalletThenPublish-ekb0xJRn.js +48 -0
  74. package/dist/ensureSmartWalletThenPublish-ekb0xJRn.js.map +1 -0
  75. package/dist/ensureSmartWalletThenPublish-v5fhvKxZ.js +48 -0
  76. package/dist/ensureSmartWalletThenPublish-v5fhvKxZ.js.map +1 -0
  77. package/dist/errors-Du3LNbJN.js.map +1 -1
  78. package/dist/errors.d.ts +2 -2
  79. package/dist/errors.d.ts.map +1 -1
  80. package/dist/helpers/abi/executor.d.ts +128 -0
  81. package/dist/helpers/abi/executor.d.ts.map +1 -1
  82. package/dist/helpers/abi/factory.d.ts +1 -1
  83. package/dist/helpers/abi/factory.d.ts.map +1 -1
  84. package/dist/helpers/abi/publisher.d.ts +11 -0
  85. package/dist/helpers/abi/publisher.d.ts.map +1 -1
  86. package/dist/helpers/abi/seedErrors.d.ts +141 -0
  87. package/dist/helpers/abi/seedErrors.d.ts.map +1 -0
  88. package/dist/helpers/abi/seedExecutorRouter.d.ts +60 -0
  89. package/dist/helpers/abi/seedExecutorRouter.d.ts.map +1 -0
  90. package/dist/helpers/adapters/permissionlessTxSender.d.ts +26 -0
  91. package/dist/helpers/adapters/permissionlessTxSender.d.ts.map +1 -1
  92. package/dist/helpers/adapters/thirdwebAccount.d.ts +10 -2
  93. package/dist/helpers/adapters/thirdwebAccount.d.ts.map +1 -1
  94. package/dist/helpers/approvedTargetsForAutomationPublish.d.ts +1 -1
  95. package/dist/helpers/blockchain.d.ts +4 -0
  96. package/dist/helpers/blockchain.d.ts.map +1 -1
  97. package/dist/helpers/chainClient.d.ts.map +1 -1
  98. package/dist/helpers/chainConfig.d.ts +2 -0
  99. package/dist/helpers/chainConfig.d.ts.map +1 -1
  100. package/dist/helpers/constants.d.ts +14 -3
  101. package/dist/helpers/constants.d.ts.map +1 -1
  102. package/dist/helpers/contracts/index.d.ts +25 -0
  103. package/dist/helpers/contracts/index.d.ts.map +1 -1
  104. package/dist/helpers/defaultApprovedTargetsForModularPublish.d.ts +12 -2
  105. package/dist/helpers/defaultApprovedTargetsForModularPublish.d.ts.map +1 -1
  106. package/dist/helpers/describeRevert.d.ts +33 -0
  107. package/dist/helpers/describeRevert.d.ts.map +1 -0
  108. package/dist/helpers/easDirect.d.ts +3 -8
  109. package/dist/helpers/easDirect.d.ts.map +1 -1
  110. package/dist/helpers/enrollPublishAutomation.d.ts +6 -2
  111. package/dist/helpers/enrollPublishAutomation.d.ts.map +1 -1
  112. package/dist/helpers/ensureAutomationSessionKey.d.ts.map +1 -1
  113. package/dist/helpers/ensureEip7702ModularAccountReady.d.ts +1 -1
  114. package/dist/helpers/ensureEip7702ModularAccountReady.d.ts.map +1 -1
  115. package/dist/helpers/ensureExecutorModule.d.ts +6 -3
  116. package/dist/helpers/ensureExecutorModule.d.ts.map +1 -1
  117. package/dist/helpers/ensureManagedAccountEasConfigured.d.ts +8 -3
  118. package/dist/helpers/ensureManagedAccountEasConfigured.d.ts.map +1 -1
  119. package/dist/helpers/ensureManagedAccountReady.d.ts.map +1 -1
  120. package/dist/helpers/ensureManagedSignerSessionKey.d.ts +5 -0
  121. package/dist/helpers/ensureManagedSignerSessionKey.d.ts.map +1 -1
  122. package/dist/helpers/ensureModularPublishBootstrap.d.ts +6 -2
  123. package/dist/helpers/ensureModularPublishBootstrap.d.ts.map +1 -1
  124. package/dist/helpers/ensureSmartWalletThenPublish.d.ts.map +1 -1
  125. package/dist/helpers/executorModuleReadiness.d.ts +28 -0
  126. package/dist/helpers/executorModuleReadiness.d.ts.map +1 -0
  127. package/dist/helpers/managedAccountAdmin.d.ts +12 -0
  128. package/dist/helpers/managedAccountAdmin.d.ts.map +1 -0
  129. package/dist/helpers/publishThirdwebClient.d.ts +10 -0
  130. package/dist/helpers/publishThirdwebClient.d.ts.map +1 -0
  131. package/dist/helpers/retryNonceTooLow.d.ts +12 -0
  132. package/dist/helpers/retryNonceTooLow.d.ts.map +1 -0
  133. package/dist/helpers/seedSigner.d.ts.map +1 -1
  134. package/dist/helpers/seedTwin.d.ts +47 -0
  135. package/dist/helpers/seedTwin.d.ts.map +1 -0
  136. package/dist/helpers/thirdweb.d.ts +21 -6
  137. package/dist/helpers/thirdweb.d.ts.map +1 -1
  138. package/dist/helpers/thirdwebChain.d.ts +21 -0
  139. package/dist/helpers/thirdwebChain.d.ts.map +1 -0
  140. package/dist/helpers/verifyPublishChain.d.ts +21 -0
  141. package/dist/helpers/verifyPublishChain.d.ts.map +1 -0
  142. package/dist/hooks/useItemPublishStatus.d.ts +2 -0
  143. package/dist/hooks/useItemPublishStatus.d.ts.map +1 -1
  144. package/dist/index.d.ts +9 -2
  145. package/dist/index.d.ts.map +1 -1
  146. package/dist/index.js +478 -398
  147. package/dist/index.js.map +1 -1
  148. package/dist/managedAccountAdmin-B64V1rlU.js +29 -0
  149. package/dist/managedAccountAdmin-B64V1rlU.js.map +1 -0
  150. package/dist/managedAccountAdmin-BVLGWpEb.js +29 -0
  151. package/dist/managedAccountAdmin-BVLGWpEb.js.map +1 -0
  152. package/dist/managedAccountAdmin-Bje6X8Ds.js +29 -0
  153. package/dist/managedAccountAdmin-Bje6X8Ds.js.map +1 -0
  154. package/dist/managedAccountAdmin-C84-IlQ9.js +29 -0
  155. package/dist/managedAccountAdmin-C84-IlQ9.js.map +1 -0
  156. package/dist/managedAccountAdmin-DhCRBoPX.js +29 -0
  157. package/dist/managedAccountAdmin-DhCRBoPX.js.map +1 -0
  158. package/dist/publishAuthorization-B0G1em4a.js +3695 -0
  159. package/dist/publishAuthorization-B0G1em4a.js.map +1 -0
  160. package/dist/publishAuthorization-B1BVVfp0.js +3604 -0
  161. package/dist/publishAuthorization-B1BVVfp0.js.map +1 -0
  162. package/dist/publishAuthorization-Bltn3y_K.js +3599 -0
  163. package/dist/publishAuthorization-Bltn3y_K.js.map +1 -0
  164. package/dist/publishAuthorization-By2Tt9kW.js +3912 -0
  165. package/dist/publishAuthorization-By2Tt9kW.js.map +1 -0
  166. package/dist/publishAuthorization-CxBkijU6.js +3925 -0
  167. package/dist/publishAuthorization-CxBkijU6.js.map +1 -0
  168. package/dist/publishAuthorization-CxWY7lAQ.js +3706 -0
  169. package/dist/publishAuthorization-CxWY7lAQ.js.map +1 -0
  170. package/dist/publishAuthorization-DEriY_jm.js +3687 -0
  171. package/dist/publishAuthorization-DEriY_jm.js.map +1 -0
  172. package/dist/publishAuthorization-DfAQs1sN.js +3707 -0
  173. package/dist/publishAuthorization-DfAQs1sN.js.map +1 -0
  174. package/dist/publishAuthorization-DqhhCAhd.js +3652 -0
  175. package/dist/publishAuthorization-DqhhCAhd.js.map +1 -0
  176. package/dist/publishThirdwebClient-BdgkcqM7.js +18 -0
  177. package/dist/publishThirdwebClient-BdgkcqM7.js.map +1 -0
  178. package/dist/publishThirdwebClient-BkmDN480.js +18 -0
  179. package/dist/publishThirdwebClient-BkmDN480.js.map +1 -0
  180. package/dist/publishThirdwebClient-BnDhP3N-.js +18 -0
  181. package/dist/publishThirdwebClient-BnDhP3N-.js.map +1 -0
  182. package/dist/publishThirdwebClient-CQ29pzG2.js +18 -0
  183. package/dist/publishThirdwebClient-CQ29pzG2.js.map +1 -0
  184. package/dist/publishThirdwebClient-CZIVmr9Z.js +18 -0
  185. package/dist/publishThirdwebClient-CZIVmr9Z.js.map +1 -0
  186. package/dist/publishThirdwebClient-DroRrOFQ.js +18 -0
  187. package/dist/publishThirdwebClient-DroRrOFQ.js.map +1 -0
  188. package/dist/publishThirdwebClient-DzXFjQ7L.js +18 -0
  189. package/dist/publishThirdwebClient-DzXFjQ7L.js.map +1 -0
  190. package/dist/publishThirdwebClient-Dzb2vcEs.js +18 -0
  191. package/dist/publishThirdwebClient-Dzb2vcEs.js.map +1 -0
  192. package/dist/publishThirdwebClient-i8P7fivi.js +18 -0
  193. package/dist/publishThirdwebClient-i8P7fivi.js.map +1 -0
  194. package/dist/react/ConnectButton.d.ts.map +1 -1
  195. package/dist/resolveRevokeAccount-B5iXpuRT.js +38 -0
  196. package/dist/resolveRevokeAccount-B5iXpuRT.js.map +1 -0
  197. package/dist/resolveRevokeAccount-B7ImSb4Y.js +38 -0
  198. package/dist/resolveRevokeAccount-B7ImSb4Y.js.map +1 -0
  199. package/dist/resolveRevokeAccount-BM1j2l5Q.js +38 -0
  200. package/dist/resolveRevokeAccount-BM1j2l5Q.js.map +1 -0
  201. package/dist/resolveRevokeAccount-BtVG0xxc.js +38 -0
  202. package/dist/resolveRevokeAccount-BtVG0xxc.js.map +1 -0
  203. package/dist/resolveRevokeAccount-CJZZdBcQ.js +39 -0
  204. package/dist/resolveRevokeAccount-CJZZdBcQ.js.map +1 -0
  205. package/dist/resolveRevokeAccount-CaIMuCee.js +39 -0
  206. package/dist/resolveRevokeAccount-CaIMuCee.js.map +1 -0
  207. package/dist/resolveRevokeAccount-Cg4TQgnd.js +38 -0
  208. package/dist/resolveRevokeAccount-Cg4TQgnd.js.map +1 -0
  209. package/dist/resolveRevokeAccount-DHnxtEIj.js +39 -0
  210. package/dist/resolveRevokeAccount-DHnxtEIj.js.map +1 -0
  211. package/dist/resolveRevokeAccount-S-2WXkNh.js +38 -0
  212. package/dist/resolveRevokeAccount-S-2WXkNh.js.map +1 -0
  213. package/dist/services/publish/actors/checking.d.ts.map +1 -1
  214. package/dist/services/publish/actors/createAttestations.d.ts.map +1 -1
  215. package/dist/services/publish/helpers/ensureEasSchemas.d.ts +12 -1
  216. package/dist/services/publish/helpers/ensureEasSchemas.d.ts.map +1 -1
  217. package/dist/services/publish/helpers/getPublishUploadData.d.ts.map +1 -1
  218. package/dist/services/publishManager/actions/createPublish.d.ts.map +1 -1
  219. package/dist/services/publishManager/actions/drainPendingCreates.d.ts +3 -0
  220. package/dist/services/publishManager/actions/drainPendingCreates.d.ts.map +1 -0
  221. package/dist/services/publishManager/actions/publishDone.d.ts.map +1 -1
  222. package/dist/services/publishManager/actions/queueCreatePublish.d.ts +2 -0
  223. package/dist/services/publishManager/actions/queueCreatePublish.d.ts.map +1 -0
  224. package/dist/services/publishManager/actors/restoreFromDb.d.ts.map +1 -1
  225. package/dist/services/publishManager/actors/savePublish.d.ts +11 -0
  226. package/dist/services/publishManager/actors/savePublish.d.ts.map +1 -1
  227. package/dist/services/publishManager/createPublishResult.d.ts +6 -0
  228. package/dist/services/publishManager/createPublishResult.d.ts.map +1 -0
  229. package/dist/services/publishManager/index.d.ts +61 -1
  230. package/dist/services/publishManager/index.d.ts.map +1 -1
  231. package/dist/services/revoke/revokeAttestations.d.ts +3 -2
  232. package/dist/services/revoke/revokeAttestations.d.ts.map +1 -1
  233. package/dist/thirdweb.d.ts +1 -0
  234. package/dist/thirdweb.d.ts.map +1 -1
  235. package/dist/thirdweb.js +193 -117
  236. package/dist/thirdweb.js.map +1 -1
  237. package/dist/worker-2dUZSapK.js +69 -0
  238. package/dist/worker-2dUZSapK.js.map +1 -0
  239. package/dist/worker-B8gN5WTx.js +69 -0
  240. package/dist/worker-B8gN5WTx.js.map +1 -0
  241. package/dist/worker-BgErCNTb.js +69 -0
  242. package/dist/worker-BgErCNTb.js.map +1 -0
  243. package/dist/worker-C07rPV2G.js +69 -0
  244. package/dist/worker-C07rPV2G.js.map +1 -0
  245. package/dist/worker-C9Za_dlQ.js +69 -0
  246. package/dist/worker-C9Za_dlQ.js.map +1 -0
  247. package/dist/worker-CEgulQnm.js +69 -0
  248. package/dist/worker-CEgulQnm.js.map +1 -0
  249. package/dist/worker-C_TL94He.js +69 -0
  250. package/dist/worker-C_TL94He.js.map +1 -0
  251. package/dist/worker-DypHzXgH.js +69 -0
  252. package/dist/worker-DypHzXgH.js.map +1 -0
  253. package/dist/worker-ZL4Wg19t.js +69 -0
  254. package/dist/worker-ZL4Wg19t.js.map +1 -0
  255. package/package.json +6 -6
@@ -0,0 +1,1311 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { optimismSepolia as t } from "viem/chains";
3
+ import { DEFAULT_ARWEAVE_GRAPHQL_URL as n, VERSION_SCHEMA_UID as r, assertLocalDbChain as i, client as a, getAttesterForSeed as o, getGetAdditionalSyncAddresses as s, getMetadataAttestationUidsForSeedUid as c, getVersionsForSeedUid as ee, isValidEasAttestationUid as te, setAdditionalSyncAddresses as l, setGetPublisherForNewSeeds as u, setRevokeExecutor as d, updateSeedRevokedAt as ne } from "@seedprotocol/sdk";
4
+ import { createPublicClient as f, encodeAbiParameters as re, encodeFunctionData as p, http as m, parseEventLogs as h } from "viem";
5
+ import { prepareTransaction as g, sendTransaction as _ } from "thirdweb";
6
+ import { ethers as v } from "ethers";
7
+ import { defineChain as ie, optimismSepolia as y } from "thirdweb/chains";
8
+ import { configureEasReadChain as ae, expectEasReadChain as oe, resolveEasChainDeployment as se } from "@seedprotocol/eas";
9
+ //#region src/helpers/constants.ts
10
+ var ce = "0x44d562ac1d7cd77e232978687fea027ace48f719cf1d58c7888e509663bb87fc", le = { 11155420: "0x76f47d88bfaf670f5208911181fcdc0e160cb16d" }, ue = "0xcd8c945872df8e664e55cf8885c85ea3ea8f2148", de = ue, fe = {
11
+ SUCCESS: "success",
12
+ FAILURE: "failure"
13
+ }, pe = [
14
+ "pollingForConfirmation",
15
+ "uploadingData",
16
+ "uploadingViaBundler",
17
+ "uploadingViaBundlerPhase2"
18
+ ], me = 3e4, b = t, he = [
19
+ {
20
+ type: "error",
21
+ name: "AccessDenied",
22
+ inputs: []
23
+ },
24
+ {
25
+ type: "error",
26
+ name: "AlreadyRevoked",
27
+ inputs: []
28
+ },
29
+ {
30
+ type: "error",
31
+ name: "InvalidRevocation",
32
+ inputs: []
33
+ },
34
+ {
35
+ type: "error",
36
+ name: "InvalidRevocations",
37
+ inputs: []
38
+ },
39
+ {
40
+ type: "error",
41
+ name: "InvalidSchema",
42
+ inputs: []
43
+ },
44
+ {
45
+ type: "error",
46
+ name: "Irrevocable",
47
+ inputs: []
48
+ },
49
+ {
50
+ type: "error",
51
+ name: "NotFound",
52
+ inputs: []
53
+ },
54
+ {
55
+ type: "error",
56
+ name: "NotPayable",
57
+ inputs: []
58
+ },
59
+ {
60
+ type: "error",
61
+ name: "InsufficientValue",
62
+ inputs: []
63
+ },
64
+ {
65
+ type: "error",
66
+ name: "InvalidLength",
67
+ inputs: []
68
+ }
69
+ ], ge = [
70
+ {
71
+ name: "recipient",
72
+ type: "address"
73
+ },
74
+ {
75
+ name: "expirationTime",
76
+ type: "uint64"
77
+ },
78
+ {
79
+ name: "revocable",
80
+ type: "bool"
81
+ },
82
+ {
83
+ name: "refUID",
84
+ type: "bytes32"
85
+ },
86
+ {
87
+ name: "data",
88
+ type: "bytes"
89
+ },
90
+ {
91
+ name: "value",
92
+ type: "uint256"
93
+ }
94
+ ], x = [
95
+ {
96
+ type: "function",
97
+ name: "attest",
98
+ stateMutability: "payable",
99
+ inputs: [{
100
+ name: "request",
101
+ type: "tuple",
102
+ components: [{
103
+ name: "schema",
104
+ type: "bytes32"
105
+ }, {
106
+ name: "data",
107
+ type: "tuple",
108
+ components: ge
109
+ }]
110
+ }],
111
+ outputs: [{ type: "bytes32" }]
112
+ },
113
+ {
114
+ type: "function",
115
+ name: "multiAttest",
116
+ stateMutability: "payable",
117
+ inputs: [{
118
+ name: "requests",
119
+ type: "tuple[]",
120
+ components: [{
121
+ name: "schema",
122
+ type: "bytes32"
123
+ }, {
124
+ name: "data",
125
+ type: "tuple[]",
126
+ components: ge
127
+ }]
128
+ }],
129
+ outputs: [{ type: "bytes32[]" }]
130
+ },
131
+ {
132
+ type: "function",
133
+ name: "multiRevoke",
134
+ stateMutability: "payable",
135
+ inputs: [{
136
+ name: "multiRequests",
137
+ type: "tuple[]",
138
+ components: [{
139
+ name: "schema",
140
+ type: "bytes32"
141
+ }, {
142
+ name: "data",
143
+ type: "tuple[]",
144
+ components: [{
145
+ name: "uid",
146
+ type: "bytes32"
147
+ }, {
148
+ name: "value",
149
+ type: "uint256"
150
+ }]
151
+ }]
152
+ }],
153
+ outputs: []
154
+ },
155
+ {
156
+ type: "event",
157
+ name: "Attested",
158
+ inputs: [
159
+ {
160
+ name: "recipient",
161
+ type: "address",
162
+ indexed: !0
163
+ },
164
+ {
165
+ name: "attester",
166
+ type: "address",
167
+ indexed: !0
168
+ },
169
+ {
170
+ name: "uid",
171
+ type: "bytes32",
172
+ indexed: !1
173
+ },
174
+ {
175
+ name: "schemaUID",
176
+ type: "bytes32",
177
+ indexed: !0
178
+ }
179
+ ]
180
+ },
181
+ ...he
182
+ ], S = [{
183
+ name: "schema",
184
+ type: "bytes32"
185
+ }, {
186
+ name: "data",
187
+ type: "tuple[]",
188
+ components: [
189
+ {
190
+ name: "recipient",
191
+ type: "address"
192
+ },
193
+ {
194
+ name: "expirationTime",
195
+ type: "uint64"
196
+ },
197
+ {
198
+ name: "revocable",
199
+ type: "bool"
200
+ },
201
+ {
202
+ name: "refUID",
203
+ type: "bytes32"
204
+ },
205
+ {
206
+ name: "data",
207
+ type: "bytes"
208
+ },
209
+ {
210
+ name: "value",
211
+ type: "uint256"
212
+ }
213
+ ]
214
+ }], _e = [{
215
+ type: "function",
216
+ name: "multiPublish",
217
+ stateMutability: "nonpayable",
218
+ inputs: [{
219
+ name: "requests",
220
+ type: "tuple[]",
221
+ components: [
222
+ {
223
+ name: "localId",
224
+ type: "string"
225
+ },
226
+ {
227
+ name: "seedUid",
228
+ type: "bytes32"
229
+ },
230
+ {
231
+ name: "seedSchemaUid",
232
+ type: "bytes32"
233
+ },
234
+ {
235
+ name: "versionUid",
236
+ type: "bytes32"
237
+ },
238
+ {
239
+ name: "versionSchemaUid",
240
+ type: "bytes32"
241
+ },
242
+ {
243
+ name: "seedIsRevocable",
244
+ type: "bool"
245
+ },
246
+ {
247
+ name: "listOfAttestations",
248
+ type: "tuple[]",
249
+ components: S
250
+ },
251
+ {
252
+ name: "propertiesToUpdate",
253
+ type: "tuple[]",
254
+ components: [{
255
+ name: "publishLocalId",
256
+ type: "string"
257
+ }, {
258
+ name: "propertySchemaUid",
259
+ type: "bytes32"
260
+ }]
261
+ }
262
+ ]
263
+ }],
264
+ outputs: [{ type: "bytes32[]" }]
265
+ }], ve = [{
266
+ type: "function",
267
+ name: "multiPublish",
268
+ stateMutability: "nonpayable",
269
+ inputs: [{
270
+ name: "requests",
271
+ type: "tuple[]",
272
+ components: [
273
+ {
274
+ name: "localIdIndex",
275
+ type: "uint256"
276
+ },
277
+ {
278
+ name: "seedUid",
279
+ type: "bytes32"
280
+ },
281
+ {
282
+ name: "seedSchemaUid",
283
+ type: "bytes32"
284
+ },
285
+ {
286
+ name: "versionUid",
287
+ type: "bytes32"
288
+ },
289
+ {
290
+ name: "versionSchemaUid",
291
+ type: "bytes32"
292
+ },
293
+ {
294
+ name: "seedIsRevocable",
295
+ type: "bool"
296
+ },
297
+ {
298
+ name: "listOfAttestations",
299
+ type: "tuple[]",
300
+ components: S
301
+ },
302
+ {
303
+ name: "propertiesToUpdate",
304
+ type: "tuple[]",
305
+ components: [{
306
+ name: "publishLocalIdIndex",
307
+ type: "uint256"
308
+ }, {
309
+ name: "propertySchemaUid",
310
+ type: "bytes32"
311
+ }]
312
+ }
313
+ ]
314
+ }],
315
+ outputs: [{ type: "bytes32[]" }]
316
+ }], C = [
317
+ {
318
+ type: "function",
319
+ name: "getEas",
320
+ stateMutability: "view",
321
+ inputs: [],
322
+ outputs: [{ type: "address" }]
323
+ },
324
+ {
325
+ type: "function",
326
+ name: "setEas",
327
+ stateMutability: "nonpayable",
328
+ inputs: [{
329
+ name: "_eas",
330
+ type: "address"
331
+ }],
332
+ outputs: [{ type: "string" }]
333
+ },
334
+ {
335
+ type: "function",
336
+ name: "isActiveSigner",
337
+ stateMutability: "view",
338
+ inputs: [{
339
+ name: "signer",
340
+ type: "address"
341
+ }],
342
+ outputs: [{ type: "bool" }]
343
+ }
344
+ ], ye = [{
345
+ type: "event",
346
+ name: "CreatedAttestation",
347
+ inputs: [{
348
+ name: "result",
349
+ type: "tuple",
350
+ indexed: !1,
351
+ components: [{
352
+ name: "schemaUid",
353
+ type: "bytes32"
354
+ }, {
355
+ name: "attestationUid",
356
+ type: "bytes32"
357
+ }]
358
+ }]
359
+ }, {
360
+ type: "event",
361
+ name: "SeedPublished",
362
+ inputs: [{
363
+ name: "returnedDataFromEAS",
364
+ type: "bytes",
365
+ indexed: !1
366
+ }]
367
+ }], be = [{
368
+ type: "function",
369
+ name: "getAddress",
370
+ stateMutability: "view",
371
+ inputs: [{
372
+ name: "_adminSigner",
373
+ type: "address"
374
+ }, {
375
+ name: "_data",
376
+ type: "bytes"
377
+ }],
378
+ outputs: [{ type: "address" }]
379
+ }, {
380
+ type: "function",
381
+ name: "createAccount",
382
+ stateMutability: "nonpayable",
383
+ inputs: [{
384
+ name: "_admin",
385
+ type: "address"
386
+ }, {
387
+ name: "_data",
388
+ type: "bytes"
389
+ }],
390
+ outputs: [{ type: "address" }]
391
+ }], xe = [{
392
+ type: "event",
393
+ name: "CreatedAttestation",
394
+ inputs: [{
395
+ name: "result",
396
+ type: "tuple",
397
+ indexed: !1,
398
+ components: [{
399
+ name: "schemaUid",
400
+ type: "bytes32"
401
+ }, {
402
+ name: "attestationUid",
403
+ type: "bytes32"
404
+ }]
405
+ }]
406
+ }, {
407
+ type: "event",
408
+ name: "SeedPublished",
409
+ inputs: [{
410
+ name: "seedUid",
411
+ type: "bytes32",
412
+ indexed: !1
413
+ }, {
414
+ name: "versionUid",
415
+ type: "bytes32",
416
+ indexed: !1
417
+ }]
418
+ }], w = [
419
+ {
420
+ type: "function",
421
+ name: "multiPublish",
422
+ stateMutability: "payable",
423
+ inputs: [{
424
+ name: "requests",
425
+ type: "tuple[]",
426
+ components: [
427
+ {
428
+ name: "localId",
429
+ type: "string"
430
+ },
431
+ {
432
+ name: "seedUid",
433
+ type: "bytes32"
434
+ },
435
+ {
436
+ name: "versionUid",
437
+ type: "bytes32"
438
+ },
439
+ {
440
+ name: "seedSchemaUid",
441
+ type: "bytes32"
442
+ },
443
+ {
444
+ name: "versionSchemaUid",
445
+ type: "bytes32"
446
+ },
447
+ {
448
+ name: "seedIsRevocable",
449
+ type: "bool"
450
+ },
451
+ {
452
+ name: "listOfAttestations",
453
+ type: "tuple[]",
454
+ components: [{
455
+ name: "schema",
456
+ type: "bytes32"
457
+ }, {
458
+ name: "data",
459
+ type: "tuple[]",
460
+ components: [
461
+ {
462
+ name: "recipient",
463
+ type: "address"
464
+ },
465
+ {
466
+ name: "expirationTime",
467
+ type: "uint64"
468
+ },
469
+ {
470
+ name: "revocable",
471
+ type: "bool"
472
+ },
473
+ {
474
+ name: "refUID",
475
+ type: "bytes32"
476
+ },
477
+ {
478
+ name: "data",
479
+ type: "bytes"
480
+ },
481
+ {
482
+ name: "value",
483
+ type: "uint256"
484
+ }
485
+ ]
486
+ }]
487
+ },
488
+ {
489
+ name: "propertiesToUpdate",
490
+ type: "tuple[]",
491
+ components: [{
492
+ name: "publishIndex",
493
+ type: "uint256"
494
+ }, {
495
+ name: "propertySchemaUid",
496
+ type: "bytes32"
497
+ }]
498
+ }
499
+ ]
500
+ }],
501
+ outputs: [{
502
+ name: "",
503
+ type: "bytes32[]"
504
+ }]
505
+ },
506
+ {
507
+ type: "function",
508
+ name: "isInitialized",
509
+ stateMutability: "view",
510
+ inputs: [{
511
+ name: "account",
512
+ type: "address"
513
+ }],
514
+ outputs: [{
515
+ name: "",
516
+ type: "bool"
517
+ }]
518
+ },
519
+ {
520
+ type: "function",
521
+ name: "getEAS",
522
+ stateMutability: "view",
523
+ inputs: [{
524
+ name: "account",
525
+ type: "address"
526
+ }],
527
+ outputs: [{
528
+ name: "",
529
+ type: "address"
530
+ }]
531
+ },
532
+ {
533
+ type: "error",
534
+ name: "AlreadyInitialized",
535
+ inputs: [{
536
+ name: "account",
537
+ type: "address"
538
+ }]
539
+ },
540
+ {
541
+ type: "error",
542
+ name: "NotInitialized",
543
+ inputs: [{
544
+ name: "account",
545
+ type: "address"
546
+ }]
547
+ },
548
+ {
549
+ type: "error",
550
+ name: "InvalidEASAddress",
551
+ inputs: []
552
+ },
553
+ {
554
+ type: "error",
555
+ name: "AttestationFailed",
556
+ inputs: []
557
+ },
558
+ {
559
+ type: "error",
560
+ name: "MultiAttestFailed",
561
+ inputs: []
562
+ }
563
+ ], T = [{
564
+ type: "function",
565
+ name: "getSchema",
566
+ stateMutability: "view",
567
+ inputs: [{
568
+ name: "uid",
569
+ type: "bytes32"
570
+ }],
571
+ outputs: [{
572
+ name: "",
573
+ type: "tuple",
574
+ components: [
575
+ {
576
+ name: "uid",
577
+ type: "bytes32"
578
+ },
579
+ {
580
+ name: "resolver",
581
+ type: "address"
582
+ },
583
+ {
584
+ name: "revocable",
585
+ type: "bool"
586
+ },
587
+ {
588
+ name: "schema",
589
+ type: "string"
590
+ }
591
+ ]
592
+ }]
593
+ }, {
594
+ type: "function",
595
+ name: "register",
596
+ stateMutability: "nonpayable",
597
+ inputs: [
598
+ {
599
+ name: "schema",
600
+ type: "string"
601
+ },
602
+ {
603
+ name: "resolver",
604
+ type: "address"
605
+ },
606
+ {
607
+ name: "revocable",
608
+ type: "bool"
609
+ }
610
+ ],
611
+ outputs: [{ type: "bytes32" }]
612
+ }], E = null, D = null;
613
+ function Se() {
614
+ try {
615
+ let e = Y().thirdwebSecretKey;
616
+ return e ? { headers: { "x-secret-key": e } } : void 0;
617
+ } catch {
618
+ return;
619
+ }
620
+ }
621
+ function Ce() {
622
+ let e = Q(), t = $(), n = Se();
623
+ return f({
624
+ chain: e,
625
+ transport: m(t, n ? { fetchOptions: n } : void 0)
626
+ });
627
+ }
628
+ function O() {
629
+ let e = Q(), t = $(), n = "";
630
+ try {
631
+ n = Y().thirdwebSecretKey ?? "";
632
+ } catch {
633
+ n = "";
634
+ }
635
+ let r = `${e.id}:${t}:${n ? "1" : "0"}:${n}`;
636
+ return (!E || D !== r) && (D = r, E = Ce()), E;
637
+ }
638
+ async function k(e) {
639
+ return O().waitForTransactionReceipt({ hash: e });
640
+ }
641
+ async function A(e) {
642
+ let t = await O().getBytecode({ address: e });
643
+ return !!t && t !== "0x";
644
+ }
645
+ async function we(e) {
646
+ try {
647
+ let t = await O().getBlock({ blockNumber: e });
648
+ if (t?.timestamp != null) return Number(t.timestamp) * 1e3;
649
+ } catch {}
650
+ return null;
651
+ }
652
+ var Te = 5, Ee = 6e3;
653
+ async function De(e, t = Te, n = Ee) {
654
+ for (let r = 0; r < t; r++) {
655
+ if (await A(e)) return !0;
656
+ r < t - 1 && await new Promise((e) => {
657
+ setTimeout(e, n);
658
+ });
659
+ }
660
+ return !1;
661
+ }
662
+ //#endregion
663
+ //#region src/helpers/contracts/index.ts
664
+ function Oe(e, t, n) {
665
+ return {
666
+ to: e,
667
+ data: p({
668
+ abi: _e,
669
+ functionName: "multiPublish",
670
+ args: [t]
671
+ }),
672
+ gas: n
673
+ };
674
+ }
675
+ function ke(e, t, n) {
676
+ return {
677
+ to: e,
678
+ data: p({
679
+ abi: ve,
680
+ functionName: "multiPublish",
681
+ args: [t]
682
+ }),
683
+ gas: n
684
+ };
685
+ }
686
+ function Ae(e, t, n) {
687
+ let r = /* @__PURE__ */ new Map();
688
+ t.forEach((e, t) => {
689
+ e.localId && r.set(e.localId, BigInt(t));
690
+ });
691
+ let i = t.map((e) => ({
692
+ localId: e.localId,
693
+ seedUid: e.seedUid,
694
+ versionUid: e.versionUid,
695
+ seedSchemaUid: e.seedSchemaUid,
696
+ versionSchemaUid: e.versionSchemaUid,
697
+ seedIsRevocable: e.seedIsRevocable,
698
+ listOfAttestations: e.listOfAttestations,
699
+ propertiesToUpdate: (e.propertiesToUpdate ?? []).flatMap((e) => {
700
+ let t = e.publishLocalId ? r.get(e.publishLocalId) : void 0;
701
+ return t === void 0 ? [] : [{
702
+ publishIndex: t,
703
+ propertySchemaUid: e.propertySchemaUid
704
+ }];
705
+ })
706
+ }));
707
+ return {
708
+ to: e,
709
+ data: p({
710
+ abi: w,
711
+ functionName: "multiPublish",
712
+ args: [i]
713
+ }),
714
+ gas: n
715
+ };
716
+ }
717
+ async function je(e, t) {
718
+ return O().readContract({
719
+ address: e,
720
+ abi: w,
721
+ functionName: "isInitialized",
722
+ args: [t]
723
+ });
724
+ }
725
+ async function Me(e, t) {
726
+ return O().readContract({
727
+ address: e,
728
+ abi: w,
729
+ functionName: "getEAS",
730
+ args: [t]
731
+ });
732
+ }
733
+ function Ne(e, t) {
734
+ return {
735
+ to: e,
736
+ data: p({
737
+ abi: C,
738
+ functionName: "setEas",
739
+ args: [t]
740
+ })
741
+ };
742
+ }
743
+ async function Pe(e) {
744
+ return O().readContract({
745
+ address: e,
746
+ abi: C,
747
+ functionName: "getEas"
748
+ });
749
+ }
750
+ async function Fe(e, t) {
751
+ return O().readContract({
752
+ address: e,
753
+ abi: C,
754
+ functionName: "isActiveSigner",
755
+ args: [t]
756
+ });
757
+ }
758
+ async function Ie(e, t = "0x") {
759
+ return O().readContract({
760
+ address: Z(),
761
+ abi: be,
762
+ functionName: "getAddress",
763
+ args: [e, t]
764
+ });
765
+ }
766
+ function Le(e, t = "0x") {
767
+ return {
768
+ to: Z(),
769
+ data: p({
770
+ abi: be,
771
+ functionName: "createAccount",
772
+ args: [e, t]
773
+ })
774
+ };
775
+ }
776
+ var Re = "0x0000000000000000000000000000000000000000";
777
+ function j(e) {
778
+ let { easContractAddress: t } = Y();
779
+ return {
780
+ to: t,
781
+ data: p({
782
+ abi: x,
783
+ functionName: "attest",
784
+ args: [{
785
+ schema: e.schema,
786
+ data: {
787
+ recipient: e.data.recipient ?? Re,
788
+ expirationTime: e.data.expirationTime ?? 0n,
789
+ revocable: e.data.revocable ?? !0,
790
+ refUID: e.data.refUID,
791
+ data: e.data.data,
792
+ value: e.data.value ?? 0n
793
+ }
794
+ }]
795
+ })
796
+ };
797
+ }
798
+ function M(e) {
799
+ let { easContractAddress: t } = Y();
800
+ return {
801
+ to: t,
802
+ data: p({
803
+ abi: x,
804
+ functionName: "multiAttest",
805
+ args: [e]
806
+ })
807
+ };
808
+ }
809
+ function N(e) {
810
+ let { easContractAddress: t } = Y();
811
+ return {
812
+ to: t,
813
+ data: p({
814
+ abi: x,
815
+ functionName: "multiRevoke",
816
+ args: [e.map((e) => ({
817
+ schema: e.schema,
818
+ data: e.data.map((e) => ({
819
+ uid: e.uid,
820
+ value: e.value ?? 0n
821
+ }))
822
+ }))]
823
+ })
824
+ };
825
+ }
826
+ var ze = "0x" + "0".repeat(64);
827
+ async function Be(e) {
828
+ let t = await O().readContract({
829
+ address: Y().schemaRegistryAddress,
830
+ abi: T,
831
+ functionName: "getSchema",
832
+ args: [e]
833
+ });
834
+ return !t || t.uid === ze ? null : {
835
+ uid: t.uid,
836
+ resolver: t.resolver,
837
+ revocable: t.revocable,
838
+ schema: t.schema
839
+ };
840
+ }
841
+ function Ve(e) {
842
+ return {
843
+ to: Y().schemaRegistryAddress,
844
+ data: p({
845
+ abi: T,
846
+ functionName: "register",
847
+ args: [
848
+ e.schema,
849
+ e.resolverAddress,
850
+ e.revocable
851
+ ]
852
+ })
853
+ };
854
+ }
855
+ //#endregion
856
+ //#region src/helpers/easDirect.ts
857
+ var He = "0x0000000000000000000000000000000000000000", P = "0x" + "0".repeat(64);
858
+ function Ue(e) {
859
+ return j(e);
860
+ }
861
+ function We(e) {
862
+ return M(e);
863
+ }
864
+ function Ge(e) {
865
+ return re([{ type: "bytes32" }], [e]);
866
+ }
867
+ function Ke(e, t) {
868
+ return F(e, t)[0]?.uid;
869
+ }
870
+ function F(e, t) {
871
+ if (!e.logs?.length) return [];
872
+ let n = t.toLowerCase(), r = e.logs.filter((e) => e.address && e.address.toLowerCase() === n);
873
+ if (!r.length) return [];
874
+ try {
875
+ let e = h({
876
+ abi: x,
877
+ eventName: "Attested",
878
+ logs: r,
879
+ strict: !1
880
+ }), t = [];
881
+ for (let n of e) {
882
+ let e = n.args?.uid, r = n.args?.schemaUID;
883
+ e && e !== P && r && t.push({
884
+ schemaUid: r,
885
+ uid: e
886
+ });
887
+ }
888
+ return t;
889
+ } catch {
890
+ return [];
891
+ }
892
+ }
893
+ function I(e, t = {}) {
894
+ if (!t.viaExecutorModule) return N(e);
895
+ let n = Y().modularAccountModuleContract?.trim();
896
+ if (!n || !/^0x[0-9a-fA-F]{40}$/.test(n)) throw Error("@seedprotocol/publish: revoking via the executor module requires PublishConfig.modularAccountModuleContract");
897
+ return qe(n, e);
898
+ }
899
+ function qe(e, t) {
900
+ return {
901
+ to: e,
902
+ data: p({
903
+ abi: x,
904
+ functionName: "multiRevoke",
905
+ args: [t.map((e) => ({
906
+ schema: e.schema,
907
+ data: e.data.map((e) => ({
908
+ uid: e.uid,
909
+ value: e.value ?? 0n
910
+ }))
911
+ }))]
912
+ })
913
+ };
914
+ }
915
+ //#endregion
916
+ //#region src/helpers/publishWalletRegistry.ts
917
+ var L = null;
918
+ function Je() {
919
+ return a.isInitialized() ? Promise.resolve() : new Promise((e) => {
920
+ a.onReady(() => e());
921
+ });
922
+ }
923
+ async function Ye(e) {
924
+ if (L = e, !e) return;
925
+ await Je();
926
+ let t = /* @__PURE__ */ new Set();
927
+ for (let n of e.ownedAddresses ?? []) n && t.add(n.toLowerCase());
928
+ t.add(e.signer.address.toLowerCase()), t.add(e.txSender.address.toLowerCase()), e.publisherAddress && t.add(e.publisherAddress.toLowerCase());
929
+ try {
930
+ await a.setAddresses({ owned: [...t] });
931
+ let n = e.publisherAddress ?? e.signer.address;
932
+ n && await a.claimUnpublishedDrafts(n);
933
+ } catch (e) {
934
+ console.warn("[publishWalletRegistry] Failed to set seed client addresses:", e);
935
+ }
936
+ }
937
+ function R() {
938
+ return L;
939
+ }
940
+ function Xe() {
941
+ L = null;
942
+ }
943
+ //#endregion
944
+ //#region src/helpers/seedSigner.ts
945
+ var Ze = Symbol.for("seedprotocol.SeedSigner"), Qe = Symbol.for("seedprotocol.SeedTxSender");
946
+ function z(e) {
947
+ return Object.assign(e, { [Ze]: !0 });
948
+ }
949
+ function B(e) {
950
+ return Object.assign(e, { [Qe]: !0 });
951
+ }
952
+ function V(e) {
953
+ return !!e && typeof e == "object" && Ze in e;
954
+ }
955
+ function H(e) {
956
+ return !!e && typeof e == "object" && Qe in e;
957
+ }
958
+ function U(e) {
959
+ return !!e && typeof e == "object" && "signer" in e && "txSender" in e && V(e.signer) && H(e.txSender);
960
+ }
961
+ function $e(e) {
962
+ let t = e.address;
963
+ return {
964
+ signer: z({
965
+ address: t,
966
+ signMessage: async ({ message: t }) => {
967
+ if (typeof t == "string") return await e.signMessage(t);
968
+ let n = t.raw, r = typeof n == "string" ? v.getBytes(n) : n instanceof Uint8Array ? n : new Uint8Array(n);
969
+ return await e.signMessage(r);
970
+ }
971
+ }),
972
+ txSender: B({
973
+ address: t,
974
+ sendTransaction: async (t) => ({ transactionHash: (await e.sendTransaction({
975
+ to: t.to,
976
+ data: t.data,
977
+ value: t.value,
978
+ gasLimit: t.gas
979
+ })).hash })
980
+ })
981
+ };
982
+ }
983
+ function et(e) {
984
+ if (U(e)) return e.signer;
985
+ if (V(e)) return e;
986
+ throw Error("@seedprotocol/publish: expected a SeedSigner or PublishWallet. Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
987
+ }
988
+ function tt(e) {
989
+ if (U(e)) return e.txSender;
990
+ if (H(e)) return e;
991
+ throw Error("@seedprotocol/publish: expected a SeedTxSender or PublishWallet. Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
992
+ }
993
+ function nt(e) {
994
+ if (U(e)) return e;
995
+ throw Error("@seedprotocol/publish: expected a PublishWallet (signer + txSender). Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
996
+ }
997
+ //#endregion
998
+ //#region src/helpers/thirdwebChain.ts
999
+ var W = null;
1000
+ function rt(e = Q()) {
1001
+ if (W?.id === e.id) return W.chain;
1002
+ let t = e.id === y.id ? y : ie({
1003
+ id: e.id,
1004
+ name: e.name,
1005
+ nativeCurrency: e.nativeCurrency,
1006
+ testnet: e.testnet ? !0 : void 0,
1007
+ blockExplorers: e.blockExplorers ? Object.values(e.blockExplorers).map(({ name: e, url: t, apiUrl: n }) => ({
1008
+ name: e,
1009
+ url: t,
1010
+ apiUrl: n
1011
+ })) : void 0
1012
+ });
1013
+ return W = {
1014
+ id: e.id,
1015
+ chain: t
1016
+ }, t;
1017
+ }
1018
+ //#endregion
1019
+ //#region src/helpers/adapters/thirdwebAccount.ts
1020
+ var it = /* @__PURE__ */ e({
1021
+ asSeedSignerFromThirdweb: () => ot,
1022
+ asThirdwebPublishWallet: () => at,
1023
+ fromThirdwebAccount: () => G
1024
+ });
1025
+ function G(e, t) {
1026
+ let n = t?.client, r = e.address;
1027
+ return {
1028
+ signer: z({
1029
+ address: r,
1030
+ signMessage: async ({ message: t }) => await e.signMessage({ message: t })
1031
+ }),
1032
+ txSender: B({
1033
+ address: r,
1034
+ sendTransaction: async (t) => {
1035
+ let r = n ?? (await import("./publishThirdwebClient-DroRrOFQ.js").then((e) => e.n)).getClient(), i = rt(), a = g({
1036
+ client: r,
1037
+ chain: i,
1038
+ to: t.to,
1039
+ data: t.data,
1040
+ value: t.value,
1041
+ gas: t.gas
1042
+ });
1043
+ return { transactionHash: (await _({
1044
+ account: e,
1045
+ transaction: a
1046
+ })).transactionHash };
1047
+ }
1048
+ })
1049
+ };
1050
+ }
1051
+ function at(e, t) {
1052
+ if (U(e)) return e;
1053
+ if (V(e)) throw Error("@seedprotocol/publish/thirdweb: SeedSigner alone cannot send sponsored txs. Pass fromThirdwebAccount(account) or a PublishWallet.");
1054
+ return G(e, t);
1055
+ }
1056
+ function ot(e) {
1057
+ return U(e) ? e.signer : V(e) ? e : G(e).signer;
1058
+ }
1059
+ //#endregion
1060
+ //#region src/helpers/verifyPublishChain.ts
1061
+ var K = class extends Error {
1062
+ chainId;
1063
+ problems;
1064
+ name = "PublishChainConfigError";
1065
+ constructor(e, t) {
1066
+ super(`@seedprotocol/publish: chain ${e} is not set up for publishing:\n- ${t.join("\n- ")}`), this.chainId = e, this.problems = t;
1067
+ }
1068
+ }, q = null;
1069
+ function st() {
1070
+ let e = Y();
1071
+ return [
1072
+ e.chain.id,
1073
+ $(),
1074
+ e.easContractAddress,
1075
+ e.schemaRegistryAddress,
1076
+ e.thirdwebAccountFactoryAddress ?? "",
1077
+ e.modularAccountModuleContract ?? ""
1078
+ ].join("|").toLowerCase();
1079
+ }
1080
+ async function ct() {
1081
+ let e = Y(), { chain: t } = e, n = [], r;
1082
+ try {
1083
+ r = await O().getChainId();
1084
+ } catch (e) {
1085
+ throw new K(t.id, [`could not reach the RPC (${lt($())}): ${e instanceof Error ? e.message : String(e)}`]);
1086
+ }
1087
+ if (r !== t.id) throw new K(t.id, [`the RPC reports chain ${r}, but PublishConfig.chain is ${t.name} (${t.id}). Point rpcUrl at ${t.name}.`]);
1088
+ let i = [
1089
+ [
1090
+ "EAS contract",
1091
+ e.easContractAddress,
1092
+ "set easContractAddress"
1093
+ ],
1094
+ [
1095
+ "EAS SchemaRegistry",
1096
+ e.schemaRegistryAddress,
1097
+ "set schemaRegistryAddress"
1098
+ ],
1099
+ [
1100
+ "ManagedAccount factory",
1101
+ e.thirdwebAccountFactoryAddress,
1102
+ "deploy the factory or fix managedAccountFactoryAddress"
1103
+ ],
1104
+ [
1105
+ "executor module",
1106
+ e.modularAccountModuleContract?.trim() || void 0,
1107
+ "deploy the module or fix modularAccountModuleContract"
1108
+ ]
1109
+ ], a = await Promise.all(i.map(async ([e, n, r]) => n ? await A(n) ? null : `no ${e} at ${n} on ${t.name}; ${r}.` : null));
1110
+ for (let e of a) e && n.push(e);
1111
+ if (n.length > 0) throw new K(t.id, n);
1112
+ }
1113
+ function lt(e) {
1114
+ try {
1115
+ let t = new URL(e);
1116
+ return `${t.protocol}//${t.host}`;
1117
+ } catch {
1118
+ return "configured rpcUrl";
1119
+ }
1120
+ }
1121
+ function ut() {
1122
+ let e = st();
1123
+ if (q?.key === e) return q.result;
1124
+ let t = ct();
1125
+ return q = {
1126
+ key: e,
1127
+ result: t
1128
+ }, t.catch(() => {
1129
+ q?.result === t && (q = null);
1130
+ }), t;
1131
+ }
1132
+ //#endregion
1133
+ //#region src/services/revoke/revokeAttestations.ts
1134
+ async function dt(e) {
1135
+ if (!e) return !1;
1136
+ let t = s();
1137
+ if (!t) return !1;
1138
+ let n = await t(), r = e.toLowerCase();
1139
+ return !!n?.some((e) => e?.toLowerCase() === r);
1140
+ }
1141
+ async function ft(e, t) {
1142
+ if (!t || !Y().modularAccountModuleContract?.trim()) return !1;
1143
+ let n = e.signer?.address;
1144
+ if (!n || n.toLowerCase() === t.toLowerCase()) return !1;
1145
+ try {
1146
+ let { isAutomationSessionActive: e } = await import("./ensureAutomationSessionKey-Dyfk8qVp.js").then((e) => e.n);
1147
+ return await e(t, n);
1148
+ } catch {
1149
+ return !1;
1150
+ }
1151
+ }
1152
+ async function pt(e) {
1153
+ let { seedLocalId: t, seedUid: n, seedSchemaUid: a } = e;
1154
+ await i(), await ut();
1155
+ let s = await o({
1156
+ seedLocalId: t,
1157
+ seedUid: n
1158
+ }), l = !1, u = R();
1159
+ if (!u) try {
1160
+ let { getConnectedAccount: e } = await import("./publishAuthorization-DEriY_jm.js").then((e) => e.H), { resolveRevokeAccount: t } = await import("./resolveRevokeAccount-B7ImSb4Y.js"), n = await e();
1161
+ if (!n) throw Error("No wallet connected. Connect a wallet to revoke attestations.");
1162
+ u = G(await t({
1163
+ account: n,
1164
+ attester: s
1165
+ }));
1166
+ } catch (e) {
1167
+ throw e instanceof Error && e.message.includes("No wallet connected") || e instanceof Error && e.message.includes("Revocation not supported") ? e : Error("No wallet connected. Use useSeedWallet / setPublishWallet, or @seedprotocol/publish/thirdweb ConnectButton.", { cause: e });
1168
+ }
1169
+ else if (await dt(s)) {
1170
+ l = !0;
1171
+ let { modularAccountModuleContract: e } = Y();
1172
+ if (!e?.trim()) throw Error("Revocation not supported for items published via the modular executor.");
1173
+ }
1174
+ let d = u.txSender, f = await ft(u, s);
1175
+ if (f) {
1176
+ let { assertExecutorModuleReadyForAccount: e } = await import("./publishAuthorization-DEriY_jm.js").then((e) => e.b);
1177
+ await e(s);
1178
+ }
1179
+ let re = f || l, [p, m] = await Promise.all([ee(n), c(n)]), h = p.map((e) => e.uid).filter((e) => te(e)), g = /* @__PURE__ */ new Map();
1180
+ for (let { uid: e, schemaUid: t } of m) {
1181
+ if (!te(e)) continue;
1182
+ let n = g.get(t) ?? [];
1183
+ n.push(e), g.set(t, n);
1184
+ }
1185
+ let _ = [];
1186
+ for (let [e, t] of g) t.length > 0 && _.push({
1187
+ schema: e,
1188
+ data: t.map((e) => ({ uid: e }))
1189
+ });
1190
+ h.length > 0 && _.push({
1191
+ schema: r,
1192
+ data: h.map((e) => ({ uid: e }))
1193
+ }), _.push({
1194
+ schema: a,
1195
+ data: [{ uid: n }]
1196
+ });
1197
+ for (let e of _) {
1198
+ if (e.data.length === 0) continue;
1199
+ let t = I([e], { viaExecutorModule: re });
1200
+ if (f) {
1201
+ let { simulateCallFromAccount: e } = await import("./publishAuthorization-DEriY_jm.js").then((e) => e.b);
1202
+ await e({
1203
+ managedAddress: s,
1204
+ tx: t,
1205
+ action: "multiRevoke via the executor module"
1206
+ });
1207
+ }
1208
+ try {
1209
+ await k((await d.sendTransaction(t)).transactionHash);
1210
+ } catch (e) {
1211
+ let t = e instanceof Error ? e.message : String(e);
1212
+ if (t.includes("AccessDenied") || t.includes("0x4ca88867")) throw Error("Only the original attester can revoke attestations. Connect the wallet that published this item.");
1213
+ if (t.includes("AlreadyRevoked")) continue;
1214
+ throw e;
1215
+ }
1216
+ }
1217
+ let v = Math.floor(Date.now() / 1e3);
1218
+ await ne({
1219
+ seedLocalId: t,
1220
+ revokedAt: v
1221
+ });
1222
+ }
1223
+ //#endregion
1224
+ //#region src/config.ts
1225
+ oe("publish");
1226
+ var J = null;
1227
+ function mt(e) {
1228
+ J = e;
1229
+ }
1230
+ function ht() {
1231
+ return J;
1232
+ }
1233
+ function gt(e) {
1234
+ let t = X(e);
1235
+ ae("publish", {
1236
+ chainId: t.chainId,
1237
+ indexerUrl: t.indexerUrl
1238
+ }), mt(e), u(async () => {
1239
+ let e = R();
1240
+ if (e?.publisherAddress) return e.publisherAddress;
1241
+ if (e?.signer?.address) return e.signer.address;
1242
+ }), d(pt), import("./worker-BgErCNTb.js").then((e) => {
1243
+ e.startArweaveL1FinalizeWorker();
1244
+ }), l(async () => e.useModularExecutor && e.modularAccountModuleContract ? [e.modularAccountModuleContract] : []);
1245
+ }
1246
+ var _t = gt;
1247
+ function Y() {
1248
+ let e = J;
1249
+ if (!e) throw Error("@seedprotocol/publish: Call initPublish() or ensure PublishProvider is mounted with config before using the publish package");
1250
+ let t = e.useArweaveBundler ?? !1, r = e.arweaveUploadVerificationBaseUrl ?? e.uploadApiBaseUrl, i = e.arweaveGraphqlUrl ?? n, a = e.useModularExecutor ?? !1, o = e.chain ?? b, s = X(e), c = e.accountMode ?? (e.bundlerUrl ? "eip7702" : "eoa");
1251
+ return {
1252
+ ...e,
1253
+ thirdwebAccountFactoryAddress: e.managedAccountFactoryAddress ?? le[o.id],
1254
+ easContractAddress: s.easContractAddress,
1255
+ schemaRegistryAddress: s.schemaRegistryAddress,
1256
+ easChain: s,
1257
+ useIntegerLocalIds: e.useIntegerLocalIds ?? !1,
1258
+ useDirectEas: e.useDirectEas ?? !1,
1259
+ modularAccountModuleData: e.modularAccountModuleData ?? "0x",
1260
+ useModularExecutor: a,
1261
+ useArweaveBundler: t,
1262
+ arweaveUploadVerificationBaseUrl: r,
1263
+ arweaveGraphqlUrl: i,
1264
+ autoDeployManagedAccount: e.autoDeployManagedAccount ?? !1,
1265
+ autoDeployEip7702ModularAccount: vt(e, a),
1266
+ chain: o,
1267
+ accountMode: c
1268
+ };
1269
+ }
1270
+ function X(e) {
1271
+ let t = e.chain ?? b;
1272
+ try {
1273
+ return se(t.id, {
1274
+ name: t.name,
1275
+ easContractAddress: e.easContractAddress,
1276
+ schemaRegistryAddress: e.schemaRegistryAddress
1277
+ });
1278
+ } catch (e) {
1279
+ throw Error(`@seedprotocol/publish: ${t.name} (chain ${t.id}) has no known EAS deployment. Pass easContractAddress and schemaRegistryAddress in initPublish / PublishProvider config.`, { cause: e });
1280
+ }
1281
+ }
1282
+ function Z() {
1283
+ let { thirdwebAccountFactoryAddress: e, chain: t } = Y();
1284
+ if (!e) throw Error(`@seedprotocol/publish: no ManagedAccount factory is known for ${t.name} (chain ${t.id}). Pass managedAccountFactoryAddress in publish config, or use the EOA / direct EAS path.`);
1285
+ return e;
1286
+ }
1287
+ function vt(e, t) {
1288
+ return e.autoDeployEip7702ModularAccount === !0 || e.autoDeployEip7702ModularAccount !== !1 && t;
1289
+ }
1290
+ //#endregion
1291
+ //#region src/helpers/chainConfig.ts
1292
+ function Q() {
1293
+ try {
1294
+ return Y().chain ?? b;
1295
+ } catch {
1296
+ return b;
1297
+ }
1298
+ }
1299
+ function $() {
1300
+ let e = Y();
1301
+ if (e.rpcUrl) return e.rpcUrl;
1302
+ if (e.thirdwebClientId) return `https://${(e.chain ?? b).id}.rpc.thirdweb.com/${e.thirdwebClientId}`;
1303
+ throw Error("@seedprotocol/publish: rpcUrl is required when thirdwebClientId is not set. A thirdwebSecretKey authenticates Thirdweb RPC but does not build this URL. Pass rpcUrl or thirdwebClientId in initPublish / PublishProvider config.");
1304
+ }
1305
+ function yt() {
1306
+ return Q().name;
1307
+ }
1308
+ //#endregion
1309
+ export { O as $, P as A, N as B, U as C, R as D, Xe as E, We as F, Ne as G, Oe as H, I, Ie as J, Me as K, Le as L, Ke as M, F as N, Ye as O, Ue as P, we as Q, j as R, $e as S, H as T, ke as U, Ae as V, Ve as W, Fe as X, Pe as Y, Be as Z, nt as _, ht as a, ye as at, z as b, Z as c, ce as ct, ut as d, ue as dt, A as et, ot as f, me as ft, rt as g, it as h, _t as i, w as it, Ge as j, He as k, X as l, pe as lt, G as m, de as mt, $ as n, k as nt, Y as o, x as ot, at as p, fe as pt, je as q, Q as r, xe as rt, gt as s, b as st, yt as t, De as tt, K as u, le as ut, et as v, V as w, B as x, tt as y, M as z };
1310
+
1311
+ //# sourceMappingURL=chainConfig-CfVGYAsY.js.map