@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,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { o as t } from "./chainConfig-3sSqEVQh.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-BdgkcqM7.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-BdgkcqM7.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { r as t } from "./config-DkIapO94.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-BkmDN480.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-BkmDN480.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { o as t } from "./chainConfig-BYm5OXpk.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-BnDhP3N-.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-BnDhP3N-.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { o as t } from "./chainConfig-CA1Hrrjg.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-CBD9sKJR.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-CBD9sKJR.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { o as t } from "./chainConfig-DDA4YmAB.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-CQ29pzG2.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-CQ29pzG2.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { r as t } from "./config-EQZZNH9H.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-CZIVmr9Z.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-CZIVmr9Z.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { o as t } from "./chainConfig-CYy0XJ0M.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-Ce7iBIsj.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-Ce7iBIsj.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { o as t } from "./chainConfig-CfVGYAsY.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-DroRrOFQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-DroRrOFQ.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { r as t } from "./config-CPBd5C_b.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-DzXFjQ7L.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-DzXFjQ7L.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { o as t } from "./chainConfig-BRcsMopd.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-Dzb2vcEs.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-Dzb2vcEs.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -0,0 +1,18 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { o as t } from "./chainConfig-3wlYarAG.js";
3
+ import { createThirdwebClient as n } from "thirdweb";
4
+ //#region src/helpers/publishThirdwebClient.ts
5
+ var r = /* @__PURE__ */ e({ getClient: () => o }), i = null, a = null;
6
+ function o() {
7
+ let { thirdwebClientId: e, thirdwebSecretKey: r } = t();
8
+ if (!e && !r) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.");
9
+ let o = `${e ?? ""}\0${r ?? ""}`;
10
+ return (!i || a !== o) && (a = o, i = n(e ? {
11
+ clientId: e,
12
+ ...r ? { secretKey: r } : {}
13
+ } : { secretKey: r })), i;
14
+ }
15
+ //#endregion
16
+ export { r as n, o as t };
17
+
18
+ //# sourceMappingURL=publishThirdwebClient-i8P7fivi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publishThirdwebClient-i8P7fivi.js","names":[],"sources":["../src/helpers/publishThirdwebClient.ts"],"sourcesContent":["import { createThirdwebClient, type ThirdwebClient } from 'thirdweb'\nimport { getPublishConfig } from '../config'\n\nlet _client: ThirdwebClient | null = null\nlet _clientKey: string | null = null\n\n/**\n * Thirdweb client for publish sends and contract calls.\n * Uses `thirdwebSecretKey` when set so server-side RPC is not limited to browser origins.\n * Recreates the client when the client id or secret key changes.\n */\nexport function getClient(): ThirdwebClient {\n const { thirdwebClientId, thirdwebSecretKey } = getPublishConfig()\n if (!thirdwebClientId && !thirdwebSecretKey) {\n throw new Error(\n '@seedprotocol/publish/thirdweb: thirdwebClientId or thirdwebSecretKey is required. Pass one in initPublish / PublishProvider config.',\n )\n }\n const key = `${thirdwebClientId ?? ''}\\0${thirdwebSecretKey ?? ''}`\n if (!_client || _clientKey !== key) {\n _clientKey = key\n _client = thirdwebClientId\n ? createThirdwebClient({\n clientId: thirdwebClientId,\n ...(thirdwebSecretKey ? { secretKey: thirdwebSecretKey } : {}),\n })\n : createThirdwebClient({ secretKey: thirdwebSecretKey! })\n }\n return _client\n}\n\n/** Drop the cached client (tests). */\nexport function resetPublishThirdwebClient(): void {\n _client = null\n _clientKey = null\n}\n"],"mappings":";;;;mDAGI,IAAiC,MACjC,IAA4B;AAOhC,SAAgB,IAA4B;CAC1C,IAAM,EAAE,qBAAkB,yBAAsB,EAAiB;CACjE,IAAI,CAAC,KAAoB,CAAC,GACxB,MAAU,MACR,sIACF;CAEF,IAAM,IAAM,GAAG,KAAoB,GAAG,IAAI,KAAqB;CAU/D,QATI,CAAC,KAAW,MAAe,OAC7B,IAAa,GACb,IACI,EADM,IACe;EACnB,UAAU;EACV,GAAI,IAAoB,EAAE,WAAW,EAAkB,IAAI,CAAC;CAC9D,IACqB,EAAE,WAAW,EAAmB,CAAC,IAErD;AACT"}
@@ -1 +1 @@
1
- {"version":3,"file":"ConnectButton.d.ts","sourceRoot":"","sources":["../../src/react/ConnectButton.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAkC,MAAM,OAAO,CAAA;AAsFjE,QAAA,MAAM,aAAa,EAAE,EA+LpB,CAAA;AAED,eAAe,aAAa,CAAA"}
1
+ {"version":3,"file":"ConnectButton.d.ts","sourceRoot":"","sources":["../../src/react/ConnectButton.tsx"],"names":[],"mappings":"AAAA,OAAc,EAAE,EAAE,EAAkC,MAAM,OAAO,CAAA;AAsFjE,QAAA,MAAM,aAAa,EAAE,EAgMpB,CAAA;AAED,eAAe,aAAa,CAAA"}
@@ -0,0 +1,38 @@
1
+ import { _ as e, o as t } from "./chainConfig-DDA4YmAB.js";
2
+ import { A as n, F as r, L as i, M as a } from "./publishAuthorization-B0G1em4a.js";
3
+ import { t as o } from "./publishThirdwebClient-CQ29pzG2.js";
4
+ import { getGetAdditionalSyncAddresses as s } from "@seedprotocol/sdk";
5
+ //#region src/helpers/resolveRevokeAccount.ts
6
+ async function c(c) {
7
+ let { account: l, attester: u } = c;
8
+ if (!u || l.address.toLowerCase() === u.toLowerCase()) return l;
9
+ let d = s(), f = !1;
10
+ if (d) {
11
+ let e = await d(), t = u.toLowerCase();
12
+ f = !!e?.some((e) => e?.toLowerCase() === t);
13
+ }
14
+ try {
15
+ let t = await r(l.address);
16
+ if (u.toLowerCase() === t.toLowerCase() || f) {
17
+ let r = f ? await n(e()).catch(() => t) : t;
18
+ if (await i(r)) {
19
+ let t = a();
20
+ await t.autoConnect({
21
+ client: o(),
22
+ chain: e()
23
+ });
24
+ let n = t.getAccount();
25
+ if (n) return n;
26
+ }
27
+ }
28
+ } catch {}
29
+ if (f) {
30
+ let { modularAccountModuleContract: e } = t();
31
+ throw e?.trim() ? Error("Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.") : Error("Revocation not supported for items published via the modular executor.");
32
+ }
33
+ return l;
34
+ }
35
+ //#endregion
36
+ export { c as resolveRevokeAccount };
37
+
38
+ //# sourceMappingURL=resolveRevokeAccount-B5iXpuRT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRevokeAccount-B5iXpuRT.js","names":[],"sources":["../src/helpers/resolveRevokeAccount.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { getGetAdditionalSyncAddresses } from '@seedprotocol/sdk'\nimport { getPublishConfig } from '~/config'\nimport {\n getClient,\n getSmartWalletAddressForAdmin,\n isSmartWalletDeployed,\n getManagedAccountWallet,\n getConnectedManagedAccountAddress,\n} from '~/helpers/thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Resolves which account to use for revoking attestations.\n * When the attester is the user's ManagedAccount (EIP4337) but they're connected\n * with a different wallet (e.g. EOA or modular account), attempts to use the\n * ManagedAccount wallet for the revoke.\n *\n * When the attester is the legacy executor module address, attempts the ManagedAccount\n * wallet if `modularAccountModuleContract` is configured (executor-routed multiRevoke).\n * Throws only when the module was the attester and no ManagedAccount path is available.\n */\nexport async function resolveRevokeAccount(params: {\n account: Account\n attester: string | null\n}): Promise<Account> {\n const { account, attester } = params\n\n if (!attester || account.address.toLowerCase() === attester.toLowerCase()) {\n return account\n }\n\n const additionalGetter = getGetAdditionalSyncAddresses()\n let attesterIsExecutorModule = false\n if (additionalGetter) {\n const additional = await additionalGetter()\n const attesterLower = attester.toLowerCase()\n attesterIsExecutorModule = !!additional?.some(\n (a: string | undefined) => a?.toLowerCase() === attesterLower,\n )\n }\n\n try {\n const derivedManagedAccount = await getSmartWalletAddressForAdmin(account.address)\n const attesterLower = attester.toLowerCase()\n const derivedLower = derivedManagedAccount.toLowerCase()\n\n if (attesterLower === derivedLower || attesterIsExecutorModule) {\n const managedAddress = attesterIsExecutorModule\n ? await getConnectedManagedAccountAddress(getPublishThirdwebChain()).catch(() => derivedManagedAccount)\n : derivedManagedAccount\n const deployed = await isSmartWalletDeployed(managedAddress)\n if (deployed) {\n const managedAccountWallet = getManagedAccountWallet()\n await managedAccountWallet.autoConnect({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n })\n const managedAccount = managedAccountWallet.getAccount()\n if (managedAccount) {\n return managedAccount\n }\n }\n }\n } catch {\n // Fall through\n }\n\n if (attesterIsExecutorModule) {\n const { modularAccountModuleContract } = getPublishConfig()\n if (!modularAccountModuleContract?.trim()) {\n throw new Error(\n 'Revocation not supported for items published via the modular executor.',\n )\n }\n // Module configured but ManagedAccount wallet unavailable\n throw new Error(\n 'Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.',\n )\n }\n\n return account\n}\n"],"mappings":";;;;;AAsBA,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,EAAwB,CAAC,CAAC,CAAC,YAAY,CAAqB,IACpG;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO,EAAwB;IACjC,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}
@@ -0,0 +1,38 @@
1
+ import { g as e, o as t } from "./chainConfig-CfVGYAsY.js";
2
+ import { I as n, N as r, R as i, j as a } from "./publishAuthorization-DEriY_jm.js";
3
+ import { t as o } from "./publishThirdwebClient-DroRrOFQ.js";
4
+ import { getGetAdditionalSyncAddresses as s } from "@seedprotocol/sdk";
5
+ //#region src/helpers/resolveRevokeAccount.ts
6
+ async function c(c) {
7
+ let { account: l, attester: u } = c;
8
+ if (!u || l.address.toLowerCase() === u.toLowerCase()) return l;
9
+ let d = s(), f = !1;
10
+ if (d) {
11
+ let e = await d(), t = u.toLowerCase();
12
+ f = !!e?.some((e) => e?.toLowerCase() === t);
13
+ }
14
+ try {
15
+ let t = await n(l.address);
16
+ if (u.toLowerCase() === t.toLowerCase() || f) {
17
+ let n = f ? await a(e()).catch(() => t) : t;
18
+ if (await i(n)) {
19
+ let t = r();
20
+ await t.autoConnect({
21
+ client: o(),
22
+ chain: e()
23
+ });
24
+ let n = t.getAccount();
25
+ if (n) return n;
26
+ }
27
+ }
28
+ } catch {}
29
+ if (f) {
30
+ let { modularAccountModuleContract: e } = t();
31
+ throw e?.trim() ? Error("Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.") : Error("Revocation not supported for items published via the modular executor.");
32
+ }
33
+ return l;
34
+ }
35
+ //#endregion
36
+ export { c as resolveRevokeAccount };
37
+
38
+ //# sourceMappingURL=resolveRevokeAccount-B7ImSb4Y.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRevokeAccount-B7ImSb4Y.js","names":[],"sources":["../src/helpers/resolveRevokeAccount.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { getGetAdditionalSyncAddresses } from '@seedprotocol/sdk'\nimport { getPublishConfig } from '~/config'\nimport {\n getClient,\n getSmartWalletAddressForAdmin,\n isSmartWalletDeployed,\n getManagedAccountWallet,\n getConnectedManagedAccountAddress,\n} from '~/helpers/thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Resolves which account to use for revoking attestations.\n * When the attester is the user's ManagedAccount (EIP4337) but they're connected\n * with a different wallet (e.g. EOA or modular account), attempts to use the\n * ManagedAccount wallet for the revoke.\n *\n * When the attester is the legacy executor module address, attempts the ManagedAccount\n * wallet if `modularAccountModuleContract` is configured (executor-routed multiRevoke).\n * Throws only when the module was the attester and no ManagedAccount path is available.\n */\nexport async function resolveRevokeAccount(params: {\n account: Account\n attester: string | null\n}): Promise<Account> {\n const { account, attester } = params\n\n if (!attester || account.address.toLowerCase() === attester.toLowerCase()) {\n return account\n }\n\n const additionalGetter = getGetAdditionalSyncAddresses()\n let attesterIsExecutorModule = false\n if (additionalGetter) {\n const additional = await additionalGetter()\n const attesterLower = attester.toLowerCase()\n attesterIsExecutorModule = !!additional?.some(\n (a: string | undefined) => a?.toLowerCase() === attesterLower,\n )\n }\n\n try {\n const derivedManagedAccount = await getSmartWalletAddressForAdmin(account.address)\n const attesterLower = attester.toLowerCase()\n const derivedLower = derivedManagedAccount.toLowerCase()\n\n if (attesterLower === derivedLower || attesterIsExecutorModule) {\n const managedAddress = attesterIsExecutorModule\n ? await getConnectedManagedAccountAddress(getPublishThirdwebChain()).catch(() => derivedManagedAccount)\n : derivedManagedAccount\n const deployed = await isSmartWalletDeployed(managedAddress)\n if (deployed) {\n const managedAccountWallet = getManagedAccountWallet()\n await managedAccountWallet.autoConnect({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n })\n const managedAccount = managedAccountWallet.getAccount()\n if (managedAccount) {\n return managedAccount\n }\n }\n }\n } catch {\n // Fall through\n }\n\n if (attesterIsExecutorModule) {\n const { modularAccountModuleContract } = getPublishConfig()\n if (!modularAccountModuleContract?.trim()) {\n throw new Error(\n 'Revocation not supported for items published via the modular executor.',\n )\n }\n // Module configured but ManagedAccount wallet unavailable\n throw new Error(\n 'Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.',\n )\n }\n\n return account\n}\n"],"mappings":";;;;;AAsBA,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,EAAwB,CAAC,CAAC,CAAC,YAAY,CAAqB,IACpG;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO,EAAwB;IACjC,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}
@@ -0,0 +1,38 @@
1
+ import { _ as e, o as t } from "./chainConfig-3sSqEVQh.js";
2
+ import { A as n, F as r, L as i, M as a } from "./publishAuthorization-By2Tt9kW.js";
3
+ import { t as o } from "./publishThirdwebClient-BdgkcqM7.js";
4
+ import { getGetAdditionalSyncAddresses as s } from "@seedprotocol/sdk";
5
+ //#region src/helpers/resolveRevokeAccount.ts
6
+ async function c(c) {
7
+ let { account: l, attester: u } = c;
8
+ if (!u || l.address.toLowerCase() === u.toLowerCase()) return l;
9
+ let d = s(), f = !1;
10
+ if (d) {
11
+ let e = await d(), t = u.toLowerCase();
12
+ f = !!e?.some((e) => e?.toLowerCase() === t);
13
+ }
14
+ try {
15
+ let t = await r(l.address);
16
+ if (u.toLowerCase() === t.toLowerCase() || f) {
17
+ let r = f ? await n(e()).catch(() => t) : t;
18
+ if (await i(r)) {
19
+ let t = a();
20
+ await t.autoConnect({
21
+ client: o(),
22
+ chain: e()
23
+ });
24
+ let n = t.getAccount();
25
+ if (n) return n;
26
+ }
27
+ }
28
+ } catch {}
29
+ if (f) {
30
+ let { modularAccountModuleContract: e } = t();
31
+ throw e?.trim() ? Error("Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.") : Error("Revocation not supported for items published via the modular executor.");
32
+ }
33
+ return l;
34
+ }
35
+ //#endregion
36
+ export { c as resolveRevokeAccount };
37
+
38
+ //# sourceMappingURL=resolveRevokeAccount-BM1j2l5Q.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRevokeAccount-BM1j2l5Q.js","names":[],"sources":["../src/helpers/resolveRevokeAccount.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { getGetAdditionalSyncAddresses } from '@seedprotocol/sdk'\nimport { getPublishConfig } from '~/config'\nimport {\n getClient,\n getSmartWalletAddressForAdmin,\n isSmartWalletDeployed,\n getManagedAccountWallet,\n getConnectedManagedAccountAddress,\n} from '~/helpers/thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Resolves which account to use for revoking attestations.\n * When the attester is the user's ManagedAccount (EIP4337) but they're connected\n * with a different wallet (e.g. EOA or modular account), attempts to use the\n * ManagedAccount wallet for the revoke.\n *\n * When the attester is the legacy executor module address, attempts the ManagedAccount\n * wallet if `modularAccountModuleContract` is configured (executor-routed multiRevoke).\n * Throws only when the module was the attester and no ManagedAccount path is available.\n */\nexport async function resolveRevokeAccount(params: {\n account: Account\n attester: string | null\n}): Promise<Account> {\n const { account, attester } = params\n\n if (!attester || account.address.toLowerCase() === attester.toLowerCase()) {\n return account\n }\n\n const additionalGetter = getGetAdditionalSyncAddresses()\n let attesterIsExecutorModule = false\n if (additionalGetter) {\n const additional = await additionalGetter()\n const attesterLower = attester.toLowerCase()\n attesterIsExecutorModule = !!additional?.some(\n (a: string | undefined) => a?.toLowerCase() === attesterLower,\n )\n }\n\n try {\n const derivedManagedAccount = await getSmartWalletAddressForAdmin(account.address)\n const attesterLower = attester.toLowerCase()\n const derivedLower = derivedManagedAccount.toLowerCase()\n\n if (attesterLower === derivedLower || attesterIsExecutorModule) {\n const managedAddress = attesterIsExecutorModule\n ? await getConnectedManagedAccountAddress(getPublishThirdwebChain()).catch(() => derivedManagedAccount)\n : derivedManagedAccount\n const deployed = await isSmartWalletDeployed(managedAddress)\n if (deployed) {\n const managedAccountWallet = getManagedAccountWallet()\n await managedAccountWallet.autoConnect({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n })\n const managedAccount = managedAccountWallet.getAccount()\n if (managedAccount) {\n return managedAccount\n }\n }\n }\n } catch {\n // Fall through\n }\n\n if (attesterIsExecutorModule) {\n const { modularAccountModuleContract } = getPublishConfig()\n if (!modularAccountModuleContract?.trim()) {\n throw new Error(\n 'Revocation not supported for items published via the modular executor.',\n )\n }\n // Module configured but ManagedAccount wallet unavailable\n throw new Error(\n 'Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.',\n )\n }\n\n return account\n}\n"],"mappings":";;;;;AAsBA,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,EAAwB,CAAC,CAAC,CAAC,YAAY,CAAqB,IACpG;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO,EAAwB;IACjC,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}
@@ -0,0 +1,38 @@
1
+ import { _ as e, o as t } from "./chainConfig-BRcsMopd.js";
2
+ import { A as n, F as r, L as i, M as a } from "./publishAuthorization-CxWY7lAQ.js";
3
+ import { t as o } from "./publishThirdwebClient-Dzb2vcEs.js";
4
+ import { getGetAdditionalSyncAddresses as s } from "@seedprotocol/sdk";
5
+ //#region src/helpers/resolveRevokeAccount.ts
6
+ async function c(c) {
7
+ let { account: l, attester: u } = c;
8
+ if (!u || l.address.toLowerCase() === u.toLowerCase()) return l;
9
+ let d = s(), f = !1;
10
+ if (d) {
11
+ let e = await d(), t = u.toLowerCase();
12
+ f = !!e?.some((e) => e?.toLowerCase() === t);
13
+ }
14
+ try {
15
+ let t = await r(l.address);
16
+ if (u.toLowerCase() === t.toLowerCase() || f) {
17
+ let r = f ? await n(e()).catch(() => t) : t;
18
+ if (await i(r)) {
19
+ let t = a();
20
+ await t.autoConnect({
21
+ client: o(),
22
+ chain: e()
23
+ });
24
+ let n = t.getAccount();
25
+ if (n) return n;
26
+ }
27
+ }
28
+ } catch {}
29
+ if (f) {
30
+ let { modularAccountModuleContract: e } = t();
31
+ throw e?.trim() ? Error("Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.") : Error("Revocation not supported for items published via the modular executor.");
32
+ }
33
+ return l;
34
+ }
35
+ //#endregion
36
+ export { c as resolveRevokeAccount };
37
+
38
+ //# sourceMappingURL=resolveRevokeAccount-BtVG0xxc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRevokeAccount-BtVG0xxc.js","names":[],"sources":["../src/helpers/resolveRevokeAccount.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { getGetAdditionalSyncAddresses } from '@seedprotocol/sdk'\nimport { getPublishConfig } from '~/config'\nimport {\n getClient,\n getSmartWalletAddressForAdmin,\n isSmartWalletDeployed,\n getManagedAccountWallet,\n getConnectedManagedAccountAddress,\n} from '~/helpers/thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Resolves which account to use for revoking attestations.\n * When the attester is the user's ManagedAccount (EIP4337) but they're connected\n * with a different wallet (e.g. EOA or modular account), attempts to use the\n * ManagedAccount wallet for the revoke.\n *\n * When the attester is the legacy executor module address, attempts the ManagedAccount\n * wallet if `modularAccountModuleContract` is configured (executor-routed multiRevoke).\n * Throws only when the module was the attester and no ManagedAccount path is available.\n */\nexport async function resolveRevokeAccount(params: {\n account: Account\n attester: string | null\n}): Promise<Account> {\n const { account, attester } = params\n\n if (!attester || account.address.toLowerCase() === attester.toLowerCase()) {\n return account\n }\n\n const additionalGetter = getGetAdditionalSyncAddresses()\n let attesterIsExecutorModule = false\n if (additionalGetter) {\n const additional = await additionalGetter()\n const attesterLower = attester.toLowerCase()\n attesterIsExecutorModule = !!additional?.some(\n (a: string | undefined) => a?.toLowerCase() === attesterLower,\n )\n }\n\n try {\n const derivedManagedAccount = await getSmartWalletAddressForAdmin(account.address)\n const attesterLower = attester.toLowerCase()\n const derivedLower = derivedManagedAccount.toLowerCase()\n\n if (attesterLower === derivedLower || attesterIsExecutorModule) {\n const managedAddress = attesterIsExecutorModule\n ? await getConnectedManagedAccountAddress(getPublishThirdwebChain()).catch(() => derivedManagedAccount)\n : derivedManagedAccount\n const deployed = await isSmartWalletDeployed(managedAddress)\n if (deployed) {\n const managedAccountWallet = getManagedAccountWallet()\n await managedAccountWallet.autoConnect({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n })\n const managedAccount = managedAccountWallet.getAccount()\n if (managedAccount) {\n return managedAccount\n }\n }\n }\n } catch {\n // Fall through\n }\n\n if (attesterIsExecutorModule) {\n const { modularAccountModuleContract } = getPublishConfig()\n if (!modularAccountModuleContract?.trim()) {\n throw new Error(\n 'Revocation not supported for items published via the modular executor.',\n )\n }\n // Module configured but ManagedAccount wallet unavailable\n throw new Error(\n 'Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.',\n )\n }\n\n return account\n}\n"],"mappings":";;;;;AAsBA,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,EAAwB,CAAC,CAAC,CAAC,YAAY,CAAqB,IACpG;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO,EAAwB;IACjC,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}
@@ -0,0 +1,39 @@
1
+ import { r as e } from "./config-CPBd5C_b.js";
2
+ import { I as t, N as n, R as r, j as i } from "./publishAuthorization-DqhhCAhd.js";
3
+ import { t as a } from "./publishThirdwebClient-DzXFjQ7L.js";
4
+ import { getGetAdditionalSyncAddresses as o } from "@seedprotocol/sdk";
5
+ import { optimismSepolia as s } from "thirdweb/chains";
6
+ //#region src/helpers/resolveRevokeAccount.ts
7
+ async function c(c) {
8
+ let { account: l, attester: u } = c;
9
+ if (!u || l.address.toLowerCase() === u.toLowerCase()) return l;
10
+ let d = o(), f = !1;
11
+ if (d) {
12
+ let e = await d(), t = u.toLowerCase();
13
+ f = !!e?.some((e) => e?.toLowerCase() === t);
14
+ }
15
+ try {
16
+ let e = await t(l.address);
17
+ if (u.toLowerCase() === e.toLowerCase() || f) {
18
+ let t = f ? await i(s).catch(() => e) : e;
19
+ if (await r(t)) {
20
+ let e = n();
21
+ await e.autoConnect({
22
+ client: a(),
23
+ chain: s
24
+ });
25
+ let t = e.getAccount();
26
+ if (t) return t;
27
+ }
28
+ }
29
+ } catch {}
30
+ if (f) {
31
+ let { modularAccountModuleContract: t } = e();
32
+ throw t?.trim() ? Error("Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.") : Error("Revocation not supported for items published via the modular executor.");
33
+ }
34
+ return l;
35
+ }
36
+ //#endregion
37
+ export { c as resolveRevokeAccount };
38
+
39
+ //# sourceMappingURL=resolveRevokeAccount-CJZZdBcQ.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRevokeAccount-CJZZdBcQ.js","names":[],"sources":["../src/helpers/resolveRevokeAccount.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { optimismSepolia } from 'thirdweb/chains'\nimport { getGetAdditionalSyncAddresses } from '@seedprotocol/sdk'\nimport { getPublishConfig } from '~/config'\nimport {\n getClient,\n getSmartWalletAddressForAdmin,\n isSmartWalletDeployed,\n getManagedAccountWallet,\n getConnectedManagedAccountAddress,\n} from '~/helpers/thirdweb'\n\n/**\n * Resolves which account to use for revoking attestations.\n * When the attester is the user's ManagedAccount (EIP4337) but they're connected\n * with a different wallet (e.g. EOA or modular account), attempts to use the\n * ManagedAccount wallet for the revoke.\n *\n * When the attester is the legacy executor module address, attempts the ManagedAccount\n * wallet if `modularAccountModuleContract` is configured (executor-routed multiRevoke).\n * Throws only when the module was the attester and no ManagedAccount path is available.\n */\nexport async function resolveRevokeAccount(params: {\n account: Account\n attester: string | null\n}): Promise<Account> {\n const { account, attester } = params\n\n if (!attester || account.address.toLowerCase() === attester.toLowerCase()) {\n return account\n }\n\n const additionalGetter = getGetAdditionalSyncAddresses()\n let attesterIsExecutorModule = false\n if (additionalGetter) {\n const additional = await additionalGetter()\n const attesterLower = attester.toLowerCase()\n attesterIsExecutorModule = !!additional?.some(\n (a: string | undefined) => a?.toLowerCase() === attesterLower,\n )\n }\n\n try {\n const derivedManagedAccount = await getSmartWalletAddressForAdmin(account.address)\n const attesterLower = attester.toLowerCase()\n const derivedLower = derivedManagedAccount.toLowerCase()\n\n if (attesterLower === derivedLower || attesterIsExecutorModule) {\n const managedAddress = attesterIsExecutorModule\n ? await getConnectedManagedAccountAddress(optimismSepolia).catch(() => derivedManagedAccount)\n : derivedManagedAccount\n const deployed = await isSmartWalletDeployed(managedAddress)\n if (deployed) {\n const managedAccountWallet = getManagedAccountWallet()\n await managedAccountWallet.autoConnect({\n client: getClient(),\n chain: optimismSepolia,\n })\n const managedAccount = managedAccountWallet.getAccount()\n if (managedAccount) {\n return managedAccount\n }\n }\n }\n } catch {\n // Fall through\n }\n\n if (attesterIsExecutorModule) {\n const { modularAccountModuleContract } = getPublishConfig()\n if (!modularAccountModuleContract?.trim()) {\n throw new Error(\n 'Revocation not supported for items published via the modular executor.',\n )\n }\n // Module configured but ManagedAccount wallet unavailable\n throw new Error(\n 'Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.',\n )\n }\n\n return account\n}\n"],"mappings":";;;;;;AAsBA,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,CAAe,CAAC,CAAC,YAAY,CAAqB,IAC1F;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO;IACT,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}
@@ -0,0 +1,39 @@
1
+ import { r as e } from "./config-EQZZNH9H.js";
2
+ import { A as t, F as n, N as r, O as i } from "./publishAuthorization-Bltn3y_K.js";
3
+ import { t as a } from "./publishThirdwebClient-CZIVmr9Z.js";
4
+ import { getGetAdditionalSyncAddresses as o } from "@seedprotocol/sdk";
5
+ import { optimismSepolia as s } from "thirdweb/chains";
6
+ //#region src/helpers/resolveRevokeAccount.ts
7
+ async function c(c) {
8
+ let { account: l, attester: u } = c;
9
+ if (!u || l.address.toLowerCase() === u.toLowerCase()) return l;
10
+ let d = o(), f = !1;
11
+ if (d) {
12
+ let e = await d(), t = u.toLowerCase();
13
+ f = !!e?.some((e) => e?.toLowerCase() === t);
14
+ }
15
+ try {
16
+ let e = await r(l.address);
17
+ if (u.toLowerCase() === e.toLowerCase() || f) {
18
+ let r = f ? await i(s).catch(() => e) : e;
19
+ if (await n(r)) {
20
+ let e = t();
21
+ await e.autoConnect({
22
+ client: a(),
23
+ chain: s
24
+ });
25
+ let n = e.getAccount();
26
+ if (n) return n;
27
+ }
28
+ }
29
+ } catch {}
30
+ if (f) {
31
+ let { modularAccountModuleContract: t } = e();
32
+ throw t?.trim() ? Error("Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.") : Error("Revocation not supported for items published via the modular executor.");
33
+ }
34
+ return l;
35
+ }
36
+ //#endregion
37
+ export { c as resolveRevokeAccount };
38
+
39
+ //# sourceMappingURL=resolveRevokeAccount-CaIMuCee.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveRevokeAccount-CaIMuCee.js","names":[],"sources":["../src/helpers/resolveRevokeAccount.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { optimismSepolia } from 'thirdweb/chains'\nimport { getGetAdditionalSyncAddresses } from '@seedprotocol/sdk'\nimport { getPublishConfig } from '~/config'\nimport {\n getClient,\n getSmartWalletAddressForAdmin,\n isSmartWalletDeployed,\n getManagedAccountWallet,\n getConnectedManagedAccountAddress,\n} from '~/helpers/thirdweb'\n\n/**\n * Resolves which account to use for revoking attestations.\n * When the attester is the user's ManagedAccount (EIP4337) but they're connected\n * with a different wallet (e.g. EOA or modular account), attempts to use the\n * ManagedAccount wallet for the revoke.\n *\n * When the attester is the legacy executor module address, attempts the ManagedAccount\n * wallet if `modularAccountModuleContract` is configured (executor-routed multiRevoke).\n * Throws only when the module was the attester and no ManagedAccount path is available.\n */\nexport async function resolveRevokeAccount(params: {\n account: Account\n attester: string | null\n}): Promise<Account> {\n const { account, attester } = params\n\n if (!attester || account.address.toLowerCase() === attester.toLowerCase()) {\n return account\n }\n\n const additionalGetter = getGetAdditionalSyncAddresses()\n let attesterIsExecutorModule = false\n if (additionalGetter) {\n const additional = await additionalGetter()\n const attesterLower = attester.toLowerCase()\n attesterIsExecutorModule = !!additional?.some(\n (a: string | undefined) => a?.toLowerCase() === attesterLower,\n )\n }\n\n try {\n const derivedManagedAccount = await getSmartWalletAddressForAdmin(account.address)\n const attesterLower = attester.toLowerCase()\n const derivedLower = derivedManagedAccount.toLowerCase()\n\n if (attesterLower === derivedLower || attesterIsExecutorModule) {\n const managedAddress = attesterIsExecutorModule\n ? await getConnectedManagedAccountAddress(optimismSepolia).catch(() => derivedManagedAccount)\n : derivedManagedAccount\n const deployed = await isSmartWalletDeployed(managedAddress)\n if (deployed) {\n const managedAccountWallet = getManagedAccountWallet()\n await managedAccountWallet.autoConnect({\n client: getClient(),\n chain: optimismSepolia,\n })\n const managedAccount = managedAccountWallet.getAccount()\n if (managedAccount) {\n return managedAccount\n }\n }\n }\n } catch {\n // Fall through\n }\n\n if (attesterIsExecutorModule) {\n const { modularAccountModuleContract } = getPublishConfig()\n if (!modularAccountModuleContract?.trim()) {\n throw new Error(\n 'Revocation not supported for items published via the modular executor.',\n )\n }\n // Module configured but ManagedAccount wallet unavailable\n throw new Error(\n 'Revocation not supported for items published via the modular executor. Connect the ManagedAccount that controls the executor module.',\n )\n }\n\n return account\n}\n"],"mappings":";;;;;;AAsBA,eAAsB,EAAqB,GAGtB;CACnB,IAAM,EAAE,YAAS,gBAAa;CAE9B,IAAI,CAAC,KAAY,EAAQ,QAAQ,YAAY,MAAM,EAAS,YAAY,GACtE,OAAO;CAGT,IAAM,IAAmB,EAA8B,GACnD,IAA2B;CAC/B,IAAI,GAAkB;EACpB,IAAM,IAAa,MAAM,EAAiB,GACpC,IAAgB,EAAS,YAAY;EAC3C,IAA2B,CAAC,CAAC,GAAY,MACtC,MAA0B,GAAG,YAAY,MAAM,CAClD;CACF;CAEA,IAAI;EACF,IAAM,IAAwB,MAAM,EAA8B,EAAQ,OAAO;EAIjF,IAHsB,EAAS,YAG3B,MAFiB,EAAsB,YAErB,KAAgB,GAA0B;GAC9D,IAAM,IAAiB,IACnB,MAAM,EAAkC,CAAe,CAAC,CAAC,YAAY,CAAqB,IAC1F;GAEJ,IAAI,MADmB,EAAsB,CAAc,GAC7C;IACZ,IAAM,IAAuB,EAAwB;IACrD,MAAM,EAAqB,YAAY;KACrC,QAAQ,EAAU;KAClB,OAAO;IACT,CAAC;IACD,IAAM,IAAiB,EAAqB,WAAW;IACvD,IAAI,GACF,OAAO;GAEX;EACF;CACF,QAAQ,CAER;CAEA,IAAI,GAA0B;EAC5B,IAAM,EAAE,oCAAiC,EAAiB;EAO1D,MANK,GAA8B,KAAK,IAM9B,MACR,sIACF,IAPY,MACR,wEACF;CAMJ;CAEA,OAAO;AACT"}