@seedprotocol/publish 0.6.7 → 0.6.9

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