@seedprotocol/publish 0.6.9 → 0.7.0

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 (345) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -1
  3. package/dist/{chainConfig-CYy0XJ0M.js → chainConfig-BJ8C_RRz.js} +392 -220
  4. package/dist/chainConfig-BJ8C_RRz.js.map +1 -0
  5. package/dist/{chainConfig-BRcsMopd.js → chainConfig-DWynbnb8.js} +446 -433
  6. package/dist/chainConfig-DWynbnb8.js.map +1 -0
  7. package/dist/{chainConfig-CA1Hrrjg.js → chainConfig-DWzoOtkS.js} +394 -328
  8. package/dist/chainConfig-DWzoOtkS.js.map +1 -0
  9. package/dist/{chainConfig-3wlYarAG.js → chainConfig-DmuPBs3D.js} +442 -420
  10. package/dist/chainConfig-DmuPBs3D.js.map +1 -0
  11. package/dist/config.d.ts +5 -4
  12. package/dist/config.d.ts.map +1 -1
  13. package/dist/ensureAutomationSessionKey-BVmh030S.js +84 -0
  14. package/dist/ensureAutomationSessionKey-BVmh030S.js.map +1 -0
  15. package/dist/ensureAutomationSessionKey-CxpJY_uH.js +84 -0
  16. package/dist/ensureAutomationSessionKey-CxpJY_uH.js.map +1 -0
  17. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js +84 -0
  18. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js.map +1 -0
  19. package/dist/ensureAutomationSessionKey-h3zOmDr5.js +84 -0
  20. package/dist/ensureAutomationSessionKey-h3zOmDr5.js.map +1 -0
  21. package/dist/{ensureModularPublishBootstrap-DGBKVGg5.js → ensureModularPublishBootstrap-BImiIFJe.js} +9 -10
  22. package/dist/{ensureModularPublishBootstrap-5HJDqJJM.js.map → ensureModularPublishBootstrap-BImiIFJe.js.map} +1 -1
  23. package/dist/{ensureModularPublishBootstrap-DxIG-LUP.js → ensureModularPublishBootstrap-CmxyX_EN.js} +9 -10
  24. package/dist/{ensureModularPublishBootstrap-BW8jKN_A.js.map → ensureModularPublishBootstrap-CmxyX_EN.js.map} +1 -1
  25. package/dist/{ensureModularPublishBootstrap-BW8jKN_A.js → ensureModularPublishBootstrap-DRFhp-O2.js} +9 -10
  26. package/dist/{ensureModularPublishBootstrap-BhYNmLzT.js.map → ensureModularPublishBootstrap-DRFhp-O2.js.map} +1 -1
  27. package/dist/{ensureModularPublishBootstrap-BhYNmLzT.js → ensureModularPublishBootstrap-DegJnYKL.js} +9 -10
  28. package/dist/{ensureModularPublishBootstrap-Bsw1xSCt.js.map → ensureModularPublishBootstrap-DegJnYKL.js.map} +1 -1
  29. package/dist/{ensureSmartWalletThenPublish-Bm58tc-b.js → ensureSmartWalletThenPublish-0nKg13WN.js} +9 -10
  30. package/dist/{ensureSmartWalletThenPublish-Bm58tc-b.js.map → ensureSmartWalletThenPublish-0nKg13WN.js.map} +1 -1
  31. package/dist/{ensureSmartWalletThenPublish-D5GSZRyZ.js → ensureSmartWalletThenPublish-BdqeUL6t.js} +9 -10
  32. package/dist/{ensureSmartWalletThenPublish-D5GSZRyZ.js.map → ensureSmartWalletThenPublish-BdqeUL6t.js.map} +1 -1
  33. package/dist/{ensureSmartWalletThenPublish-DAomriGc.js → ensureSmartWalletThenPublish-BfEndtFo.js} +9 -10
  34. package/dist/{ensureSmartWalletThenPublish-DAomriGc.js.map → ensureSmartWalletThenPublish-BfEndtFo.js.map} +1 -1
  35. package/dist/{ensureSmartWalletThenPublish-Dta2AOyJ.js → ensureSmartWalletThenPublish-DuOYPJFd.js} +9 -10
  36. package/dist/{ensureSmartWalletThenPublish-Bl415Ss6.js.map → ensureSmartWalletThenPublish-DuOYPJFd.js.map} +1 -1
  37. package/dist/errors.d.ts +9 -0
  38. package/dist/errors.d.ts.map +1 -1
  39. package/dist/helpers/abi/executor.d.ts +12 -0
  40. package/dist/helpers/abi/executor.d.ts.map +1 -1
  41. package/dist/helpers/abi/factory.d.ts +11 -0
  42. package/dist/helpers/abi/factory.d.ts.map +1 -1
  43. package/dist/helpers/abi/seedExecutorRouter.d.ts +9 -1
  44. package/dist/helpers/abi/seedExecutorRouter.d.ts.map +1 -1
  45. package/dist/helpers/adapters/thirdwebAccount.d.ts.map +1 -1
  46. package/dist/helpers/chainClient.d.ts +18 -2
  47. package/dist/helpers/chainClient.d.ts.map +1 -1
  48. package/dist/helpers/contracts/index.d.ts +9 -0
  49. package/dist/helpers/contracts/index.d.ts.map +1 -1
  50. package/dist/helpers/describeRevert.d.ts +3 -2
  51. package/dist/helpers/describeRevert.d.ts.map +1 -1
  52. package/dist/helpers/enrollPublishAutomation.d.ts +2 -2
  53. package/dist/helpers/enrollPublishAutomation.d.ts.map +1 -1
  54. package/dist/helpers/ensureAutomationSessionKey.d.ts.map +1 -1
  55. package/dist/helpers/ensureExecutorModule.d.ts +28 -5
  56. package/dist/helpers/ensureExecutorModule.d.ts.map +1 -1
  57. package/dist/helpers/executorModuleReadiness.d.ts +15 -1
  58. package/dist/helpers/executorModuleReadiness.d.ts.map +1 -1
  59. package/dist/helpers/gasLog.d.ts +8 -0
  60. package/dist/helpers/gasLog.d.ts.map +1 -0
  61. package/dist/helpers/seedPaymaster.d.ts +27 -0
  62. package/dist/helpers/seedPaymaster.d.ts.map +1 -0
  63. package/dist/helpers/thirdweb.d.ts.map +1 -1
  64. package/dist/index.d.ts +3 -3
  65. package/dist/index.d.ts.map +1 -1
  66. package/dist/index.js +271 -272
  67. package/dist/index.js.map +1 -1
  68. package/dist/{managedAccountAdmin-B64V1rlU.js → managedAccountAdmin-B4HkLWWE.js} +9 -10
  69. package/dist/{managedAccountAdmin-B64V1rlU.js.map → managedAccountAdmin-B4HkLWWE.js.map} +1 -1
  70. package/dist/{managedAccountAdmin-Bje6X8Ds.js → managedAccountAdmin-ByEX_Eg2.js} +9 -10
  71. package/dist/{managedAccountAdmin-BVLGWpEb.js.map → managedAccountAdmin-ByEX_Eg2.js.map} +1 -1
  72. package/dist/{managedAccountAdmin-C84-IlQ9.js → managedAccountAdmin-DS6nniiu.js} +9 -10
  73. package/dist/{managedAccountAdmin-Bje6X8Ds.js.map → managedAccountAdmin-DS6nniiu.js.map} +1 -1
  74. package/dist/managedAccountAdmin-DwFI-ZfE.js +28 -0
  75. package/dist/{managedAccountAdmin-C84-IlQ9.js.map → managedAccountAdmin-DwFI-ZfE.js.map} +1 -1
  76. package/dist/{publishAuthorization-DjVrnMC0.js → publishAuthorization-C-XYb9Ef.js} +1500 -1391
  77. package/dist/publishAuthorization-C-XYb9Ef.js.map +1 -0
  78. package/dist/{publishAuthorization-BEqRnP2h.js → publishAuthorization-CG23g8w2.js} +1460 -1398
  79. package/dist/publishAuthorization-CG23g8w2.js.map +1 -0
  80. package/dist/{publishAuthorization-CxBkijU6.js → publishAuthorization-CvK_coYp.js} +1104 -1018
  81. package/dist/publishAuthorization-CvK_coYp.js.map +1 -0
  82. package/dist/{publishAuthorization-By2Tt9kW.js → publishAuthorization-DgDI4zor.js} +1162 -1063
  83. package/dist/publishAuthorization-DgDI4zor.js.map +1 -0
  84. package/dist/{publishThirdwebClient-CBD9sKJR.js → publishThirdwebClient-BQ_KnMi5.js} +2 -2
  85. package/dist/{publishThirdwebClient-CBD9sKJR.js.map → publishThirdwebClient-BQ_KnMi5.js.map} +1 -1
  86. package/dist/{publishThirdwebClient-BdgkcqM7.js → publishThirdwebClient-BmqsJCjp.js} +2 -2
  87. package/dist/{publishThirdwebClient-BdgkcqM7.js.map → publishThirdwebClient-BmqsJCjp.js.map} +1 -1
  88. package/dist/{publishThirdwebClient-BkmDN480.js → publishThirdwebClient-CO18ST7C.js} +2 -2
  89. package/dist/{publishThirdwebClient-BkmDN480.js.map → publishThirdwebClient-CO18ST7C.js.map} +1 -1
  90. package/dist/{publishThirdwebClient-BnDhP3N-.js → publishThirdwebClient-D-K2WEeM.js} +2 -2
  91. package/dist/{publishThirdwebClient-BnDhP3N-.js.map → publishThirdwebClient-D-K2WEeM.js.map} +1 -1
  92. package/dist/{resolveRevokeAccount-CehU81k6.js → resolveRevokeAccount-9-OzXVdp.js} +11 -11
  93. package/dist/{resolveRevokeAccount-B5iXpuRT.js.map → resolveRevokeAccount-9-OzXVdp.js.map} +1 -1
  94. package/dist/{resolveRevokeAccount-BEhKQBTm.js → resolveRevokeAccount-CXa5XlOv.js} +11 -11
  95. package/dist/{resolveRevokeAccount-B7ImSb4Y.js.map → resolveRevokeAccount-CXa5XlOv.js.map} +1 -1
  96. package/dist/{resolveRevokeAccount-CaIMuCee.js → resolveRevokeAccount-DsNod8ti.js} +11 -12
  97. package/dist/{resolveRevokeAccount-BtVG0xxc.js.map → resolveRevokeAccount-DsNod8ti.js.map} +1 -1
  98. package/dist/{resolveRevokeAccount-DHnxtEIj.js → resolveRevokeAccount-QgZ6YZuS.js} +11 -12
  99. package/dist/{resolveRevokeAccount-BM1j2l5Q.js.map → resolveRevokeAccount-QgZ6YZuS.js.map} +1 -1
  100. package/dist/services/publish/actors/checking.d.ts.map +1 -1
  101. package/dist/services/publish/actors/createAttestations.d.ts.map +1 -1
  102. package/dist/services/publish/actors/createAttestationsDirectToEas.d.ts.map +1 -1
  103. package/dist/services/publish/actors/multiPublishReceipt.d.ts +58 -0
  104. package/dist/services/publish/actors/multiPublishReceipt.d.ts.map +1 -0
  105. package/dist/services/publish/actors/persistSeedUid.d.ts.map +1 -1
  106. package/dist/services/publish/actors/recordMultiPublishReceipt.d.ts +45 -0
  107. package/dist/services/publish/actors/recordMultiPublishReceipt.d.ts.map +1 -0
  108. package/dist/services/publish/helpers/getPublishUploadData.d.ts.map +1 -1
  109. package/dist/services/publishCost/types.d.ts +3 -1
  110. package/dist/services/publishCost/types.d.ts.map +1 -1
  111. package/dist/services/publishManager/actions/publishDone.d.ts.map +1 -1
  112. package/dist/services/publishManager/actions/stopAll.d.ts.map +1 -1
  113. package/dist/services/publishManager/actions/stopPublish.d.ts.map +1 -1
  114. package/dist/services/publishManager/actors/restoreFromDb.d.ts.map +1 -1
  115. package/dist/services/publishManager/index.d.ts +3 -3
  116. package/dist/services/publishManager/index.d.ts.map +1 -1
  117. package/dist/services/publishManager/publishLocks.d.ts +22 -0
  118. package/dist/services/publishManager/publishLocks.d.ts.map +1 -0
  119. package/dist/services/revoke/revokeAttestations.d.ts.map +1 -1
  120. package/dist/thirdweb.d.ts +2 -1
  121. package/dist/thirdweb.d.ts.map +1 -1
  122. package/dist/thirdweb.js +147 -148
  123. package/dist/thirdweb.js.map +1 -1
  124. package/dist/{worker-2dUZSapK.js → worker-CJRUAOAn.js} +2 -2
  125. package/dist/{worker-2dUZSapK.js.map → worker-CJRUAOAn.js.map} +1 -1
  126. package/dist/{worker-B1PcFPLi.js → worker-CN7zg73B.js} +2 -2
  127. package/dist/{worker-B1PcFPLi.js.map → worker-CN7zg73B.js.map} +1 -1
  128. package/dist/{worker-BCG1r0AS.js → worker-FmHZbku5.js} +9 -6
  129. package/dist/{worker-BCG1r0AS.js.map → worker-FmHZbku5.js.map} +1 -1
  130. package/dist/{worker-B8gN5WTx.js → worker-qoGuo876.js} +2 -2
  131. package/dist/{worker-B8gN5WTx.js.map → worker-qoGuo876.js.map} +1 -1
  132. package/package.json +6 -6
  133. package/dist/chainConfig-3sSqEVQh.js +0 -1433
  134. package/dist/chainConfig-3sSqEVQh.js.map +0 -1
  135. package/dist/chainConfig-3wlYarAG.js.map +0 -1
  136. package/dist/chainConfig-BRcsMopd.js.map +0 -1
  137. package/dist/chainConfig-BYm5OXpk.js +0 -1433
  138. package/dist/chainConfig-BYm5OXpk.js.map +0 -1
  139. package/dist/chainConfig-CA1Hrrjg.js.map +0 -1
  140. package/dist/chainConfig-CYy0XJ0M.js.map +0 -1
  141. package/dist/chainConfig-CfVGYAsY.js +0 -1311
  142. package/dist/chainConfig-CfVGYAsY.js.map +0 -1
  143. package/dist/chainConfig-DDA4YmAB.js +0 -1424
  144. package/dist/chainConfig-DDA4YmAB.js.map +0 -1
  145. package/dist/config-BA9la8B6.js +0 -941
  146. package/dist/config-BA9la8B6.js.map +0 -1
  147. package/dist/config-BqguD2Tt.js +0 -806
  148. package/dist/config-BqguD2Tt.js.map +0 -1
  149. package/dist/config-CPBd5C_b.js +0 -1201
  150. package/dist/config-CPBd5C_b.js.map +0 -1
  151. package/dist/config-DkIapO94.js +0 -955
  152. package/dist/config-DkIapO94.js.map +0 -1
  153. package/dist/config-EQZZNH9H.js +0 -955
  154. package/dist/config-EQZZNH9H.js.map +0 -1
  155. package/dist/config-qjpaJcBA.js +0 -947
  156. package/dist/config-qjpaJcBA.js.map +0 -1
  157. package/dist/deploy-BJYwLfz-.js +0 -15
  158. package/dist/deploy-BJYwLfz-.js.map +0 -1
  159. package/dist/enrollPublishAutomation-DYQMoylY.js +0 -3422
  160. package/dist/enrollPublishAutomation-DYQMoylY.js.map +0 -1
  161. package/dist/ensureAutomationSessionKey-BMHLKfjj.js +0 -85
  162. package/dist/ensureAutomationSessionKey-BMHLKfjj.js.map +0 -1
  163. package/dist/ensureAutomationSessionKey-BZ9_3FMW.js +0 -86
  164. package/dist/ensureAutomationSessionKey-BZ9_3FMW.js.map +0 -1
  165. package/dist/ensureAutomationSessionKey-Bq0PaTYE.js +0 -84
  166. package/dist/ensureAutomationSessionKey-Bq0PaTYE.js.map +0 -1
  167. package/dist/ensureAutomationSessionKey-Bw74ZSGI.js +0 -85
  168. package/dist/ensureAutomationSessionKey-Bw74ZSGI.js.map +0 -1
  169. package/dist/ensureAutomationSessionKey-C8D7BFjU.js +0 -85
  170. package/dist/ensureAutomationSessionKey-C8D7BFjU.js.map +0 -1
  171. package/dist/ensureAutomationSessionKey-CClLVX2w.js +0 -85
  172. package/dist/ensureAutomationSessionKey-CClLVX2w.js.map +0 -1
  173. package/dist/ensureAutomationSessionKey-CNNN1jBQ.js +0 -85
  174. package/dist/ensureAutomationSessionKey-CNNN1jBQ.js.map +0 -1
  175. package/dist/ensureAutomationSessionKey-CeUbjcCl.js +0 -85
  176. package/dist/ensureAutomationSessionKey-CeUbjcCl.js.map +0 -1
  177. package/dist/ensureAutomationSessionKey-D8Gki6U6.js +0 -85
  178. package/dist/ensureAutomationSessionKey-D8Gki6U6.js.map +0 -1
  179. package/dist/ensureAutomationSessionKey-DEH7nwUc.js +0 -86
  180. package/dist/ensureAutomationSessionKey-DEH7nwUc.js.map +0 -1
  181. package/dist/ensureAutomationSessionKey-DKriW4Hr.js +0 -85
  182. package/dist/ensureAutomationSessionKey-DKriW4Hr.js.map +0 -1
  183. package/dist/ensureAutomationSessionKey-Dhvbii2M.js +0 -86
  184. package/dist/ensureAutomationSessionKey-Dhvbii2M.js.map +0 -1
  185. package/dist/ensureAutomationSessionKey-Dyfk8qVp.js +0 -85
  186. package/dist/ensureAutomationSessionKey-Dyfk8qVp.js.map +0 -1
  187. package/dist/ensureModularPublishBootstrap-5HJDqJJM.js +0 -24
  188. package/dist/ensureModularPublishBootstrap-Bsw1xSCt.js +0 -24
  189. package/dist/ensureModularPublishBootstrap-Btih5xbB.js +0 -129
  190. package/dist/ensureModularPublishBootstrap-Btih5xbB.js.map +0 -1
  191. package/dist/ensureModularPublishBootstrap-C8wdnH1P.js +0 -128
  192. package/dist/ensureModularPublishBootstrap-C8wdnH1P.js.map +0 -1
  193. package/dist/ensureModularPublishBootstrap-CI4U08Gc.js +0 -129
  194. package/dist/ensureModularPublishBootstrap-CI4U08Gc.js.map +0 -1
  195. package/dist/ensureModularPublishBootstrap-CcU-hXll.js +0 -128
  196. package/dist/ensureModularPublishBootstrap-CcU-hXll.js.map +0 -1
  197. package/dist/ensureModularPublishBootstrap-CdrykHAi.js +0 -24
  198. package/dist/ensureModularPublishBootstrap-CdrykHAi.js.map +0 -1
  199. package/dist/ensureModularPublishBootstrap-DGBKVGg5.js.map +0 -1
  200. package/dist/ensureModularPublishBootstrap-DaREOqSc.js +0 -129
  201. package/dist/ensureModularPublishBootstrap-DaREOqSc.js.map +0 -1
  202. package/dist/ensureModularPublishBootstrap-DxIG-LUP.js.map +0 -1
  203. package/dist/ensureModularPublishBootstrap-Jm1AAqBo.js +0 -127
  204. package/dist/ensureModularPublishBootstrap-Jm1AAqBo.js.map +0 -1
  205. package/dist/ensureSessionKey-D2Lq-56x.js +0 -363
  206. package/dist/ensureSessionKey-D2Lq-56x.js.map +0 -1
  207. package/dist/ensureSmartWalletThenPublish-BFPugsKJ.js +0 -48
  208. package/dist/ensureSmartWalletThenPublish-BFPugsKJ.js.map +0 -1
  209. package/dist/ensureSmartWalletThenPublish-BSYzckyS.js +0 -49
  210. package/dist/ensureSmartWalletThenPublish-BSYzckyS.js.map +0 -1
  211. package/dist/ensureSmartWalletThenPublish-Bf8FN1un.js +0 -49
  212. package/dist/ensureSmartWalletThenPublish-Bf8FN1un.js.map +0 -1
  213. package/dist/ensureSmartWalletThenPublish-Bl415Ss6.js +0 -48
  214. package/dist/ensureSmartWalletThenPublish-Bmm5Fpat.js +0 -49
  215. package/dist/ensureSmartWalletThenPublish-Bmm5Fpat.js.map +0 -1
  216. package/dist/ensureSmartWalletThenPublish-CE7acryB.js +0 -49
  217. package/dist/ensureSmartWalletThenPublish-CE7acryB.js.map +0 -1
  218. package/dist/ensureSmartWalletThenPublish-DaZf3q5S.js +0 -48
  219. package/dist/ensureSmartWalletThenPublish-DaZf3q5S.js.map +0 -1
  220. package/dist/ensureSmartWalletThenPublish-Dta2AOyJ.js.map +0 -1
  221. package/dist/ensureSmartWalletThenPublish-ekb0xJRn.js +0 -48
  222. package/dist/ensureSmartWalletThenPublish-ekb0xJRn.js.map +0 -1
  223. package/dist/ensureSmartWalletThenPublish-v5fhvKxZ.js +0 -48
  224. package/dist/ensureSmartWalletThenPublish-v5fhvKxZ.js.map +0 -1
  225. package/dist/errors-Du3LNbJN.js +0 -70
  226. package/dist/errors-Du3LNbJN.js.map +0 -1
  227. package/dist/errors-PZAaDlkq.js +0 -79
  228. package/dist/errors-PZAaDlkq.js.map +0 -1
  229. package/dist/helpers/adapters/managedAccountTxSender.d.ts +0 -21
  230. package/dist/helpers/adapters/managedAccountTxSender.d.ts.map +0 -1
  231. package/dist/helpers/modularAccount/abi.d.ts +0 -173
  232. package/dist/helpers/modularAccount/abi.d.ts.map +0 -1
  233. package/dist/helpers/modularAccount/deploy.d.ts +0 -13
  234. package/dist/helpers/modularAccount/deploy.d.ts.map +0 -1
  235. package/dist/helpers/modularAccount/eip712.d.ts +0 -30
  236. package/dist/helpers/modularAccount/eip712.d.ts.map +0 -1
  237. package/dist/helpers/modularAccount/encode.d.ts +0 -16
  238. package/dist/helpers/modularAccount/encode.d.ts.map +0 -1
  239. package/dist/helpers/modularAccount/ensureModule.d.ts +0 -10
  240. package/dist/helpers/modularAccount/ensureModule.d.ts.map +0 -1
  241. package/dist/helpers/modularAccount/ensureSessionKey.d.ts +0 -25
  242. package/dist/helpers/modularAccount/ensureSessionKey.d.ts.map +0 -1
  243. package/dist/helpers/modularAccount/index.d.ts +0 -9
  244. package/dist/helpers/modularAccount/index.d.ts.map +0 -1
  245. package/dist/helpers/modularAccount/permissions.d.ts +0 -32
  246. package/dist/helpers/modularAccount/permissions.d.ts.map +0 -1
  247. package/dist/helpers/modularAccount/reads.d.ts +0 -28
  248. package/dist/helpers/modularAccount/reads.d.ts.map +0 -1
  249. package/dist/helpers/thirdwebEnrollPublishAutomation.d.ts +0 -31
  250. package/dist/helpers/thirdwebEnrollPublishAutomation.d.ts.map +0 -1
  251. package/dist/helpers/thirdwebModularBootstrap.d.ts +0 -8
  252. package/dist/helpers/thirdwebModularBootstrap.d.ts.map +0 -1
  253. package/dist/helpers/transformPayloadToIntegerIds.d.ts +0 -34
  254. package/dist/helpers/transformPayloadToIntegerIds.d.ts.map +0 -1
  255. package/dist/managedAccountAdmin-BVLGWpEb.js +0 -29
  256. package/dist/managedAccountAdmin-DJMw6UH6.js +0 -29
  257. package/dist/managedAccountAdmin-DJMw6UH6.js.map +0 -1
  258. package/dist/managedAccountAdmin-DhCRBoPX.js +0 -29
  259. package/dist/managedAccountAdmin-DhCRBoPX.js.map +0 -1
  260. package/dist/managedAccountAdmin-NXD66lP5.js +0 -29
  261. package/dist/managedAccountAdmin-NXD66lP5.js.map +0 -1
  262. package/dist/publishAuthorization-B0G1em4a.js +0 -3695
  263. package/dist/publishAuthorization-B0G1em4a.js.map +0 -1
  264. package/dist/publishAuthorization-B1BVVfp0.js +0 -3604
  265. package/dist/publishAuthorization-B1BVVfp0.js.map +0 -1
  266. package/dist/publishAuthorization-BEqRnP2h.js.map +0 -1
  267. package/dist/publishAuthorization-Bltn3y_K.js +0 -3599
  268. package/dist/publishAuthorization-Bltn3y_K.js.map +0 -1
  269. package/dist/publishAuthorization-By2Tt9kW.js.map +0 -1
  270. package/dist/publishAuthorization-CSN2FsQk.js +0 -3479
  271. package/dist/publishAuthorization-CSN2FsQk.js.map +0 -1
  272. package/dist/publishAuthorization-CxBkijU6.js.map +0 -1
  273. package/dist/publishAuthorization-CxWY7lAQ.js +0 -3706
  274. package/dist/publishAuthorization-CxWY7lAQ.js.map +0 -1
  275. package/dist/publishAuthorization-DEriY_jm.js +0 -3687
  276. package/dist/publishAuthorization-DEriY_jm.js.map +0 -1
  277. package/dist/publishAuthorization-DfAQs1sN.js +0 -3707
  278. package/dist/publishAuthorization-DfAQs1sN.js.map +0 -1
  279. package/dist/publishAuthorization-DgdmgLTa.js +0 -3520
  280. package/dist/publishAuthorization-DgdmgLTa.js.map +0 -1
  281. package/dist/publishAuthorization-DjVrnMC0.js.map +0 -1
  282. package/dist/publishAuthorization-DqhhCAhd.js +0 -3652
  283. package/dist/publishAuthorization-DqhhCAhd.js.map +0 -1
  284. package/dist/publishThirdwebClient-CQ29pzG2.js +0 -18
  285. package/dist/publishThirdwebClient-CQ29pzG2.js.map +0 -1
  286. package/dist/publishThirdwebClient-CZIVmr9Z.js +0 -18
  287. package/dist/publishThirdwebClient-CZIVmr9Z.js.map +0 -1
  288. package/dist/publishThirdwebClient-Ce7iBIsj.js +0 -18
  289. package/dist/publishThirdwebClient-Ce7iBIsj.js.map +0 -1
  290. package/dist/publishThirdwebClient-DroRrOFQ.js +0 -18
  291. package/dist/publishThirdwebClient-DroRrOFQ.js.map +0 -1
  292. package/dist/publishThirdwebClient-DzXFjQ7L.js +0 -18
  293. package/dist/publishThirdwebClient-DzXFjQ7L.js.map +0 -1
  294. package/dist/publishThirdwebClient-Dzb2vcEs.js +0 -18
  295. package/dist/publishThirdwebClient-Dzb2vcEs.js.map +0 -1
  296. package/dist/publishThirdwebClient-i8P7fivi.js +0 -18
  297. package/dist/publishThirdwebClient-i8P7fivi.js.map +0 -1
  298. package/dist/publishWalletRegistry-Cugh691z.js +0 -37
  299. package/dist/publishWalletRegistry-Cugh691z.js.map +0 -1
  300. package/dist/resolveRevokeAccount-B5iXpuRT.js +0 -38
  301. package/dist/resolveRevokeAccount-B7ImSb4Y.js +0 -38
  302. package/dist/resolveRevokeAccount-BEhKQBTm.js.map +0 -1
  303. package/dist/resolveRevokeAccount-BM1j2l5Q.js +0 -38
  304. package/dist/resolveRevokeAccount-BtVG0xxc.js +0 -38
  305. package/dist/resolveRevokeAccount-CJZZdBcQ.js +0 -39
  306. package/dist/resolveRevokeAccount-CJZZdBcQ.js.map +0 -1
  307. package/dist/resolveRevokeAccount-CaIMuCee.js.map +0 -1
  308. package/dist/resolveRevokeAccount-CehU81k6.js.map +0 -1
  309. package/dist/resolveRevokeAccount-Cg4TQgnd.js +0 -38
  310. package/dist/resolveRevokeAccount-Cg4TQgnd.js.map +0 -1
  311. package/dist/resolveRevokeAccount-DHnxtEIj.js.map +0 -1
  312. package/dist/resolveRevokeAccount-DJKfLlyK.js +0 -38
  313. package/dist/resolveRevokeAccount-DJKfLlyK.js.map +0 -1
  314. package/dist/resolveRevokeAccount-S-2WXkNh.js +0 -38
  315. package/dist/resolveRevokeAccount-S-2WXkNh.js.map +0 -1
  316. package/dist/resolveRevokeAccount-mzR11KJ4.js +0 -38
  317. package/dist/resolveRevokeAccount-mzR11KJ4.js.map +0 -1
  318. package/dist/resolveRevokeAccount-yWARIv9i.js +0 -38
  319. package/dist/resolveRevokeAccount-yWARIv9i.js.map +0 -1
  320. package/dist/seedSigner-CFzMD7Rb.js +0 -66
  321. package/dist/seedSigner-CFzMD7Rb.js.map +0 -1
  322. package/dist/thirdweb-BoksPRz3.js +0 -194
  323. package/dist/thirdweb-BoksPRz3.js.map +0 -1
  324. package/dist/thirdwebAccount-C2iOcp4_.js +0 -59
  325. package/dist/thirdwebAccount-C2iOcp4_.js.map +0 -1
  326. package/dist/worker-BgErCNTb.js +0 -69
  327. package/dist/worker-BgErCNTb.js.map +0 -1
  328. package/dist/worker-C07rPV2G.js +0 -69
  329. package/dist/worker-C07rPV2G.js.map +0 -1
  330. package/dist/worker-C9Za_dlQ.js +0 -69
  331. package/dist/worker-C9Za_dlQ.js.map +0 -1
  332. package/dist/worker-CEgulQnm.js +0 -69
  333. package/dist/worker-CEgulQnm.js.map +0 -1
  334. package/dist/worker-C_TL94He.js +0 -69
  335. package/dist/worker-C_TL94He.js.map +0 -1
  336. package/dist/worker-CbtzcKG6.js +0 -69
  337. package/dist/worker-CbtzcKG6.js.map +0 -1
  338. package/dist/worker-DBC_g-3I.js +0 -69
  339. package/dist/worker-DBC_g-3I.js.map +0 -1
  340. package/dist/worker-DHUm-TeQ.js +0 -69
  341. package/dist/worker-DHUm-TeQ.js.map +0 -1
  342. package/dist/worker-DypHzXgH.js +0 -69
  343. package/dist/worker-DypHzXgH.js.map +0 -1
  344. package/dist/worker-ZL4Wg19t.js +0 -69
  345. package/dist/worker-ZL4Wg19t.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureAutomationSessionKey-DwRm4YMJ.js","names":[],"sources":["../src/helpers/ensureAutomationSessionKey.ts"],"sourcesContent":["import { getContract, sendTransaction } from 'thirdweb'\nimport {\n addSessionKey,\n removeSessionKey,\n shouldUpdateSessionKey,\n} from 'thirdweb/extensions/erc4337'\nimport type { Address } from 'viem'\nimport { ManagedAccountPublishError } from '../errors'\nimport { isContractDeployed, readUntil, waitForPublishReceipt } from './chainClient'\nimport { readIsActiveSigner } from './contracts'\nimport {\n buildAutomationSessionKeyPermissions,\n toThirdwebSessionKeyPermissions,\n} from './automationSessionKeyPermissions'\nimport { getClient, getManagedAccountWallet } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nconst MSG_UNAVAILABLE = () =>\n `Could not connect the managed publishing account to authorize an automation session key on ${getPublishChainName()}. Reconnect and try again.`\nconst MSG_ACTIVATION_FAILED = () =>\n `Could not authorize the automation session key on your publishing account on ${getPublishChainName()}.`\nconst MSG_REMOVAL_FAILED = () =>\n `Could not remove the automation session key from your publishing account on ${getPublishChainName()}.`\n\nasync function getManagedAccountForSessionKeyAdmin(managedAddress: string) {\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n MSG_UNAVAILABLE(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n )\n }\n return managedAccount\n}\n\n/**\n * Ensures `sessionKeyAddress` is an active automation session signer on the ManagedAccount\n * with **executor-module-only** approved targets. Signed by the managed EIP-4337 wallet (user).\n */\nexport async function ensureAutomationSessionKey(params: {\n managedAddress: string\n sessionKeyAddress: string\n /** Unix seconds end time for the session key (optional). */\n expiresAt?: number\n}): Promise<void> {\n const { managedAddress, sessionKeyAddress, expiresAt } = params\n const managedAccount = await getManagedAccountForSessionKeyAdmin(managedAddress)\n\n const accountContract = getContract({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n address: managedAddress,\n })\n const permissions = toThirdwebSessionKeyPermissions(\n buildAutomationSessionKeyPermissions({ expiresAt }),\n )\n\n let shouldUpdate = false\n try {\n shouldUpdate = await shouldUpdateSessionKey({\n accountContract,\n sessionKeyAddress,\n newPermissions: permissions,\n })\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n\n if (shouldUpdate) {\n try {\n const tx = addSessionKey({\n contract: accountContract,\n account: managedAccount,\n sessionKeyAddress,\n permissions,\n })\n const result = await sendTransaction({ account: managedAccount, transaction: tx })\n await waitForPublishReceipt(result.transactionHash as `0x${string}`)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n }\n\n // Right after addSessionKey, a lagging RPC node can still report the key inactive.\n const active = await readUntil(\n () => isAutomationSessionActive(managedAddress, sessionKeyAddress),\n Boolean,\n { attempts: shouldUpdate ? 5 : 1 },\n )\n if (!active) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n )\n }\n}\n\n/**\n * Removes an automation session key from the ManagedAccount (user-signed via managed wallet).\n */\nexport async function removeAutomationSessionKey(params: {\n managedAddress: string\n sessionKeyAddress: string\n}): Promise<void> {\n const { managedAddress, sessionKeyAddress } = params\n const managedAccount = await getManagedAccountForSessionKeyAdmin(managedAddress)\n\n const accountContract = getContract({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n address: managedAddress,\n })\n\n try {\n const tx = removeSessionKey({\n contract: accountContract,\n account: managedAccount,\n sessionKeyAddress,\n })\n const result = await sendTransaction({ account: managedAccount, transaction: tx })\n await waitForPublishReceipt(result.transactionHash as `0x${string}`)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_REMOVAL_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n}\n\n/**\n * True when `sessionKeyAddress` is an active signer on the ManagedAccount.\n * Returns `false` when the ManagedAccount has no bytecode (undeployed ≠ unauthorized).\n * Throws when bytecode or `isActiveSigner` cannot be read on a live account (RPC / decode),\n * so unattended automation does not silently fall through to in-app bootstrap.\n */\nexport async function isAutomationSessionActive(\n managedAddress: string,\n sessionKeyAddress: string,\n): Promise<boolean> {\n try {\n if (!(await isContractDeployed(managedAddress))) {\n return false\n }\n return await readIsActiveSigner(\n managedAddress as Address,\n sessionKeyAddress as Address,\n )\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n}\n"],"mappings":";;;;;;;;;;;IAkBM,UACJ,8FAA8F,EAAoB,EAAE,6BAChH,UACJ,gFAAgF,EAAoB,EAAE,IAClG,UACJ,+EAA+E,EAAoB,EAAE;AAEvG,eAAe,EAAoC,GAAwB;CACzE,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,EAAgB,GAChB,oCACA,CACF;CAEF,OAAO;AACT;AAMA,eAAsB,EAA2B,GAK/B;CAChB,IAAM,EAAE,mBAAgB,sBAAmB,iBAAc,GACnD,IAAiB,MAAM,EAAoC,CAAc,GAEzE,IAAkB,EAAY;EAClC,QAAQ,EAAU;EAClB,OAAO,EAAwB;EAC/B,SAAS;CACX,CAAC,GACK,IAAc,EAClB,EAAqC,EAAE,aAAU,CAAC,CACpD,GAEI,IAAe;CACnB,IAAI;EACF,IAAe,MAAM,EAAuB;GAC1C;GACA;GACA,gBAAgB;EAClB,CAAC;CACH,SAAS,GAAO;EACd,MAAM,IAAI,EACR,EAAsB,GACtB,oCACA,GACA,CACF;CACF;CAEA,IAAI,GACF,IAAI;EACF,IAAM,IAAK,EAAc;GACvB,UAAU;GACV,SAAS;GACT;GACA;EACF,CAAC,GACK,IAAS,MAAM,EAAgB;GAAE,SAAS;GAAgB,aAAa;EAAG,CAAC;EACjF,MAAM,EAAsB,EAAO,eAAgC;CACrE,SAAS,GAAO;EACd,MAAM,IAAI,EACR,EAAsB,GACtB,oCACA,GACA,CACF;CACF;CASF,IAAI,CAAC,MALgB,QACb,EAA0B,GAAgB,CAAiB,GACjE,SACA,EAAE,UAAU,IAAe,IAAI,EAAE,CACnC,GAEE,MAAM,IAAI,EACR,EAAsB,GACtB,oCACA,CACF;AAEJ;AAKA,eAAsB,EAA2B,GAG/B;CAChB,IAAM,EAAE,mBAAgB,yBAAsB,GACxC,IAAiB,MAAM,EAAoC,CAAc,GAEzE,IAAkB,EAAY;EAClC,QAAQ,EAAU;EAClB,OAAO,EAAwB;EAC/B,SAAS;CACX,CAAC;CAED,IAAI;EACF,IAAM,IAAK,EAAiB;GAC1B,UAAU;GACV,SAAS;GACT;EACF,CAAC,GACK,IAAS,MAAM,EAAgB;GAAE,SAAS;GAAgB,aAAa;EAAG,CAAC;EACjF,MAAM,EAAsB,EAAO,eAAgC;CACrE,SAAS,GAAO;EACd,MAAM,IAAI,EACR,EAAmB,GACnB,oCACA,GACA,CACF;CACF;AACF;AAQA,eAAsB,EACpB,GACA,GACkB;CAClB,IAAI;EAIF,OAHM,MAAM,EAAmB,CAAc,IAGtC,MAAM,EACX,GACA,CACF,IALS;CAMX,SAAS,GAAO;EACd,MAAM,IAAI,EACR,EAAsB,GACtB,oCACA,GACA,CACF;CACF;AACF"}
@@ -0,0 +1,84 @@
1
+ import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
+ import { ct as t, dt as n, mt as r, t as i, tt as a, ut as o, y as s } from "./chainConfig-DWzoOtkS.js";
3
+ import { M as c, d as l, p as u } from "./publishAuthorization-DgDI4zor.js";
4
+ import { t as d } from "./publishThirdwebClient-CO18ST7C.js";
5
+ import { getContract as f, sendTransaction as p } from "thirdweb";
6
+ import { addSessionKey as m, removeSessionKey as h, shouldUpdateSessionKey as g } from "thirdweb/extensions/erc4337";
7
+ //#region src/helpers/ensureAutomationSessionKey.ts
8
+ var _ = /* @__PURE__ */ e({
9
+ ensureAutomationSessionKey: () => S,
10
+ isAutomationSessionActive: () => w,
11
+ removeAutomationSessionKey: () => C
12
+ }), v = () => `Could not connect the managed publishing account to authorize an automation session key on ${i()}. Reconnect and try again.`, y = () => `Could not authorize the automation session key on your publishing account on ${i()}.`, b = () => `Could not remove the automation session key from your publishing account on ${i()}.`;
13
+ async function x(e) {
14
+ let t = c();
15
+ await t.autoConnect({
16
+ client: d(),
17
+ chain: s()
18
+ });
19
+ let n = t.getAccount();
20
+ if (!n) throw new r(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", e);
21
+ return n;
22
+ }
23
+ async function S(e) {
24
+ let { managedAddress: t, sessionKeyAddress: i, expiresAt: a } = e, c = await x(t), h = f({
25
+ client: d(),
26
+ chain: s(),
27
+ address: t
28
+ }), _ = u(l({ expiresAt: a })), v = !1;
29
+ try {
30
+ v = await g({
31
+ accountContract: h,
32
+ sessionKeyAddress: i,
33
+ newPermissions: _
34
+ });
35
+ } catch (e) {
36
+ throw new r(y(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
37
+ }
38
+ if (v) try {
39
+ let e = m({
40
+ contract: h,
41
+ account: c,
42
+ sessionKeyAddress: i,
43
+ permissions: _
44
+ }), t = await p({
45
+ account: c,
46
+ transaction: e
47
+ });
48
+ await n(t.transactionHash);
49
+ } catch (e) {
50
+ throw new r(y(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
51
+ }
52
+ if (!await o(() => w(t, i), Boolean, { attempts: v ? 5 : 1 })) throw new r(y(), "MODULAR_SIGNER_ACTIVATION_FAILED", t);
53
+ }
54
+ async function C(e) {
55
+ let { managedAddress: t, sessionKeyAddress: i } = e, a = await x(t), o = f({
56
+ client: d(),
57
+ chain: s(),
58
+ address: t
59
+ });
60
+ try {
61
+ let e = h({
62
+ contract: o,
63
+ account: a,
64
+ sessionKeyAddress: i
65
+ }), t = await p({
66
+ account: a,
67
+ transaction: e
68
+ });
69
+ await n(t.transactionHash);
70
+ } catch (e) {
71
+ throw new r(b(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
72
+ }
73
+ }
74
+ async function w(e, n) {
75
+ try {
76
+ return await t(e) ? await a(e, n) : !1;
77
+ } catch (t) {
78
+ throw new r(y(), "MODULAR_SIGNER_ACTIVATION_FAILED", e, t);
79
+ }
80
+ }
81
+ //#endregion
82
+ export { C as i, _ as n, w as r, S as t };
83
+
84
+ //# sourceMappingURL=ensureAutomationSessionKey-h3zOmDr5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ensureAutomationSessionKey-h3zOmDr5.js","names":[],"sources":["../src/helpers/ensureAutomationSessionKey.ts"],"sourcesContent":["import { getContract, sendTransaction } from 'thirdweb'\nimport {\n addSessionKey,\n removeSessionKey,\n shouldUpdateSessionKey,\n} from 'thirdweb/extensions/erc4337'\nimport type { Address } from 'viem'\nimport { ManagedAccountPublishError } from '../errors'\nimport { isContractDeployed, readUntil, waitForPublishReceipt } from './chainClient'\nimport { readIsActiveSigner } from './contracts'\nimport {\n buildAutomationSessionKeyPermissions,\n toThirdwebSessionKeyPermissions,\n} from './automationSessionKeyPermissions'\nimport { getClient, getManagedAccountWallet } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nconst MSG_UNAVAILABLE = () =>\n `Could not connect the managed publishing account to authorize an automation session key on ${getPublishChainName()}. Reconnect and try again.`\nconst MSG_ACTIVATION_FAILED = () =>\n `Could not authorize the automation session key on your publishing account on ${getPublishChainName()}.`\nconst MSG_REMOVAL_FAILED = () =>\n `Could not remove the automation session key from your publishing account on ${getPublishChainName()}.`\n\nasync function getManagedAccountForSessionKeyAdmin(managedAddress: string) {\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n MSG_UNAVAILABLE(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n )\n }\n return managedAccount\n}\n\n/**\n * Ensures `sessionKeyAddress` is an active automation session signer on the ManagedAccount\n * with **executor-module-only** approved targets. Signed by the managed EIP-4337 wallet (user).\n */\nexport async function ensureAutomationSessionKey(params: {\n managedAddress: string\n sessionKeyAddress: string\n /** Unix seconds end time for the session key (optional). */\n expiresAt?: number\n}): Promise<void> {\n const { managedAddress, sessionKeyAddress, expiresAt } = params\n const managedAccount = await getManagedAccountForSessionKeyAdmin(managedAddress)\n\n const accountContract = getContract({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n address: managedAddress,\n })\n const permissions = toThirdwebSessionKeyPermissions(\n buildAutomationSessionKeyPermissions({ expiresAt }),\n )\n\n let shouldUpdate = false\n try {\n shouldUpdate = await shouldUpdateSessionKey({\n accountContract,\n sessionKeyAddress,\n newPermissions: permissions,\n })\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n\n if (shouldUpdate) {\n try {\n const tx = addSessionKey({\n contract: accountContract,\n account: managedAccount,\n sessionKeyAddress,\n permissions,\n })\n const result = await sendTransaction({ account: managedAccount, transaction: tx })\n await waitForPublishReceipt(result.transactionHash as `0x${string}`)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n }\n\n // Right after addSessionKey, a lagging RPC node can still report the key inactive.\n const active = await readUntil(\n () => isAutomationSessionActive(managedAddress, sessionKeyAddress),\n Boolean,\n { attempts: shouldUpdate ? 5 : 1 },\n )\n if (!active) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n )\n }\n}\n\n/**\n * Removes an automation session key from the ManagedAccount (user-signed via managed wallet).\n */\nexport async function removeAutomationSessionKey(params: {\n managedAddress: string\n sessionKeyAddress: string\n}): Promise<void> {\n const { managedAddress, sessionKeyAddress } = params\n const managedAccount = await getManagedAccountForSessionKeyAdmin(managedAddress)\n\n const accountContract = getContract({\n client: getClient(),\n chain: getPublishThirdwebChain(),\n address: managedAddress,\n })\n\n try {\n const tx = removeSessionKey({\n contract: accountContract,\n account: managedAccount,\n sessionKeyAddress,\n })\n const result = await sendTransaction({ account: managedAccount, transaction: tx })\n await waitForPublishReceipt(result.transactionHash as `0x${string}`)\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_REMOVAL_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n}\n\n/**\n * True when `sessionKeyAddress` is an active signer on the ManagedAccount.\n * Returns `false` when the ManagedAccount has no bytecode (undeployed ≠ unauthorized).\n * Throws when bytecode or `isActiveSigner` cannot be read on a live account (RPC / decode),\n * so unattended automation does not silently fall through to in-app bootstrap.\n */\nexport async function isAutomationSessionActive(\n managedAddress: string,\n sessionKeyAddress: string,\n): Promise<boolean> {\n try {\n if (!(await isContractDeployed(managedAddress))) {\n return false\n }\n return await readIsActiveSigner(\n managedAddress as Address,\n sessionKeyAddress as Address,\n )\n } catch (cause) {\n throw new ManagedAccountPublishError(\n MSG_ACTIVATION_FAILED(),\n 'MODULAR_SIGNER_ACTIVATION_FAILED',\n managedAddress,\n cause,\n )\n }\n}\n"],"mappings":";;;;;;;;;;;IAkBM,UACJ,8FAA8F,EAAoB,EAAE,6BAChH,UACJ,gFAAgF,EAAoB,EAAE,IAClG,UACJ,+EAA+E,EAAoB,EAAE;AAEvG,eAAe,EAAoC,GAAwB;CACzE,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,EAAgB,GAChB,oCACA,CACF;CAEF,OAAO;AACT;AAMA,eAAsB,EAA2B,GAK/B;CAChB,IAAM,EAAE,mBAAgB,sBAAmB,iBAAc,GACnD,IAAiB,MAAM,EAAoC,CAAc,GAEzE,IAAkB,EAAY;EAClC,QAAQ,EAAU;EAClB,OAAO,EAAwB;EAC/B,SAAS;CACX,CAAC,GACK,IAAc,EAClB,EAAqC,EAAE,aAAU,CAAC,CACpD,GAEI,IAAe;CACnB,IAAI;EACF,IAAe,MAAM,EAAuB;GAC1C;GACA;GACA,gBAAgB;EAClB,CAAC;CACH,SAAS,GAAO;EACd,MAAM,IAAI,EACR,EAAsB,GACtB,oCACA,GACA,CACF;CACF;CAEA,IAAI,GACF,IAAI;EACF,IAAM,IAAK,EAAc;GACvB,UAAU;GACV,SAAS;GACT;GACA;EACF,CAAC,GACK,IAAS,MAAM,EAAgB;GAAE,SAAS;GAAgB,aAAa;EAAG,CAAC;EACjF,MAAM,EAAsB,EAAO,eAAgC;CACrE,SAAS,GAAO;EACd,MAAM,IAAI,EACR,EAAsB,GACtB,oCACA,GACA,CACF;CACF;CASF,IAAI,CAAC,MALgB,QACb,EAA0B,GAAgB,CAAiB,GACjE,SACA,EAAE,UAAU,IAAe,IAAI,EAAE,CACnC,GAEE,MAAM,IAAI,EACR,EAAsB,GACtB,oCACA,CACF;AAEJ;AAKA,eAAsB,EAA2B,GAG/B;CAChB,IAAM,EAAE,mBAAgB,yBAAsB,GACxC,IAAiB,MAAM,EAAoC,CAAc,GAEzE,IAAkB,EAAY;EAClC,QAAQ,EAAU;EAClB,OAAO,EAAwB;EAC/B,SAAS;CACX,CAAC;CAED,IAAI;EACF,IAAM,IAAK,EAAiB;GAC1B,UAAU;GACV,SAAS;GACT;EACF,CAAC,GACK,IAAS,MAAM,EAAgB;GAAE,SAAS;GAAgB,aAAa;EAAG,CAAC;EACjF,MAAM,EAAsB,EAAO,eAAgC;CACrE,SAAS,GAAO;EACd,MAAM,IAAI,EACR,EAAmB,GACnB,oCACA,GACA,CACF;CACF;AACF;AAQA,eAAsB,EACpB,GACA,GACkB;CAClB,IAAI;EAIF,OAHM,MAAM,EAAmB,CAAc,IAGtC,MAAM,EACX,GACA,CACF,IALS;CAMX,SAAS,GAAO;EACd,MAAM,IAAI,EACR,EAAsB,GACtB,oCACA,GACA,CACF;CACF;AACF"}
@@ -1,9 +1,8 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { _ as t, h as n, t as r } from "./chainConfig-3wlYarAG.js";
3
- import { r as i } from "./errors-Du3LNbJN.js";
4
- import { B as a, M as o, v as s } from "./publishAuthorization-DfAQs1sN.js";
5
- import { t as c } from "./publishThirdwebClient-i8P7fivi.js";
6
- import { t as l } from "./managedAccountAdmin-Bje6X8Ds.js";
2
+ import { h as t, mt as n, t as r, y as i } from "./chainConfig-DWzoOtkS.js";
3
+ import { B as a, M as o, v as s } from "./publishAuthorization-DgDI4zor.js";
4
+ import { t as c } from "./publishThirdwebClient-CO18ST7C.js";
5
+ import { t as l } from "./managedAccountAdmin-B4HkLWWE.js";
7
6
  //#region src/helpers/ensureModularPublishBootstrap.ts
8
7
  var u = /* @__PURE__ */ e({ ensureModularPublishBootstrap: () => d });
9
8
  async function d(e) {
@@ -11,14 +10,14 @@ async function d(e) {
11
10
  let u = o();
12
11
  await u.autoConnect({
13
12
  client: c(),
14
- chain: t()
13
+ chain: i()
15
14
  });
16
15
  let d = u.getAccount();
17
- if (!d) throw new i(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
- if (d.address.toLowerCase() !== e.toLowerCase()) throw new i(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
19
- return await s(e, async () => n(await l(e))), d;
16
+ if (!d) throw new n(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
17
+ if (d.address.toLowerCase() !== e.toLowerCase()) throw new n(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
+ return await s(e, async () => t(await l(e))), d;
20
19
  }
21
20
  //#endregion
22
21
  export { u as n, d as t };
23
22
 
24
- //# sourceMappingURL=ensureModularPublishBootstrap-DGBKVGg5.js.map
23
+ //# sourceMappingURL=ensureModularPublishBootstrap-BImiIFJe.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensureModularPublishBootstrap-5HJDqJJM.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
1
+ {"version":3,"file":"ensureModularPublishBootstrap-BImiIFJe.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
@@ -1,9 +1,8 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { _ as t, h as n, t as r } from "./chainConfig-BRcsMopd.js";
3
- import { r as i } from "./errors-Du3LNbJN.js";
4
- import { B as a, M as o, v as s } from "./publishAuthorization-CxWY7lAQ.js";
5
- import { t as c } from "./publishThirdwebClient-Dzb2vcEs.js";
6
- import { t as l } from "./managedAccountAdmin-BVLGWpEb.js";
2
+ import { h as t, mt as n, t as r, y as i } from "./chainConfig-DmuPBs3D.js";
3
+ import { B as a, M as o, v as s } from "./publishAuthorization-CG23g8w2.js";
4
+ import { t as c } from "./publishThirdwebClient-BQ_KnMi5.js";
5
+ import { t as l } from "./managedAccountAdmin-DwFI-ZfE.js";
7
6
  //#region src/helpers/ensureModularPublishBootstrap.ts
8
7
  var u = /* @__PURE__ */ e({ ensureModularPublishBootstrap: () => d });
9
8
  async function d(e) {
@@ -11,14 +10,14 @@ async function d(e) {
11
10
  let u = o();
12
11
  await u.autoConnect({
13
12
  client: c(),
14
- chain: t()
13
+ chain: i()
15
14
  });
16
15
  let d = u.getAccount();
17
- if (!d) throw new i(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
- if (d.address.toLowerCase() !== e.toLowerCase()) throw new i(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
19
- return await s(e, async () => n(await l(e))), d;
16
+ if (!d) throw new n(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
17
+ if (d.address.toLowerCase() !== e.toLowerCase()) throw new n(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
+ return await s(e, async () => t(await l(e))), d;
20
19
  }
21
20
  //#endregion
22
21
  export { u as n, d as t };
23
22
 
24
- //# sourceMappingURL=ensureModularPublishBootstrap-DxIG-LUP.js.map
23
+ //# sourceMappingURL=ensureModularPublishBootstrap-CmxyX_EN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensureModularPublishBootstrap-BW8jKN_A.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
1
+ {"version":3,"file":"ensureModularPublishBootstrap-CmxyX_EN.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
@@ -1,9 +1,8 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { _ as t, h as n, t as r } from "./chainConfig-BYm5OXpk.js";
3
- import { r as i } from "./errors-Du3LNbJN.js";
4
- import { B as a, M as o, v as s } from "./publishAuthorization-CxBkijU6.js";
5
- import { t as c } from "./publishThirdwebClient-BnDhP3N-.js";
6
- import { t as l } from "./managedAccountAdmin-B64V1rlU.js";
2
+ import { h as t, mt as n, t as r, y as i } from "./chainConfig-BJ8C_RRz.js";
3
+ import { B as a, M as o, v as s } from "./publishAuthorization-CvK_coYp.js";
4
+ import { t as c } from "./publishThirdwebClient-D-K2WEeM.js";
5
+ import { t as l } from "./managedAccountAdmin-DS6nniiu.js";
7
6
  //#region src/helpers/ensureModularPublishBootstrap.ts
8
7
  var u = /* @__PURE__ */ e({ ensureModularPublishBootstrap: () => d });
9
8
  async function d(e) {
@@ -11,14 +10,14 @@ async function d(e) {
11
10
  let u = o();
12
11
  await u.autoConnect({
13
12
  client: c(),
14
- chain: t()
13
+ chain: i()
15
14
  });
16
15
  let d = u.getAccount();
17
- if (!d) throw new i(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
- if (d.address.toLowerCase() !== e.toLowerCase()) throw new i(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
19
- return await s(e, async () => n(await l(e))), d;
16
+ if (!d) throw new n(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
17
+ if (d.address.toLowerCase() !== e.toLowerCase()) throw new n(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
+ return await s(e, async () => t(await l(e))), d;
20
19
  }
21
20
  //#endregion
22
21
  export { u as n, d as t };
23
22
 
24
- //# sourceMappingURL=ensureModularPublishBootstrap-BW8jKN_A.js.map
23
+ //# sourceMappingURL=ensureModularPublishBootstrap-DRFhp-O2.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensureModularPublishBootstrap-BhYNmLzT.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
1
+ {"version":3,"file":"ensureModularPublishBootstrap-DRFhp-O2.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
@@ -1,9 +1,8 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { _ as t, h as n, t as r } from "./chainConfig-CYy0XJ0M.js";
3
- import { r as i } from "./errors-Du3LNbJN.js";
4
- import { B as a, M as o, v as s } from "./publishAuthorization-DjVrnMC0.js";
5
- import { t as c } from "./publishThirdwebClient-Ce7iBIsj.js";
6
- import { t as l } from "./managedAccountAdmin-DJMw6UH6.js";
2
+ import { h as t, mt as n, t as r, y as i } from "./chainConfig-DWynbnb8.js";
3
+ import { B as a, M as o, v as s } from "./publishAuthorization-C-XYb9Ef.js";
4
+ import { t as c } from "./publishThirdwebClient-BmqsJCjp.js";
5
+ import { t as l } from "./managedAccountAdmin-ByEX_Eg2.js";
7
6
  //#region src/helpers/ensureModularPublishBootstrap.ts
8
7
  var u = /* @__PURE__ */ e({ ensureModularPublishBootstrap: () => d });
9
8
  async function d(e) {
@@ -11,14 +10,14 @@ async function d(e) {
11
10
  let u = o();
12
11
  await u.autoConnect({
13
12
  client: c(),
14
- chain: t()
13
+ chain: i()
15
14
  });
16
15
  let d = u.getAccount();
17
- if (!d) throw new i(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
- if (d.address.toLowerCase() !== e.toLowerCase()) throw new i(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
19
- return await s(e, async () => n(await l(e))), d;
16
+ if (!d) throw new n(`Could not connect the managed publishing account on ${r()}. Reconnect with the same sign-in method and try again.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
17
+ if (d.address.toLowerCase() !== e.toLowerCase()) throw new n(`The connected managed account (${d.address}) is not the publishing account ${e}. Reconnect with the sign-in method that owns it.`, "MANAGED_ACCOUNT_UNAVAILABLE", e);
18
+ return await s(e, async () => t(await l(e))), d;
20
19
  }
21
20
  //#endregion
22
21
  export { u as n, d as t };
23
22
 
24
- //# sourceMappingURL=ensureModularPublishBootstrap-BhYNmLzT.js.map
23
+ //# sourceMappingURL=ensureModularPublishBootstrap-DegJnYKL.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensureModularPublishBootstrap-Bsw1xSCt.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
1
+ {"version":3,"file":"ensureModularPublishBootstrap-DegJnYKL.js","names":[],"sources":["../src/helpers/ensureModularPublishBootstrap.ts"],"sourcesContent":["import type { Account } from 'thirdweb/wallets'\nimport { ManagedAccountPublishError } from '../errors'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { getPublishChainName } from './chainConfig'\nimport { ensureManagedAccountEasConfigured } from './ensureManagedAccountEasConfigured'\nimport { getManagedAccountAdmin } from './managedAccountAdmin'\nimport { getClient, getManagedAccountWallet, syncPublishInAppAuthToken } from './thirdweb'\nimport { getPublishThirdwebChain } from './thirdwebChain'\n\n/**\n * Returns the account that sends interactive `multiPublish`: the user's managed (EIP-4337) smart\n * account. Its UserOps execute `multiPublish` on the account itself, a self-call the Seed\n * extension accepts; session keys and other non-admin callers are rejected with `Unauthorized`.\n *\n * Also checks the account's EAS pointer. Only pre-rollout accounts that report no EAS get\n * `setEas`, sent by the admin EOA.\n */\nexport async function ensureModularPublishBootstrap(managedAddress: string): Promise<Account> {\n syncPublishInAppAuthToken()\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: getPublishThirdwebChain() })\n const managedAccount = managedWallet.getAccount()\n if (!managedAccount) {\n throw new ManagedAccountPublishError(\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n if (managedAccount.address.toLowerCase() !== managedAddress.toLowerCase()) {\n throw new ManagedAccountPublishError(\n `The connected managed account (${managedAccount.address}) is not the publishing account ${managedAddress}. Reconnect with the sign-in method that owns it.`,\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n managedAddress,\n )\n }\n\n await ensureManagedAccountEasConfigured(managedAddress, async () =>\n fromThirdwebAccount(await getManagedAccountAdmin(managedAddress)),\n )\n return managedAccount\n}\n"],"mappings":";;;;;;;AAiBA,eAAsB,EAA8B,GAA0C;CAC5F,EAA0B;CAC1B,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO,EAAwB;CAAE,CAAC;CACzF,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,uDAAuD,EAAoB,EAAE,0DAC7E,+BACA,CACF;CAEF,IAAI,EAAe,QAAQ,YAAY,MAAM,EAAe,YAAY,GACtE,MAAM,IAAI,EACR,kCAAkC,EAAe,QAAQ,kCAAkC,EAAe,oDAC1G,+BACA,CACF;CAMF,OAHA,MAAM,EAAkC,GAAgB,YACtD,EAAoB,MAAM,EAAuB,CAAc,CAAC,CAClE,GACO;AACT"}
@@ -1,12 +1,11 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { E as t, T as n, _ as r, h as i, o as a, t as o } from "./chainConfig-CA1Hrrjg.js";
3
- import { r as s } from "./errors-Du3LNbJN.js";
4
- import { A as c, h as l, j as u, z as d } from "./publishAuthorization-BEqRnP2h.js";
2
+ import { D as t, O as n, h as r, mt as i, o as a, t as o, y as s } from "./chainConfig-DmuPBs3D.js";
3
+ import { A as c, h as l, j as u, z as d } from "./publishAuthorization-CG23g8w2.js";
5
4
  import { ethers as f } from "ethers";
6
5
  //#region src/helpers/ensureSmartWalletThenPublish.ts
7
6
  var p = /* @__PURE__ */ e({ ensureSmartWalletThenPublish: () => _ }), m = "A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.", h = () => `Could not connect the managed publishing account on ${o()}. Reconnect with the same sign-in method and try again.`;
8
7
  function g(e) {
9
- if (e) return e instanceof f.Wallet ? e : n(e) ? e.signer : t(e) ? e : i(e).signer;
8
+ if (e) return e instanceof f.Wallet ? e : t(e) ? e.signer : n(e) ? e : r(e).signer;
10
9
  }
11
10
  async function _(e, t, n, o) {
12
11
  let f = a(), p = await n();
@@ -15,18 +14,18 @@ async function _(e, t, n, o) {
15
14
  let t = await u();
16
15
  if (!t) return {
17
16
  outcome: "managed_not_ready",
18
- error: new s(m, "MANAGED_ACCOUNT_UNAVAILABLE")
17
+ error: new i(m, "MANAGED_ACCOUNT_UNAVAILABLE")
19
18
  };
20
19
  let n;
21
20
  try {
22
- n = await c(r());
21
+ n = await c(s());
23
22
  } catch (e) {
24
23
  return {
25
24
  outcome: "managed_not_ready",
26
- error: new s(h(), "MANAGED_ACCOUNT_UNAVAILABLE", void 0, e)
25
+ error: new i(h(), "MANAGED_ACCOUNT_UNAVAILABLE", void 0, e)
27
26
  };
28
27
  }
29
- let a = i(t);
28
+ let a = r(t);
30
29
  return l.createPublish(e, n, a, {
31
30
  ...o,
32
31
  dataItemSigner: g(o?.dataItemSigner) ?? a.signer
@@ -34,7 +33,7 @@ async function _(e, t, n, o) {
34
33
  }
35
34
  let _ = await d(t ?? null);
36
35
  if ("address" in _) {
37
- let t = i(_.account);
36
+ let t = r(_.account);
38
37
  return l.createPublish(e, _.address, t, {
39
38
  ...o,
40
39
  dataItemSigner: g(o?.dataItemSigner) ?? t.signer
@@ -45,4 +44,4 @@ async function _(e, t, n, o) {
45
44
  //#endregion
46
45
  export { p as n, _ as t };
47
46
 
48
- //# sourceMappingURL=ensureSmartWalletThenPublish-Bm58tc-b.js.map
47
+ //# sourceMappingURL=ensureSmartWalletThenPublish-0nKg13WN.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensureSmartWalletThenPublish-Bm58tc-b.js","names":[],"sources":["../src/helpers/ensureSmartWalletThenPublish.ts"],"sourcesContent":["import type { Item } from '@seedprotocol/sdk'\nimport type { Account } from 'thirdweb/wallets'\nimport {\n getConnectedManagedAccountAddress,\n getConnectedModularAccount,\n resolveSmartWalletForPublish,\n} from './thirdweb'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { isPublishWallet, isSeedSigner, type PublishWallet, type SeedSigner } from './seedSigner'\nimport { ethers } from 'ethers'\nimport { PublishManager } from '../services/publishManager'\nimport type { CreatePublishOptions } from '../config'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nexport type EnsureSmartWalletResult =\n | { outcome: 'started' }\n | { outcome: 'no_address' }\n | { outcome: 'needs_deploy' }\n | { outcome: 'managed_not_ready'; error: ManagedAccountPublishError }\n\nconst MSG_NO_ACCOUNT_MODULAR =\n 'A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.'\n\nconst MSG_MANAGED_UNAVAILABLE = () =>\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`\n\nfunction coerceDataItemSigner(\n signer: CreatePublishOptions['dataItemSigner'] | Account | SeedSigner | PublishWallet | undefined,\n): CreatePublishOptions['dataItemSigner'] {\n if (!signer) return undefined\n if (signer instanceof ethers.Wallet) return signer\n if (isPublishWallet(signer)) return signer.signer\n if (isSeedSigner(signer)) return signer\n return fromThirdwebAccount(signer as Account).signer\n}\n\n/**\n * Thirdweb path: resolves the smart wallet for the current account; if deployed, starts publish.\n * Prefer {@link ensureWalletThenPublish} for vendor-neutral entry.\n */\nexport async function ensureSmartWalletThenPublish(\n item: Item<any>,\n activeAccount: Account | null | undefined,\n getAddress: () => Promise<string | null>,\n options?: CreatePublishOptions,\n): Promise<EnsureSmartWalletResult> {\n const config = getPublishConfig()\n const address = await getAddress()\n if (!address || !address.trim()) {\n return { outcome: 'no_address' }\n }\n\n if (config.useModularExecutor) {\n const modularAccount = await getConnectedModularAccount()\n if (!modularAccount) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(MSG_NO_ACCOUNT_MODULAR, 'MANAGED_ACCOUNT_UNAVAILABLE'),\n }\n }\n\n let managedAddress: string\n try {\n managedAddress = await getConnectedManagedAccountAddress(getPublishThirdwebChain())\n } catch (cause) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(\n MSG_MANAGED_UNAVAILABLE(),\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n undefined,\n cause,\n ),\n }\n }\n\n const wallet = fromThirdwebAccount(modularAccount)\n PublishManager.createPublish(item, managedAddress, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n\n const resolved = await resolveSmartWalletForPublish(activeAccount ?? null)\n if ('address' in resolved) {\n const wallet = fromThirdwebAccount(resolved.account)\n PublishManager.createPublish(item, resolved.address, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n return { outcome: 'needs_deploy' }\n}\n"],"mappings":";;;;;;sEAuBM,IACJ,+GAEI,UACJ,uDAAuD,EAAoB,EAAE;AAE/E,SAAS,EACP,GACwC;CACnC,OAIL,OAHI,aAAkB,EAAO,SAAe,IACxC,EAAgB,CAAM,IAAU,EAAO,SACvC,EAAa,CAAM,IAAU,IAC1B,EAAoB,CAAiB,CAAC,CAAC;AAChD;AAMA,eAAsB,EACpB,GACA,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAiB,GAC1B,IAAU,MAAM,EAAW;CACjC,IAAI,CAAC,KAAW,CAAC,EAAQ,KAAK,GAC5B,OAAO,EAAE,SAAS,aAAa;CAGjC,IAAI,EAAO,oBAAoB;EAC7B,IAAM,IAAiB,MAAM,EAA2B;EACxD,IAAI,CAAC,GACH,OAAO;GACL,SAAS;GACT,OAAO,IAAI,EAA2B,GAAwB,6BAA6B;EAC7F;EAGF,IAAI;EACJ,IAAI;GACF,IAAiB,MAAM,EAAkC,EAAwB,CAAC;EACpF,SAAS,GAAO;GACd,OAAO;IACL,SAAS;IACT,OAAO,IAAI,EACT,EAAwB,GACxB,+BACA,KAAA,GACA,CACF;GACF;EACF;EAEA,IAAM,IAAS,EAAoB,CAAc;EAKjD,OAJA,EAAe,cAAc,GAAM,GAAgB,GAAQ;GACzD,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CAEA,IAAM,IAAW,MAAM,EAA6B,KAAiB,IAAI;CACzE,IAAI,aAAa,GAAU;EACzB,IAAM,IAAS,EAAoB,EAAS,OAAO;EAKnD,OAJA,EAAe,cAAc,GAAM,EAAS,SAAS,GAAQ;GAC3D,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CACA,OAAO,EAAE,SAAS,eAAe;AACnC"}
1
+ {"version":3,"file":"ensureSmartWalletThenPublish-0nKg13WN.js","names":[],"sources":["../src/helpers/ensureSmartWalletThenPublish.ts"],"sourcesContent":["import type { Item } from '@seedprotocol/sdk'\nimport type { Account } from 'thirdweb/wallets'\nimport {\n getConnectedManagedAccountAddress,\n getConnectedModularAccount,\n resolveSmartWalletForPublish,\n} from './thirdweb'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { isPublishWallet, isSeedSigner, type PublishWallet, type SeedSigner } from './seedSigner'\nimport { ethers } from 'ethers'\nimport { PublishManager } from '../services/publishManager'\nimport type { CreatePublishOptions } from '../config'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nexport type EnsureSmartWalletResult =\n | { outcome: 'started' }\n | { outcome: 'no_address' }\n | { outcome: 'needs_deploy' }\n | { outcome: 'managed_not_ready'; error: ManagedAccountPublishError }\n\nconst MSG_NO_ACCOUNT_MODULAR =\n 'A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.'\n\nconst MSG_MANAGED_UNAVAILABLE = () =>\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`\n\nfunction coerceDataItemSigner(\n signer: CreatePublishOptions['dataItemSigner'] | Account | SeedSigner | PublishWallet | undefined,\n): CreatePublishOptions['dataItemSigner'] {\n if (!signer) return undefined\n if (signer instanceof ethers.Wallet) return signer\n if (isPublishWallet(signer)) return signer.signer\n if (isSeedSigner(signer)) return signer\n return fromThirdwebAccount(signer as Account).signer\n}\n\n/**\n * Thirdweb path: resolves the smart wallet for the current account; if deployed, starts publish.\n * Prefer {@link ensureWalletThenPublish} for vendor-neutral entry.\n */\nexport async function ensureSmartWalletThenPublish(\n item: Item<any>,\n activeAccount: Account | null | undefined,\n getAddress: () => Promise<string | null>,\n options?: CreatePublishOptions,\n): Promise<EnsureSmartWalletResult> {\n const config = getPublishConfig()\n const address = await getAddress()\n if (!address || !address.trim()) {\n return { outcome: 'no_address' }\n }\n\n if (config.useModularExecutor) {\n const modularAccount = await getConnectedModularAccount()\n if (!modularAccount) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(MSG_NO_ACCOUNT_MODULAR, 'MANAGED_ACCOUNT_UNAVAILABLE'),\n }\n }\n\n let managedAddress: string\n try {\n managedAddress = await getConnectedManagedAccountAddress(getPublishThirdwebChain())\n } catch (cause) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(\n MSG_MANAGED_UNAVAILABLE(),\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n undefined,\n cause,\n ),\n }\n }\n\n const wallet = fromThirdwebAccount(modularAccount)\n PublishManager.createPublish(item, managedAddress, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n\n const resolved = await resolveSmartWalletForPublish(activeAccount ?? null)\n if ('address' in resolved) {\n const wallet = fromThirdwebAccount(resolved.account)\n PublishManager.createPublish(item, resolved.address, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n return { outcome: 'needs_deploy' }\n}\n"],"mappings":";;;;;sEAuBM,IACJ,+GAEI,UACJ,uDAAuD,EAAoB,EAAE;AAE/E,SAAS,EACP,GACwC;CACnC,OAIL,OAHI,aAAkB,EAAO,SAAe,IACxC,EAAgB,CAAM,IAAU,EAAO,SACvC,EAAa,CAAM,IAAU,IAC1B,EAAoB,CAAiB,CAAC,CAAC;AAChD;AAMA,eAAsB,EACpB,GACA,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAiB,GAC1B,IAAU,MAAM,EAAW;CACjC,IAAI,CAAC,KAAW,CAAC,EAAQ,KAAK,GAC5B,OAAO,EAAE,SAAS,aAAa;CAGjC,IAAI,EAAO,oBAAoB;EAC7B,IAAM,IAAiB,MAAM,EAA2B;EACxD,IAAI,CAAC,GACH,OAAO;GACL,SAAS;GACT,OAAO,IAAI,EAA2B,GAAwB,6BAA6B;EAC7F;EAGF,IAAI;EACJ,IAAI;GACF,IAAiB,MAAM,EAAkC,EAAwB,CAAC;EACpF,SAAS,GAAO;GACd,OAAO;IACL,SAAS;IACT,OAAO,IAAI,EACT,EAAwB,GACxB,+BACA,KAAA,GACA,CACF;GACF;EACF;EAEA,IAAM,IAAS,EAAoB,CAAc;EAKjD,OAJA,EAAe,cAAc,GAAM,GAAgB,GAAQ;GACzD,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CAEA,IAAM,IAAW,MAAM,EAA6B,KAAiB,IAAI;CACzE,IAAI,aAAa,GAAU;EACzB,IAAM,IAAS,EAAoB,EAAS,OAAO;EAKnD,OAJA,EAAe,cAAc,GAAM,EAAS,SAAS,GAAQ;GAC3D,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CACA,OAAO,EAAE,SAAS,eAAe;AACnC"}
@@ -1,12 +1,11 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { E as t, T as n, _ as r, h as i, o as a, t as o } from "./chainConfig-3wlYarAG.js";
3
- import { r as s } from "./errors-Du3LNbJN.js";
4
- import { A as c, h as l, j as u, z as d } from "./publishAuthorization-DfAQs1sN.js";
2
+ import { D as t, O as n, h as r, mt as i, o as a, t as o, y as s } from "./chainConfig-BJ8C_RRz.js";
3
+ import { A as c, h as l, j as u, z as d } from "./publishAuthorization-CvK_coYp.js";
5
4
  import { ethers as f } from "ethers";
6
5
  //#region src/helpers/ensureSmartWalletThenPublish.ts
7
6
  var p = /* @__PURE__ */ e({ ensureSmartWalletThenPublish: () => _ }), m = "A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.", h = () => `Could not connect the managed publishing account on ${o()}. Reconnect with the same sign-in method and try again.`;
8
7
  function g(e) {
9
- if (e) return e instanceof f.Wallet ? e : n(e) ? e.signer : t(e) ? e : i(e).signer;
8
+ if (e) return e instanceof f.Wallet ? e : t(e) ? e.signer : n(e) ? e : r(e).signer;
10
9
  }
11
10
  async function _(e, t, n, o) {
12
11
  let f = a(), p = await n();
@@ -15,18 +14,18 @@ async function _(e, t, n, o) {
15
14
  let t = await u();
16
15
  if (!t) return {
17
16
  outcome: "managed_not_ready",
18
- error: new s(m, "MANAGED_ACCOUNT_UNAVAILABLE")
17
+ error: new i(m, "MANAGED_ACCOUNT_UNAVAILABLE")
19
18
  };
20
19
  let n;
21
20
  try {
22
- n = await c(r());
21
+ n = await c(s());
23
22
  } catch (e) {
24
23
  return {
25
24
  outcome: "managed_not_ready",
26
- error: new s(h(), "MANAGED_ACCOUNT_UNAVAILABLE", void 0, e)
25
+ error: new i(h(), "MANAGED_ACCOUNT_UNAVAILABLE", void 0, e)
27
26
  };
28
27
  }
29
- let a = i(t);
28
+ let a = r(t);
30
29
  return l.createPublish(e, n, a, {
31
30
  ...o,
32
31
  dataItemSigner: g(o?.dataItemSigner) ?? a.signer
@@ -34,7 +33,7 @@ async function _(e, t, n, o) {
34
33
  }
35
34
  let _ = await d(t ?? null);
36
35
  if ("address" in _) {
37
- let t = i(_.account);
36
+ let t = r(_.account);
38
37
  return l.createPublish(e, _.address, t, {
39
38
  ...o,
40
39
  dataItemSigner: g(o?.dataItemSigner) ?? t.signer
@@ -45,4 +44,4 @@ async function _(e, t, n, o) {
45
44
  //#endregion
46
45
  export { p as n, _ as t };
47
46
 
48
- //# sourceMappingURL=ensureSmartWalletThenPublish-D5GSZRyZ.js.map
47
+ //# sourceMappingURL=ensureSmartWalletThenPublish-BdqeUL6t.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensureSmartWalletThenPublish-D5GSZRyZ.js","names":[],"sources":["../src/helpers/ensureSmartWalletThenPublish.ts"],"sourcesContent":["import type { Item } from '@seedprotocol/sdk'\nimport type { Account } from 'thirdweb/wallets'\nimport {\n getConnectedManagedAccountAddress,\n getConnectedModularAccount,\n resolveSmartWalletForPublish,\n} from './thirdweb'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { isPublishWallet, isSeedSigner, type PublishWallet, type SeedSigner } from './seedSigner'\nimport { ethers } from 'ethers'\nimport { PublishManager } from '../services/publishManager'\nimport type { CreatePublishOptions } from '../config'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nexport type EnsureSmartWalletResult =\n | { outcome: 'started' }\n | { outcome: 'no_address' }\n | { outcome: 'needs_deploy' }\n | { outcome: 'managed_not_ready'; error: ManagedAccountPublishError }\n\nconst MSG_NO_ACCOUNT_MODULAR =\n 'A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.'\n\nconst MSG_MANAGED_UNAVAILABLE = () =>\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`\n\nfunction coerceDataItemSigner(\n signer: CreatePublishOptions['dataItemSigner'] | Account | SeedSigner | PublishWallet | undefined,\n): CreatePublishOptions['dataItemSigner'] {\n if (!signer) return undefined\n if (signer instanceof ethers.Wallet) return signer\n if (isPublishWallet(signer)) return signer.signer\n if (isSeedSigner(signer)) return signer\n return fromThirdwebAccount(signer as Account).signer\n}\n\n/**\n * Thirdweb path: resolves the smart wallet for the current account; if deployed, starts publish.\n * Prefer {@link ensureWalletThenPublish} for vendor-neutral entry.\n */\nexport async function ensureSmartWalletThenPublish(\n item: Item<any>,\n activeAccount: Account | null | undefined,\n getAddress: () => Promise<string | null>,\n options?: CreatePublishOptions,\n): Promise<EnsureSmartWalletResult> {\n const config = getPublishConfig()\n const address = await getAddress()\n if (!address || !address.trim()) {\n return { outcome: 'no_address' }\n }\n\n if (config.useModularExecutor) {\n const modularAccount = await getConnectedModularAccount()\n if (!modularAccount) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(MSG_NO_ACCOUNT_MODULAR, 'MANAGED_ACCOUNT_UNAVAILABLE'),\n }\n }\n\n let managedAddress: string\n try {\n managedAddress = await getConnectedManagedAccountAddress(getPublishThirdwebChain())\n } catch (cause) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(\n MSG_MANAGED_UNAVAILABLE(),\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n undefined,\n cause,\n ),\n }\n }\n\n const wallet = fromThirdwebAccount(modularAccount)\n PublishManager.createPublish(item, managedAddress, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n\n const resolved = await resolveSmartWalletForPublish(activeAccount ?? null)\n if ('address' in resolved) {\n const wallet = fromThirdwebAccount(resolved.account)\n PublishManager.createPublish(item, resolved.address, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n return { outcome: 'needs_deploy' }\n}\n"],"mappings":";;;;;;sEAuBM,IACJ,+GAEI,UACJ,uDAAuD,EAAoB,EAAE;AAE/E,SAAS,EACP,GACwC;CACnC,OAIL,OAHI,aAAkB,EAAO,SAAe,IACxC,EAAgB,CAAM,IAAU,EAAO,SACvC,EAAa,CAAM,IAAU,IAC1B,EAAoB,CAAiB,CAAC,CAAC;AAChD;AAMA,eAAsB,EACpB,GACA,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAiB,GAC1B,IAAU,MAAM,EAAW;CACjC,IAAI,CAAC,KAAW,CAAC,EAAQ,KAAK,GAC5B,OAAO,EAAE,SAAS,aAAa;CAGjC,IAAI,EAAO,oBAAoB;EAC7B,IAAM,IAAiB,MAAM,EAA2B;EACxD,IAAI,CAAC,GACH,OAAO;GACL,SAAS;GACT,OAAO,IAAI,EAA2B,GAAwB,6BAA6B;EAC7F;EAGF,IAAI;EACJ,IAAI;GACF,IAAiB,MAAM,EAAkC,EAAwB,CAAC;EACpF,SAAS,GAAO;GACd,OAAO;IACL,SAAS;IACT,OAAO,IAAI,EACT,EAAwB,GACxB,+BACA,KAAA,GACA,CACF;GACF;EACF;EAEA,IAAM,IAAS,EAAoB,CAAc;EAKjD,OAJA,EAAe,cAAc,GAAM,GAAgB,GAAQ;GACzD,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CAEA,IAAM,IAAW,MAAM,EAA6B,KAAiB,IAAI;CACzE,IAAI,aAAa,GAAU;EACzB,IAAM,IAAS,EAAoB,EAAS,OAAO;EAKnD,OAJA,EAAe,cAAc,GAAM,EAAS,SAAS,GAAQ;GAC3D,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CACA,OAAO,EAAE,SAAS,eAAe;AACnC"}
1
+ {"version":3,"file":"ensureSmartWalletThenPublish-BdqeUL6t.js","names":[],"sources":["../src/helpers/ensureSmartWalletThenPublish.ts"],"sourcesContent":["import type { Item } from '@seedprotocol/sdk'\nimport type { Account } from 'thirdweb/wallets'\nimport {\n getConnectedManagedAccountAddress,\n getConnectedModularAccount,\n resolveSmartWalletForPublish,\n} from './thirdweb'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { isPublishWallet, isSeedSigner, type PublishWallet, type SeedSigner } from './seedSigner'\nimport { ethers } from 'ethers'\nimport { PublishManager } from '../services/publishManager'\nimport type { CreatePublishOptions } from '../config'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nexport type EnsureSmartWalletResult =\n | { outcome: 'started' }\n | { outcome: 'no_address' }\n | { outcome: 'needs_deploy' }\n | { outcome: 'managed_not_ready'; error: ManagedAccountPublishError }\n\nconst MSG_NO_ACCOUNT_MODULAR =\n 'A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.'\n\nconst MSG_MANAGED_UNAVAILABLE = () =>\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`\n\nfunction coerceDataItemSigner(\n signer: CreatePublishOptions['dataItemSigner'] | Account | SeedSigner | PublishWallet | undefined,\n): CreatePublishOptions['dataItemSigner'] {\n if (!signer) return undefined\n if (signer instanceof ethers.Wallet) return signer\n if (isPublishWallet(signer)) return signer.signer\n if (isSeedSigner(signer)) return signer\n return fromThirdwebAccount(signer as Account).signer\n}\n\n/**\n * Thirdweb path: resolves the smart wallet for the current account; if deployed, starts publish.\n * Prefer {@link ensureWalletThenPublish} for vendor-neutral entry.\n */\nexport async function ensureSmartWalletThenPublish(\n item: Item<any>,\n activeAccount: Account | null | undefined,\n getAddress: () => Promise<string | null>,\n options?: CreatePublishOptions,\n): Promise<EnsureSmartWalletResult> {\n const config = getPublishConfig()\n const address = await getAddress()\n if (!address || !address.trim()) {\n return { outcome: 'no_address' }\n }\n\n if (config.useModularExecutor) {\n const modularAccount = await getConnectedModularAccount()\n if (!modularAccount) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(MSG_NO_ACCOUNT_MODULAR, 'MANAGED_ACCOUNT_UNAVAILABLE'),\n }\n }\n\n let managedAddress: string\n try {\n managedAddress = await getConnectedManagedAccountAddress(getPublishThirdwebChain())\n } catch (cause) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(\n MSG_MANAGED_UNAVAILABLE(),\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n undefined,\n cause,\n ),\n }\n }\n\n const wallet = fromThirdwebAccount(modularAccount)\n PublishManager.createPublish(item, managedAddress, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n\n const resolved = await resolveSmartWalletForPublish(activeAccount ?? null)\n if ('address' in resolved) {\n const wallet = fromThirdwebAccount(resolved.account)\n PublishManager.createPublish(item, resolved.address, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n return { outcome: 'needs_deploy' }\n}\n"],"mappings":";;;;;sEAuBM,IACJ,+GAEI,UACJ,uDAAuD,EAAoB,EAAE;AAE/E,SAAS,EACP,GACwC;CACnC,OAIL,OAHI,aAAkB,EAAO,SAAe,IACxC,EAAgB,CAAM,IAAU,EAAO,SACvC,EAAa,CAAM,IAAU,IAC1B,EAAoB,CAAiB,CAAC,CAAC;AAChD;AAMA,eAAsB,EACpB,GACA,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAiB,GAC1B,IAAU,MAAM,EAAW;CACjC,IAAI,CAAC,KAAW,CAAC,EAAQ,KAAK,GAC5B,OAAO,EAAE,SAAS,aAAa;CAGjC,IAAI,EAAO,oBAAoB;EAC7B,IAAM,IAAiB,MAAM,EAA2B;EACxD,IAAI,CAAC,GACH,OAAO;GACL,SAAS;GACT,OAAO,IAAI,EAA2B,GAAwB,6BAA6B;EAC7F;EAGF,IAAI;EACJ,IAAI;GACF,IAAiB,MAAM,EAAkC,EAAwB,CAAC;EACpF,SAAS,GAAO;GACd,OAAO;IACL,SAAS;IACT,OAAO,IAAI,EACT,EAAwB,GACxB,+BACA,KAAA,GACA,CACF;GACF;EACF;EAEA,IAAM,IAAS,EAAoB,CAAc;EAKjD,OAJA,EAAe,cAAc,GAAM,GAAgB,GAAQ;GACzD,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CAEA,IAAM,IAAW,MAAM,EAA6B,KAAiB,IAAI;CACzE,IAAI,aAAa,GAAU;EACzB,IAAM,IAAS,EAAoB,EAAS,OAAO;EAKnD,OAJA,EAAe,cAAc,GAAM,EAAS,SAAS,GAAQ;GAC3D,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CACA,OAAO,EAAE,SAAS,eAAe;AACnC"}
@@ -1,12 +1,11 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { E as t, T as n, _ as r, h as i, o as a, t as o } from "./chainConfig-BYm5OXpk.js";
3
- import { r as s } from "./errors-Du3LNbJN.js";
4
- import { A as c, h as l, j as u, z as d } from "./publishAuthorization-CxBkijU6.js";
2
+ import { D as t, O as n, h as r, mt as i, o as a, t as o, y as s } from "./chainConfig-DWynbnb8.js";
3
+ import { A as c, h as l, j as u, z as d } from "./publishAuthorization-C-XYb9Ef.js";
5
4
  import { ethers as f } from "ethers";
6
5
  //#region src/helpers/ensureSmartWalletThenPublish.ts
7
6
  var p = /* @__PURE__ */ e({ ensureSmartWalletThenPublish: () => _ }), m = "A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.", h = () => `Could not connect the managed publishing account on ${o()}. Reconnect with the same sign-in method and try again.`;
8
7
  function g(e) {
9
- if (e) return e instanceof f.Wallet ? e : n(e) ? e.signer : t(e) ? e : i(e).signer;
8
+ if (e) return e instanceof f.Wallet ? e : t(e) ? e.signer : n(e) ? e : r(e).signer;
10
9
  }
11
10
  async function _(e, t, n, o) {
12
11
  let f = a(), p = await n();
@@ -15,18 +14,18 @@ async function _(e, t, n, o) {
15
14
  let t = await u();
16
15
  if (!t) return {
17
16
  outcome: "managed_not_ready",
18
- error: new s(m, "MANAGED_ACCOUNT_UNAVAILABLE")
17
+ error: new i(m, "MANAGED_ACCOUNT_UNAVAILABLE")
19
18
  };
20
19
  let n;
21
20
  try {
22
- n = await c(r());
21
+ n = await c(s());
23
22
  } catch (e) {
24
23
  return {
25
24
  outcome: "managed_not_ready",
26
- error: new s(h(), "MANAGED_ACCOUNT_UNAVAILABLE", void 0, e)
25
+ error: new i(h(), "MANAGED_ACCOUNT_UNAVAILABLE", void 0, e)
27
26
  };
28
27
  }
29
- let a = i(t);
28
+ let a = r(t);
30
29
  return l.createPublish(e, n, a, {
31
30
  ...o,
32
31
  dataItemSigner: g(o?.dataItemSigner) ?? a.signer
@@ -34,7 +33,7 @@ async function _(e, t, n, o) {
34
33
  }
35
34
  let _ = await d(t ?? null);
36
35
  if ("address" in _) {
37
- let t = i(_.account);
36
+ let t = r(_.account);
38
37
  return l.createPublish(e, _.address, t, {
39
38
  ...o,
40
39
  dataItemSigner: g(o?.dataItemSigner) ?? t.signer
@@ -45,4 +44,4 @@ async function _(e, t, n, o) {
45
44
  //#endregion
46
45
  export { p as n, _ as t };
47
46
 
48
- //# sourceMappingURL=ensureSmartWalletThenPublish-DAomriGc.js.map
47
+ //# sourceMappingURL=ensureSmartWalletThenPublish-BfEndtFo.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ensureSmartWalletThenPublish-DAomriGc.js","names":[],"sources":["../src/helpers/ensureSmartWalletThenPublish.ts"],"sourcesContent":["import type { Item } from '@seedprotocol/sdk'\nimport type { Account } from 'thirdweb/wallets'\nimport {\n getConnectedManagedAccountAddress,\n getConnectedModularAccount,\n resolveSmartWalletForPublish,\n} from './thirdweb'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { isPublishWallet, isSeedSigner, type PublishWallet, type SeedSigner } from './seedSigner'\nimport { ethers } from 'ethers'\nimport { PublishManager } from '../services/publishManager'\nimport type { CreatePublishOptions } from '../config'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nexport type EnsureSmartWalletResult =\n | { outcome: 'started' }\n | { outcome: 'no_address' }\n | { outcome: 'needs_deploy' }\n | { outcome: 'managed_not_ready'; error: ManagedAccountPublishError }\n\nconst MSG_NO_ACCOUNT_MODULAR =\n 'A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.'\n\nconst MSG_MANAGED_UNAVAILABLE = () =>\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`\n\nfunction coerceDataItemSigner(\n signer: CreatePublishOptions['dataItemSigner'] | Account | SeedSigner | PublishWallet | undefined,\n): CreatePublishOptions['dataItemSigner'] {\n if (!signer) return undefined\n if (signer instanceof ethers.Wallet) return signer\n if (isPublishWallet(signer)) return signer.signer\n if (isSeedSigner(signer)) return signer\n return fromThirdwebAccount(signer as Account).signer\n}\n\n/**\n * Thirdweb path: resolves the smart wallet for the current account; if deployed, starts publish.\n * Prefer {@link ensureWalletThenPublish} for vendor-neutral entry.\n */\nexport async function ensureSmartWalletThenPublish(\n item: Item<any>,\n activeAccount: Account | null | undefined,\n getAddress: () => Promise<string | null>,\n options?: CreatePublishOptions,\n): Promise<EnsureSmartWalletResult> {\n const config = getPublishConfig()\n const address = await getAddress()\n if (!address || !address.trim()) {\n return { outcome: 'no_address' }\n }\n\n if (config.useModularExecutor) {\n const modularAccount = await getConnectedModularAccount()\n if (!modularAccount) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(MSG_NO_ACCOUNT_MODULAR, 'MANAGED_ACCOUNT_UNAVAILABLE'),\n }\n }\n\n let managedAddress: string\n try {\n managedAddress = await getConnectedManagedAccountAddress(getPublishThirdwebChain())\n } catch (cause) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(\n MSG_MANAGED_UNAVAILABLE(),\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n undefined,\n cause,\n ),\n }\n }\n\n const wallet = fromThirdwebAccount(modularAccount)\n PublishManager.createPublish(item, managedAddress, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n\n const resolved = await resolveSmartWalletForPublish(activeAccount ?? null)\n if ('address' in resolved) {\n const wallet = fromThirdwebAccount(resolved.account)\n PublishManager.createPublish(item, resolved.address, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n return { outcome: 'needs_deploy' }\n}\n"],"mappings":";;;;;;sEAuBM,IACJ,+GAEI,UACJ,uDAAuD,EAAoB,EAAE;AAE/E,SAAS,EACP,GACwC;CACnC,OAIL,OAHI,aAAkB,EAAO,SAAe,IACxC,EAAgB,CAAM,IAAU,EAAO,SACvC,EAAa,CAAM,IAAU,IAC1B,EAAoB,CAAiB,CAAC,CAAC;AAChD;AAMA,eAAsB,EACpB,GACA,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAiB,GAC1B,IAAU,MAAM,EAAW;CACjC,IAAI,CAAC,KAAW,CAAC,EAAQ,KAAK,GAC5B,OAAO,EAAE,SAAS,aAAa;CAGjC,IAAI,EAAO,oBAAoB;EAC7B,IAAM,IAAiB,MAAM,EAA2B;EACxD,IAAI,CAAC,GACH,OAAO;GACL,SAAS;GACT,OAAO,IAAI,EAA2B,GAAwB,6BAA6B;EAC7F;EAGF,IAAI;EACJ,IAAI;GACF,IAAiB,MAAM,EAAkC,EAAwB,CAAC;EACpF,SAAS,GAAO;GACd,OAAO;IACL,SAAS;IACT,OAAO,IAAI,EACT,EAAwB,GACxB,+BACA,KAAA,GACA,CACF;GACF;EACF;EAEA,IAAM,IAAS,EAAoB,CAAc;EAKjD,OAJA,EAAe,cAAc,GAAM,GAAgB,GAAQ;GACzD,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CAEA,IAAM,IAAW,MAAM,EAA6B,KAAiB,IAAI;CACzE,IAAI,aAAa,GAAU;EACzB,IAAM,IAAS,EAAoB,EAAS,OAAO;EAKnD,OAJA,EAAe,cAAc,GAAM,EAAS,SAAS,GAAQ;GAC3D,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CACA,OAAO,EAAE,SAAS,eAAe;AACnC"}
1
+ {"version":3,"file":"ensureSmartWalletThenPublish-BfEndtFo.js","names":[],"sources":["../src/helpers/ensureSmartWalletThenPublish.ts"],"sourcesContent":["import type { Item } from '@seedprotocol/sdk'\nimport type { Account } from 'thirdweb/wallets'\nimport {\n getConnectedManagedAccountAddress,\n getConnectedModularAccount,\n resolveSmartWalletForPublish,\n} from './thirdweb'\nimport { fromThirdwebAccount } from './adapters/thirdwebAccount'\nimport { isPublishWallet, isSeedSigner, type PublishWallet, type SeedSigner } from './seedSigner'\nimport { ethers } from 'ethers'\nimport { PublishManager } from '../services/publishManager'\nimport type { CreatePublishOptions } from '../config'\nimport { getPublishConfig } from '../config'\nimport { ManagedAccountPublishError } from '../errors'\nimport { getPublishThirdwebChain } from './thirdwebChain'\nimport { getPublishChainName } from './chainConfig'\n\nexport type EnsureSmartWalletResult =\n | { outcome: 'started' }\n | { outcome: 'no_address' }\n | { outcome: 'needs_deploy' }\n | { outcome: 'managed_not_ready'; error: ManagedAccountPublishError }\n\nconst MSG_NO_ACCOUNT_MODULAR =\n 'A connected wallet is required for publishing with the modular executor. Connect your wallet and try again.'\n\nconst MSG_MANAGED_UNAVAILABLE = () =>\n `Could not connect the managed publishing account on ${getPublishChainName()}. Reconnect with the same sign-in method and try again.`\n\nfunction coerceDataItemSigner(\n signer: CreatePublishOptions['dataItemSigner'] | Account | SeedSigner | PublishWallet | undefined,\n): CreatePublishOptions['dataItemSigner'] {\n if (!signer) return undefined\n if (signer instanceof ethers.Wallet) return signer\n if (isPublishWallet(signer)) return signer.signer\n if (isSeedSigner(signer)) return signer\n return fromThirdwebAccount(signer as Account).signer\n}\n\n/**\n * Thirdweb path: resolves the smart wallet for the current account; if deployed, starts publish.\n * Prefer {@link ensureWalletThenPublish} for vendor-neutral entry.\n */\nexport async function ensureSmartWalletThenPublish(\n item: Item<any>,\n activeAccount: Account | null | undefined,\n getAddress: () => Promise<string | null>,\n options?: CreatePublishOptions,\n): Promise<EnsureSmartWalletResult> {\n const config = getPublishConfig()\n const address = await getAddress()\n if (!address || !address.trim()) {\n return { outcome: 'no_address' }\n }\n\n if (config.useModularExecutor) {\n const modularAccount = await getConnectedModularAccount()\n if (!modularAccount) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(MSG_NO_ACCOUNT_MODULAR, 'MANAGED_ACCOUNT_UNAVAILABLE'),\n }\n }\n\n let managedAddress: string\n try {\n managedAddress = await getConnectedManagedAccountAddress(getPublishThirdwebChain())\n } catch (cause) {\n return {\n outcome: 'managed_not_ready',\n error: new ManagedAccountPublishError(\n MSG_MANAGED_UNAVAILABLE(),\n 'MANAGED_ACCOUNT_UNAVAILABLE',\n undefined,\n cause,\n ),\n }\n }\n\n const wallet = fromThirdwebAccount(modularAccount)\n PublishManager.createPublish(item, managedAddress, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n\n const resolved = await resolveSmartWalletForPublish(activeAccount ?? null)\n if ('address' in resolved) {\n const wallet = fromThirdwebAccount(resolved.account)\n PublishManager.createPublish(item, resolved.address, wallet, {\n ...options,\n dataItemSigner: coerceDataItemSigner(options?.dataItemSigner) ?? wallet.signer,\n })\n return { outcome: 'started' }\n }\n return { outcome: 'needs_deploy' }\n}\n"],"mappings":";;;;;sEAuBM,IACJ,+GAEI,UACJ,uDAAuD,EAAoB,EAAE;AAE/E,SAAS,EACP,GACwC;CACnC,OAIL,OAHI,aAAkB,EAAO,SAAe,IACxC,EAAgB,CAAM,IAAU,EAAO,SACvC,EAAa,CAAM,IAAU,IAC1B,EAAoB,CAAiB,CAAC,CAAC;AAChD;AAMA,eAAsB,EACpB,GACA,GACA,GACA,GACkC;CAClC,IAAM,IAAS,EAAiB,GAC1B,IAAU,MAAM,EAAW;CACjC,IAAI,CAAC,KAAW,CAAC,EAAQ,KAAK,GAC5B,OAAO,EAAE,SAAS,aAAa;CAGjC,IAAI,EAAO,oBAAoB;EAC7B,IAAM,IAAiB,MAAM,EAA2B;EACxD,IAAI,CAAC,GACH,OAAO;GACL,SAAS;GACT,OAAO,IAAI,EAA2B,GAAwB,6BAA6B;EAC7F;EAGF,IAAI;EACJ,IAAI;GACF,IAAiB,MAAM,EAAkC,EAAwB,CAAC;EACpF,SAAS,GAAO;GACd,OAAO;IACL,SAAS;IACT,OAAO,IAAI,EACT,EAAwB,GACxB,+BACA,KAAA,GACA,CACF;GACF;EACF;EAEA,IAAM,IAAS,EAAoB,CAAc;EAKjD,OAJA,EAAe,cAAc,GAAM,GAAgB,GAAQ;GACzD,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CAEA,IAAM,IAAW,MAAM,EAA6B,KAAiB,IAAI;CACzE,IAAI,aAAa,GAAU;EACzB,IAAM,IAAS,EAAoB,EAAS,OAAO;EAKnD,OAJA,EAAe,cAAc,GAAM,EAAS,SAAS,GAAQ;GAC3D,GAAG;GACH,gBAAgB,EAAqB,GAAS,cAAc,KAAK,EAAO;EAC1E,CAAC,GACM,EAAE,SAAS,UAAU;CAC9B;CACA,OAAO,EAAE,SAAS,eAAe;AACnC"}