@seedprotocol/publish 0.6.8 → 0.6.10

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 (278) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +1 -19
  3. package/dist/{chainConfig-3sSqEVQh.js → chainConfig-DWzoOtkS.js} +439 -419
  4. package/dist/chainConfig-DWzoOtkS.js.map +1 -0
  5. package/dist/config.d.ts +5 -11
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/ensureAutomationSessionKey-h3zOmDr5.js +84 -0
  8. package/dist/ensureAutomationSessionKey-h3zOmDr5.js.map +1 -0
  9. package/dist/{ensureModularPublishBootstrap-DGBKVGg5.js → ensureModularPublishBootstrap-BImiIFJe.js} +9 -10
  10. package/dist/{ensureModularPublishBootstrap-5HJDqJJM.js.map → ensureModularPublishBootstrap-BImiIFJe.js.map} +1 -1
  11. package/dist/{ensureSmartWalletThenPublish-D5GSZRyZ.js → ensureSmartWalletThenPublish-DuOYPJFd.js} +9 -10
  12. package/dist/{ensureSmartWalletThenPublish-D5GSZRyZ.js.map → ensureSmartWalletThenPublish-DuOYPJFd.js.map} +1 -1
  13. package/dist/errors.d.ts +9 -0
  14. package/dist/errors.d.ts.map +1 -1
  15. package/dist/helpers/abi/executor.d.ts +16 -7
  16. package/dist/helpers/abi/executor.d.ts.map +1 -1
  17. package/dist/helpers/abi/factory.d.ts +11 -0
  18. package/dist/helpers/abi/factory.d.ts.map +1 -1
  19. package/dist/helpers/abi/publisher.d.ts +7 -74
  20. package/dist/helpers/abi/publisher.d.ts.map +1 -1
  21. package/dist/helpers/abi/seedExecutorRouter.d.ts +9 -1
  22. package/dist/helpers/abi/seedExecutorRouter.d.ts.map +1 -1
  23. package/dist/helpers/adapters/thirdwebAccount.d.ts.map +1 -1
  24. package/dist/helpers/chainClient.d.ts +18 -2
  25. package/dist/helpers/chainClient.d.ts.map +1 -1
  26. package/dist/helpers/contracts/index.d.ts +15 -18
  27. package/dist/helpers/contracts/index.d.ts.map +1 -1
  28. package/dist/helpers/describeRevert.d.ts +3 -2
  29. package/dist/helpers/describeRevert.d.ts.map +1 -1
  30. package/dist/helpers/enrollPublishAutomation.d.ts +2 -2
  31. package/dist/helpers/enrollPublishAutomation.d.ts.map +1 -1
  32. package/dist/helpers/ensureAutomationSessionKey.d.ts.map +1 -1
  33. package/dist/helpers/ensureExecutorModule.d.ts +28 -5
  34. package/dist/helpers/ensureExecutorModule.d.ts.map +1 -1
  35. package/dist/helpers/executorModuleReadiness.d.ts +15 -1
  36. package/dist/helpers/executorModuleReadiness.d.ts.map +1 -1
  37. package/dist/helpers/gasLog.d.ts +8 -0
  38. package/dist/helpers/gasLog.d.ts.map +1 -0
  39. package/dist/helpers/seedPaymaster.d.ts +27 -0
  40. package/dist/helpers/seedPaymaster.d.ts.map +1 -0
  41. package/dist/helpers/thirdweb.d.ts.map +1 -1
  42. package/dist/index.d.ts +3 -4
  43. package/dist/index.d.ts.map +1 -1
  44. package/dist/index.js +316 -342
  45. package/dist/index.js.map +1 -1
  46. package/dist/{managedAccountAdmin-B64V1rlU.js → managedAccountAdmin-B4HkLWWE.js} +9 -10
  47. package/dist/{managedAccountAdmin-B64V1rlU.js.map → managedAccountAdmin-B4HkLWWE.js.map} +1 -1
  48. package/dist/{publishAuthorization-CxBkijU6.js → publishAuthorization-DgDI4zor.js} +1104 -1018
  49. package/dist/publishAuthorization-DgDI4zor.js.map +1 -0
  50. package/dist/{publishThirdwebClient-CQ29pzG2.js → publishThirdwebClient-CO18ST7C.js} +2 -2
  51. package/dist/{publishThirdwebClient-CQ29pzG2.js.map → publishThirdwebClient-CO18ST7C.js.map} +1 -1
  52. package/dist/{resolveRevokeAccount-CehU81k6.js → resolveRevokeAccount-DsNod8ti.js} +11 -11
  53. package/dist/{resolveRevokeAccount-B5iXpuRT.js.map → resolveRevokeAccount-DsNod8ti.js.map} +1 -1
  54. package/dist/thirdweb.d.ts +2 -1
  55. package/dist/thirdweb.d.ts.map +1 -1
  56. package/dist/thirdweb.js +155 -156
  57. package/dist/thirdweb.js.map +1 -1
  58. package/dist/{worker-2dUZSapK.js → worker-CN7zg73B.js} +2 -2
  59. package/dist/{worker-2dUZSapK.js.map → worker-CN7zg73B.js.map} +1 -1
  60. package/package.json +6 -6
  61. package/dist/chainConfig-3sSqEVQh.js.map +0 -1
  62. package/dist/chainConfig-3wlYarAG.js +0 -1433
  63. package/dist/chainConfig-3wlYarAG.js.map +0 -1
  64. package/dist/chainConfig-BRcsMopd.js +0 -1442
  65. package/dist/chainConfig-BRcsMopd.js.map +0 -1
  66. package/dist/chainConfig-BYm5OXpk.js +0 -1433
  67. package/dist/chainConfig-BYm5OXpk.js.map +0 -1
  68. package/dist/chainConfig-CfVGYAsY.js +0 -1311
  69. package/dist/chainConfig-CfVGYAsY.js.map +0 -1
  70. package/dist/chainConfig-DDA4YmAB.js +0 -1424
  71. package/dist/chainConfig-DDA4YmAB.js.map +0 -1
  72. package/dist/config-BA9la8B6.js +0 -941
  73. package/dist/config-BA9la8B6.js.map +0 -1
  74. package/dist/config-BqguD2Tt.js +0 -806
  75. package/dist/config-BqguD2Tt.js.map +0 -1
  76. package/dist/config-CPBd5C_b.js +0 -1201
  77. package/dist/config-CPBd5C_b.js.map +0 -1
  78. package/dist/config-DkIapO94.js +0 -955
  79. package/dist/config-DkIapO94.js.map +0 -1
  80. package/dist/config-EQZZNH9H.js +0 -955
  81. package/dist/config-EQZZNH9H.js.map +0 -1
  82. package/dist/config-qjpaJcBA.js +0 -947
  83. package/dist/config-qjpaJcBA.js.map +0 -1
  84. package/dist/deploy-BJYwLfz-.js +0 -15
  85. package/dist/deploy-BJYwLfz-.js.map +0 -1
  86. package/dist/enrollPublishAutomation-DYQMoylY.js +0 -3422
  87. package/dist/enrollPublishAutomation-DYQMoylY.js.map +0 -1
  88. package/dist/ensureAutomationSessionKey-BMHLKfjj.js +0 -85
  89. package/dist/ensureAutomationSessionKey-BMHLKfjj.js.map +0 -1
  90. package/dist/ensureAutomationSessionKey-BZ9_3FMW.js +0 -86
  91. package/dist/ensureAutomationSessionKey-BZ9_3FMW.js.map +0 -1
  92. package/dist/ensureAutomationSessionKey-Bq0PaTYE.js +0 -84
  93. package/dist/ensureAutomationSessionKey-Bq0PaTYE.js.map +0 -1
  94. package/dist/ensureAutomationSessionKey-C8D7BFjU.js +0 -85
  95. package/dist/ensureAutomationSessionKey-C8D7BFjU.js.map +0 -1
  96. package/dist/ensureAutomationSessionKey-CClLVX2w.js +0 -85
  97. package/dist/ensureAutomationSessionKey-CClLVX2w.js.map +0 -1
  98. package/dist/ensureAutomationSessionKey-CNNN1jBQ.js +0 -85
  99. package/dist/ensureAutomationSessionKey-CNNN1jBQ.js.map +0 -1
  100. package/dist/ensureAutomationSessionKey-D8Gki6U6.js +0 -85
  101. package/dist/ensureAutomationSessionKey-D8Gki6U6.js.map +0 -1
  102. package/dist/ensureAutomationSessionKey-DEH7nwUc.js +0 -86
  103. package/dist/ensureAutomationSessionKey-DEH7nwUc.js.map +0 -1
  104. package/dist/ensureAutomationSessionKey-DKriW4Hr.js +0 -85
  105. package/dist/ensureAutomationSessionKey-DKriW4Hr.js.map +0 -1
  106. package/dist/ensureAutomationSessionKey-Dhvbii2M.js +0 -86
  107. package/dist/ensureAutomationSessionKey-Dhvbii2M.js.map +0 -1
  108. package/dist/ensureAutomationSessionKey-Dyfk8qVp.js +0 -85
  109. package/dist/ensureAutomationSessionKey-Dyfk8qVp.js.map +0 -1
  110. package/dist/ensureModularPublishBootstrap-5HJDqJJM.js +0 -24
  111. package/dist/ensureModularPublishBootstrap-BW8jKN_A.js +0 -24
  112. package/dist/ensureModularPublishBootstrap-BW8jKN_A.js.map +0 -1
  113. package/dist/ensureModularPublishBootstrap-Btih5xbB.js +0 -129
  114. package/dist/ensureModularPublishBootstrap-Btih5xbB.js.map +0 -1
  115. package/dist/ensureModularPublishBootstrap-C8wdnH1P.js +0 -128
  116. package/dist/ensureModularPublishBootstrap-C8wdnH1P.js.map +0 -1
  117. package/dist/ensureModularPublishBootstrap-CI4U08Gc.js +0 -129
  118. package/dist/ensureModularPublishBootstrap-CI4U08Gc.js.map +0 -1
  119. package/dist/ensureModularPublishBootstrap-CcU-hXll.js +0 -128
  120. package/dist/ensureModularPublishBootstrap-CcU-hXll.js.map +0 -1
  121. package/dist/ensureModularPublishBootstrap-CdrykHAi.js +0 -24
  122. package/dist/ensureModularPublishBootstrap-CdrykHAi.js.map +0 -1
  123. package/dist/ensureModularPublishBootstrap-DGBKVGg5.js.map +0 -1
  124. package/dist/ensureModularPublishBootstrap-DaREOqSc.js +0 -129
  125. package/dist/ensureModularPublishBootstrap-DaREOqSc.js.map +0 -1
  126. package/dist/ensureModularPublishBootstrap-DxIG-LUP.js +0 -24
  127. package/dist/ensureModularPublishBootstrap-DxIG-LUP.js.map +0 -1
  128. package/dist/ensureModularPublishBootstrap-Jm1AAqBo.js +0 -127
  129. package/dist/ensureModularPublishBootstrap-Jm1AAqBo.js.map +0 -1
  130. package/dist/ensureSessionKey-D2Lq-56x.js +0 -363
  131. package/dist/ensureSessionKey-D2Lq-56x.js.map +0 -1
  132. package/dist/ensureSmartWalletThenPublish-BFPugsKJ.js +0 -48
  133. package/dist/ensureSmartWalletThenPublish-BFPugsKJ.js.map +0 -1
  134. package/dist/ensureSmartWalletThenPublish-BSYzckyS.js +0 -49
  135. package/dist/ensureSmartWalletThenPublish-BSYzckyS.js.map +0 -1
  136. package/dist/ensureSmartWalletThenPublish-Bf8FN1un.js +0 -49
  137. package/dist/ensureSmartWalletThenPublish-Bf8FN1un.js.map +0 -1
  138. package/dist/ensureSmartWalletThenPublish-Bl415Ss6.js +0 -48
  139. package/dist/ensureSmartWalletThenPublish-Bl415Ss6.js.map +0 -1
  140. package/dist/ensureSmartWalletThenPublish-Bmm5Fpat.js +0 -49
  141. package/dist/ensureSmartWalletThenPublish-Bmm5Fpat.js.map +0 -1
  142. package/dist/ensureSmartWalletThenPublish-CE7acryB.js +0 -49
  143. package/dist/ensureSmartWalletThenPublish-CE7acryB.js.map +0 -1
  144. package/dist/ensureSmartWalletThenPublish-DAomriGc.js +0 -48
  145. package/dist/ensureSmartWalletThenPublish-DAomriGc.js.map +0 -1
  146. package/dist/ensureSmartWalletThenPublish-DaZf3q5S.js +0 -48
  147. package/dist/ensureSmartWalletThenPublish-DaZf3q5S.js.map +0 -1
  148. package/dist/ensureSmartWalletThenPublish-ekb0xJRn.js +0 -48
  149. package/dist/ensureSmartWalletThenPublish-ekb0xJRn.js.map +0 -1
  150. package/dist/ensureSmartWalletThenPublish-v5fhvKxZ.js +0 -48
  151. package/dist/ensureSmartWalletThenPublish-v5fhvKxZ.js.map +0 -1
  152. package/dist/errors-Du3LNbJN.js +0 -70
  153. package/dist/errors-Du3LNbJN.js.map +0 -1
  154. package/dist/errors-PZAaDlkq.js +0 -79
  155. package/dist/errors-PZAaDlkq.js.map +0 -1
  156. package/dist/helpers/adapters/managedAccountTxSender.d.ts +0 -21
  157. package/dist/helpers/adapters/managedAccountTxSender.d.ts.map +0 -1
  158. package/dist/helpers/modularAccount/abi.d.ts +0 -173
  159. package/dist/helpers/modularAccount/abi.d.ts.map +0 -1
  160. package/dist/helpers/modularAccount/deploy.d.ts +0 -13
  161. package/dist/helpers/modularAccount/deploy.d.ts.map +0 -1
  162. package/dist/helpers/modularAccount/eip712.d.ts +0 -30
  163. package/dist/helpers/modularAccount/eip712.d.ts.map +0 -1
  164. package/dist/helpers/modularAccount/encode.d.ts +0 -16
  165. package/dist/helpers/modularAccount/encode.d.ts.map +0 -1
  166. package/dist/helpers/modularAccount/ensureModule.d.ts +0 -10
  167. package/dist/helpers/modularAccount/ensureModule.d.ts.map +0 -1
  168. package/dist/helpers/modularAccount/ensureSessionKey.d.ts +0 -25
  169. package/dist/helpers/modularAccount/ensureSessionKey.d.ts.map +0 -1
  170. package/dist/helpers/modularAccount/index.d.ts +0 -9
  171. package/dist/helpers/modularAccount/index.d.ts.map +0 -1
  172. package/dist/helpers/modularAccount/permissions.d.ts +0 -32
  173. package/dist/helpers/modularAccount/permissions.d.ts.map +0 -1
  174. package/dist/helpers/modularAccount/reads.d.ts +0 -28
  175. package/dist/helpers/modularAccount/reads.d.ts.map +0 -1
  176. package/dist/helpers/thirdwebEnrollPublishAutomation.d.ts +0 -31
  177. package/dist/helpers/thirdwebEnrollPublishAutomation.d.ts.map +0 -1
  178. package/dist/helpers/thirdwebModularBootstrap.d.ts +0 -8
  179. package/dist/helpers/thirdwebModularBootstrap.d.ts.map +0 -1
  180. package/dist/helpers/transformPayloadToIntegerIds.d.ts +0 -34
  181. package/dist/helpers/transformPayloadToIntegerIds.d.ts.map +0 -1
  182. package/dist/managedAccountAdmin-BVLGWpEb.js +0 -29
  183. package/dist/managedAccountAdmin-BVLGWpEb.js.map +0 -1
  184. package/dist/managedAccountAdmin-Bje6X8Ds.js +0 -29
  185. package/dist/managedAccountAdmin-Bje6X8Ds.js.map +0 -1
  186. package/dist/managedAccountAdmin-C84-IlQ9.js +0 -29
  187. package/dist/managedAccountAdmin-C84-IlQ9.js.map +0 -1
  188. package/dist/managedAccountAdmin-DhCRBoPX.js +0 -29
  189. package/dist/managedAccountAdmin-DhCRBoPX.js.map +0 -1
  190. package/dist/publishAuthorization-B0G1em4a.js +0 -3695
  191. package/dist/publishAuthorization-B0G1em4a.js.map +0 -1
  192. package/dist/publishAuthorization-B1BVVfp0.js +0 -3604
  193. package/dist/publishAuthorization-B1BVVfp0.js.map +0 -1
  194. package/dist/publishAuthorization-Bltn3y_K.js +0 -3599
  195. package/dist/publishAuthorization-Bltn3y_K.js.map +0 -1
  196. package/dist/publishAuthorization-By2Tt9kW.js +0 -3912
  197. package/dist/publishAuthorization-By2Tt9kW.js.map +0 -1
  198. package/dist/publishAuthorization-CSN2FsQk.js +0 -3479
  199. package/dist/publishAuthorization-CSN2FsQk.js.map +0 -1
  200. package/dist/publishAuthorization-CxBkijU6.js.map +0 -1
  201. package/dist/publishAuthorization-CxWY7lAQ.js +0 -3706
  202. package/dist/publishAuthorization-CxWY7lAQ.js.map +0 -1
  203. package/dist/publishAuthorization-DEriY_jm.js +0 -3687
  204. package/dist/publishAuthorization-DEriY_jm.js.map +0 -1
  205. package/dist/publishAuthorization-DfAQs1sN.js +0 -3707
  206. package/dist/publishAuthorization-DfAQs1sN.js.map +0 -1
  207. package/dist/publishAuthorization-DgdmgLTa.js +0 -3520
  208. package/dist/publishAuthorization-DgdmgLTa.js.map +0 -1
  209. package/dist/publishAuthorization-DqhhCAhd.js +0 -3652
  210. package/dist/publishAuthorization-DqhhCAhd.js.map +0 -1
  211. package/dist/publishThirdwebClient-BdgkcqM7.js +0 -18
  212. package/dist/publishThirdwebClient-BdgkcqM7.js.map +0 -1
  213. package/dist/publishThirdwebClient-BkmDN480.js +0 -18
  214. package/dist/publishThirdwebClient-BkmDN480.js.map +0 -1
  215. package/dist/publishThirdwebClient-BnDhP3N-.js +0 -18
  216. package/dist/publishThirdwebClient-BnDhP3N-.js.map +0 -1
  217. package/dist/publishThirdwebClient-CZIVmr9Z.js +0 -18
  218. package/dist/publishThirdwebClient-CZIVmr9Z.js.map +0 -1
  219. package/dist/publishThirdwebClient-DroRrOFQ.js +0 -18
  220. package/dist/publishThirdwebClient-DroRrOFQ.js.map +0 -1
  221. package/dist/publishThirdwebClient-DzXFjQ7L.js +0 -18
  222. package/dist/publishThirdwebClient-DzXFjQ7L.js.map +0 -1
  223. package/dist/publishThirdwebClient-Dzb2vcEs.js +0 -18
  224. package/dist/publishThirdwebClient-Dzb2vcEs.js.map +0 -1
  225. package/dist/publishThirdwebClient-i8P7fivi.js +0 -18
  226. package/dist/publishThirdwebClient-i8P7fivi.js.map +0 -1
  227. package/dist/publishWalletRegistry-Cugh691z.js +0 -37
  228. package/dist/publishWalletRegistry-Cugh691z.js.map +0 -1
  229. package/dist/resolveRevokeAccount-B5iXpuRT.js +0 -38
  230. package/dist/resolveRevokeAccount-B7ImSb4Y.js +0 -38
  231. package/dist/resolveRevokeAccount-B7ImSb4Y.js.map +0 -1
  232. package/dist/resolveRevokeAccount-BEhKQBTm.js +0 -38
  233. package/dist/resolveRevokeAccount-BEhKQBTm.js.map +0 -1
  234. package/dist/resolveRevokeAccount-BM1j2l5Q.js +0 -38
  235. package/dist/resolveRevokeAccount-BM1j2l5Q.js.map +0 -1
  236. package/dist/resolveRevokeAccount-BtVG0xxc.js +0 -38
  237. package/dist/resolveRevokeAccount-BtVG0xxc.js.map +0 -1
  238. package/dist/resolveRevokeAccount-CJZZdBcQ.js +0 -39
  239. package/dist/resolveRevokeAccount-CJZZdBcQ.js.map +0 -1
  240. package/dist/resolveRevokeAccount-CaIMuCee.js +0 -39
  241. package/dist/resolveRevokeAccount-CaIMuCee.js.map +0 -1
  242. package/dist/resolveRevokeAccount-CehU81k6.js.map +0 -1
  243. package/dist/resolveRevokeAccount-Cg4TQgnd.js +0 -38
  244. package/dist/resolveRevokeAccount-Cg4TQgnd.js.map +0 -1
  245. package/dist/resolveRevokeAccount-DHnxtEIj.js +0 -39
  246. package/dist/resolveRevokeAccount-DHnxtEIj.js.map +0 -1
  247. package/dist/resolveRevokeAccount-S-2WXkNh.js +0 -38
  248. package/dist/resolveRevokeAccount-S-2WXkNh.js.map +0 -1
  249. package/dist/resolveRevokeAccount-yWARIv9i.js +0 -38
  250. package/dist/resolveRevokeAccount-yWARIv9i.js.map +0 -1
  251. package/dist/seedSigner-CFzMD7Rb.js +0 -66
  252. package/dist/seedSigner-CFzMD7Rb.js.map +0 -1
  253. package/dist/thirdweb-BoksPRz3.js +0 -194
  254. package/dist/thirdweb-BoksPRz3.js.map +0 -1
  255. package/dist/thirdwebAccount-C2iOcp4_.js +0 -59
  256. package/dist/thirdwebAccount-C2iOcp4_.js.map +0 -1
  257. package/dist/worker-B1PcFPLi.js +0 -69
  258. package/dist/worker-B1PcFPLi.js.map +0 -1
  259. package/dist/worker-B8gN5WTx.js +0 -69
  260. package/dist/worker-B8gN5WTx.js.map +0 -1
  261. package/dist/worker-BCG1r0AS.js +0 -69
  262. package/dist/worker-BCG1r0AS.js.map +0 -1
  263. package/dist/worker-BgErCNTb.js +0 -69
  264. package/dist/worker-BgErCNTb.js.map +0 -1
  265. package/dist/worker-C07rPV2G.js +0 -69
  266. package/dist/worker-C07rPV2G.js.map +0 -1
  267. package/dist/worker-C9Za_dlQ.js +0 -69
  268. package/dist/worker-C9Za_dlQ.js.map +0 -1
  269. package/dist/worker-CEgulQnm.js +0 -69
  270. package/dist/worker-CEgulQnm.js.map +0 -1
  271. package/dist/worker-C_TL94He.js +0 -69
  272. package/dist/worker-C_TL94He.js.map +0 -1
  273. package/dist/worker-DBC_g-3I.js +0 -69
  274. package/dist/worker-DBC_g-3I.js.map +0 -1
  275. package/dist/worker-DypHzXgH.js +0 -69
  276. package/dist/worker-DypHzXgH.js.map +0 -1
  277. package/dist/worker-ZL4Wg19t.js +0 -69
  278. package/dist/worker-ZL4Wg19t.js.map +0 -1
@@ -1,85 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { $ as t, _ as n, ct as r, ot as i, t as a } from "./chainConfig-3sSqEVQh.js";
3
- import { r as o } from "./errors-Du3LNbJN.js";
4
- import { M as s, d as c, p as l } from "./publishAuthorization-By2Tt9kW.js";
5
- import { t as u } from "./publishThirdwebClient-BdgkcqM7.js";
6
- import { getContract as d, sendTransaction as f } from "thirdweb";
7
- import { addSessionKey as p, removeSessionKey as m, shouldUpdateSessionKey as h } from "thirdweb/extensions/erc4337";
8
- //#region src/helpers/ensureAutomationSessionKey.ts
9
- var g = /* @__PURE__ */ e({
10
- ensureAutomationSessionKey: () => x,
11
- isAutomationSessionActive: () => C,
12
- removeAutomationSessionKey: () => S
13
- }), _ = () => `Could not connect the managed publishing account to authorize an automation session key on ${a()}. Reconnect and try again.`, v = () => `Could not authorize the automation session key on your publishing account on ${a()}.`, y = () => `Could not remove the automation session key from your publishing account on ${a()}.`;
14
- async function b(e) {
15
- let t = s();
16
- await t.autoConnect({
17
- client: u(),
18
- chain: n()
19
- });
20
- let r = t.getAccount();
21
- if (!r) throw new o(_(), "MODULAR_SIGNER_ACTIVATION_FAILED", e);
22
- return r;
23
- }
24
- async function x(e) {
25
- let { managedAddress: t, sessionKeyAddress: i, expiresAt: a } = e, s = await b(t), m = d({
26
- client: u(),
27
- chain: n(),
28
- address: t
29
- }), g = l(c({ expiresAt: a })), _ = !1;
30
- try {
31
- _ = await h({
32
- accountContract: m,
33
- sessionKeyAddress: i,
34
- newPermissions: g
35
- });
36
- } catch (e) {
37
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
38
- }
39
- if (_) try {
40
- let e = p({
41
- contract: m,
42
- account: s,
43
- sessionKeyAddress: i,
44
- permissions: g
45
- }), t = await f({
46
- account: s,
47
- transaction: e
48
- });
49
- await r(t.transactionHash);
50
- } catch (e) {
51
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
52
- }
53
- if (!await C(t, i)) throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t);
54
- }
55
- async function S(e) {
56
- let { managedAddress: t, sessionKeyAddress: i } = e, a = await b(t), s = d({
57
- client: u(),
58
- chain: n(),
59
- address: t
60
- });
61
- try {
62
- let e = m({
63
- contract: s,
64
- account: a,
65
- sessionKeyAddress: i
66
- }), t = await f({
67
- account: a,
68
- transaction: e
69
- });
70
- await r(t.transactionHash);
71
- } catch (e) {
72
- throw new o(y(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
73
- }
74
- }
75
- async function C(e, n) {
76
- try {
77
- return await i(e) ? await t(e, n) : !1;
78
- } catch (t) {
79
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", e, t);
80
- }
81
- }
82
- //#endregion
83
- export { S as i, g as n, C as r, x as t };
84
-
85
- //# sourceMappingURL=ensureAutomationSessionKey-BMHLKfjj.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureAutomationSessionKey-BMHLKfjj.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, 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 const active = await isAutomationSessionActive(managedAddress, sessionKeyAddress)\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;CAIF,IAAI,CAAC,MADgB,EAA0B,GAAgB,CAAiB,GAE9E,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,86 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { G as t, U as n, z as r } from "./config-DkIapO94.js";
3
- import { r as i } from "./errors-Du3LNbJN.js";
4
- import { A as a, d as o, p as s } from "./publishAuthorization-B1BVVfp0.js";
5
- import { t as c } from "./publishThirdwebClient-BkmDN480.js";
6
- import { getContract as l, sendTransaction as u } from "thirdweb";
7
- import { optimismSepolia as d } from "thirdweb/chains";
8
- import { addSessionKey as f, removeSessionKey as p, shouldUpdateSessionKey as m } from "thirdweb/extensions/erc4337";
9
- //#region src/helpers/ensureAutomationSessionKey.ts
10
- var h = /* @__PURE__ */ e({
11
- ensureAutomationSessionKey: () => b,
12
- isAutomationSessionActive: () => S,
13
- removeAutomationSessionKey: () => x
14
- }), g = "Could not connect the managed publishing account to authorize an automation session key on Optimism Sepolia. Reconnect and try again.", _ = "Could not authorize the automation session key on your publishing account on Optimism Sepolia.", v = "Could not remove the automation session key from your publishing account on Optimism Sepolia.";
15
- async function y(e) {
16
- let t = a();
17
- await t.autoConnect({
18
- client: c(),
19
- chain: d
20
- });
21
- let n = t.getAccount();
22
- if (!n) throw new i(g, "MODULAR_SIGNER_ACTIVATION_FAILED", e);
23
- return n;
24
- }
25
- async function b(e) {
26
- let { managedAddress: n, sessionKeyAddress: r, expiresAt: a } = e, p = await y(n), h = l({
27
- client: c(),
28
- chain: d,
29
- address: n
30
- }), g = s(o({ expiresAt: a })), v = !1;
31
- try {
32
- v = await m({
33
- accountContract: h,
34
- sessionKeyAddress: r,
35
- newPermissions: g
36
- });
37
- } catch (e) {
38
- throw new i(_, "MODULAR_SIGNER_ACTIVATION_FAILED", n, e);
39
- }
40
- if (v) try {
41
- let e = f({
42
- contract: h,
43
- account: p,
44
- sessionKeyAddress: r,
45
- permissions: g
46
- }), n = await u({
47
- account: p,
48
- transaction: e
49
- });
50
- await t(n.transactionHash);
51
- } catch (e) {
52
- throw new i(_, "MODULAR_SIGNER_ACTIVATION_FAILED", n, e);
53
- }
54
- if (!await S(n, r)) throw new i(_, "MODULAR_SIGNER_ACTIVATION_FAILED", n);
55
- }
56
- async function x(e) {
57
- let { managedAddress: n, sessionKeyAddress: r } = e, a = await y(n), o = l({
58
- client: c(),
59
- chain: d,
60
- address: n
61
- });
62
- try {
63
- let e = p({
64
- contract: o,
65
- account: a,
66
- sessionKeyAddress: r
67
- }), n = await u({
68
- account: a,
69
- transaction: e
70
- });
71
- await t(n.transactionHash);
72
- } catch (e) {
73
- throw new i(v, "MODULAR_SIGNER_ACTIVATION_FAILED", n, e);
74
- }
75
- }
76
- async function S(e, t) {
77
- try {
78
- return await n(e) ? await r(e, t) : !1;
79
- } catch (t) {
80
- throw new i(_, "MODULAR_SIGNER_ACTIVATION_FAILED", e, t);
81
- }
82
- }
83
- //#endregion
84
- export { x as i, h as n, S as r, b as t };
85
-
86
- //# sourceMappingURL=ensureAutomationSessionKey-BZ9_3FMW.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureAutomationSessionKey-BZ9_3FMW.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 { optimismSepolia } from 'thirdweb/chains'\nimport type { Address } from 'viem'\nimport { ManagedAccountPublishError } from '../errors'\nimport { isContractDeployed, waitForPublishReceipt } from './chainClient'\nimport { readIsActiveSigner } from './contracts'\nimport {\n buildAutomationSessionKeyPermissions,\n toThirdwebSessionKeyPermissions,\n} from './automationSessionKeyPermissions'\nimport { getClient, getManagedAccountWallet } from './thirdweb'\n\nconst MSG_UNAVAILABLE =\n 'Could not connect the managed publishing account to authorize an automation session key on Optimism Sepolia. Reconnect and try again.'\nconst MSG_ACTIVATION_FAILED =\n 'Could not authorize the automation session key on your publishing account on Optimism Sepolia.'\nconst MSG_REMOVAL_FAILED =\n 'Could not remove the automation session key from your publishing account on Optimism Sepolia.'\n\nasync function getManagedAccountForSessionKeyAdmin(managedAddress: string) {\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: optimismSepolia })\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: optimismSepolia,\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 const active = await isAutomationSessionActive(managedAddress, sessionKeyAddress)\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: optimismSepolia,\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":";;;;;;;;;;;;;IAiBM,IACJ,yIACI,IACJ,kGACI,IACJ;AAEF,eAAe,EAAoC,GAAwB;CACzE,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO;CAAgB,CAAC;CAC/E,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,GACA,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;EACP,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,GACA,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,GACA,oCACA,GACA,CACF;CACF;CAIF,IAAI,CAAC,MADgB,EAA0B,GAAgB,CAAiB,GAE9E,MAAM,IAAI,EACR,GACA,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;EACP,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,GACA,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,GACA,oCACA,GACA,CACF;CACF;AACF"}
@@ -1,84 +0,0 @@
1
- import { H as e, R as t, W as n, nt as r } from "./config-qjpaJcBA.js";
2
- import { r as i } from "./errors-Du3LNbJN.js";
3
- import { D as a, d as o, j as s, p as c } from "./publishAuthorization-CSN2FsQk.js";
4
- import { getContract as l, sendTransaction as u } from "thirdweb";
5
- import { optimismSepolia as d } from "thirdweb/chains";
6
- import { addSessionKey as f, removeSessionKey as p, shouldUpdateSessionKey as m } from "thirdweb/extensions/erc4337";
7
- //#region src/helpers/ensureAutomationSessionKey.ts
8
- var h = /* @__PURE__ */ r({
9
- ensureAutomationSessionKey: () => b,
10
- isAutomationSessionActive: () => S,
11
- removeAutomationSessionKey: () => x
12
- }), g = "Could not connect the managed publishing account to authorize an automation session key on Optimism Sepolia. Reconnect and try again.", _ = "Could not authorize the automation session key on your publishing account on Optimism Sepolia.", v = "Could not remove the automation session key from your publishing account on Optimism Sepolia.";
13
- async function y(e) {
14
- let t = s();
15
- await t.autoConnect({
16
- client: a(),
17
- chain: d
18
- });
19
- let n = t.getAccount();
20
- if (!n) throw new i(g, "MODULAR_SIGNER_ACTIVATION_FAILED", e);
21
- return n;
22
- }
23
- async function b(e) {
24
- let { managedAddress: t, sessionKeyAddress: r, expiresAt: s } = e, p = await y(t), h = l({
25
- client: a(),
26
- chain: d,
27
- address: t
28
- }), g = c(o({ expiresAt: s })), v = !1;
29
- try {
30
- v = await m({
31
- accountContract: h,
32
- sessionKeyAddress: r,
33
- newPermissions: g
34
- });
35
- } catch (e) {
36
- throw new i(_, "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
37
- }
38
- if (v) try {
39
- let e = f({
40
- contract: h,
41
- account: p,
42
- sessionKeyAddress: r,
43
- permissions: g
44
- }), t = await u({
45
- account: p,
46
- transaction: e
47
- });
48
- await n(t.transactionHash);
49
- } catch (e) {
50
- throw new i(_, "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
51
- }
52
- if (!await S(t, r)) throw new i(_, "MODULAR_SIGNER_ACTIVATION_FAILED", t);
53
- }
54
- async function x(e) {
55
- let { managedAddress: t, sessionKeyAddress: r } = e, o = await y(t), s = l({
56
- client: a(),
57
- chain: d,
58
- address: t
59
- });
60
- try {
61
- let e = p({
62
- contract: s,
63
- account: o,
64
- sessionKeyAddress: r
65
- }), t = await u({
66
- account: o,
67
- transaction: e
68
- });
69
- await n(t.transactionHash);
70
- } catch (e) {
71
- throw new i(v, "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
72
- }
73
- }
74
- async function S(n, r) {
75
- try {
76
- return await e(n) ? await t(n, r) : !1;
77
- } catch (e) {
78
- throw new i(_, "MODULAR_SIGNER_ACTIVATION_FAILED", n, e);
79
- }
80
- }
81
- //#endregion
82
- export { x as i, h as n, S as r, b as t };
83
-
84
- //# sourceMappingURL=ensureAutomationSessionKey-Bq0PaTYE.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureAutomationSessionKey-Bq0PaTYE.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 { optimismSepolia } from 'thirdweb/chains'\nimport type { Address } from 'viem'\nimport { ManagedAccountPublishError } from '../errors'\nimport { isContractDeployed, waitForPublishReceipt } from './chainClient'\nimport { readIsActiveSigner } from './contracts'\nimport {\n buildAutomationSessionKeyPermissions,\n toThirdwebSessionKeyPermissions,\n} from './automationSessionKeyPermissions'\nimport { getClient, getManagedAccountWallet } from './thirdweb'\n\nconst MSG_UNAVAILABLE =\n 'Could not connect the managed publishing account to authorize an automation session key on Optimism Sepolia. Reconnect and try again.'\nconst MSG_ACTIVATION_FAILED =\n 'Could not authorize the automation session key on your publishing account on Optimism Sepolia.'\nconst MSG_REMOVAL_FAILED =\n 'Could not remove the automation session key from your publishing account on Optimism Sepolia.'\n\nasync function getManagedAccountForSessionKeyAdmin(managedAddress: string) {\n const managedWallet = getManagedAccountWallet()\n await managedWallet.autoConnect({ client: getClient(), chain: optimismSepolia })\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: optimismSepolia,\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 const active = await isAutomationSessionActive(managedAddress, sessionKeyAddress)\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: optimismSepolia,\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":";;;;;;;;;;;IAiBM,IACJ,yIACI,IACJ,kGACI,IACJ;AAEF,eAAe,EAAoC,GAAwB;CACzE,IAAM,IAAgB,EAAwB;CAC9C,MAAM,EAAc,YAAY;EAAE,QAAQ,EAAU;EAAG,OAAO;CAAgB,CAAC;CAC/E,IAAM,IAAiB,EAAc,WAAW;CAChD,IAAI,CAAC,GACH,MAAM,IAAI,EACR,GACA,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;EACP,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,GACA,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,GACA,oCACA,GACA,CACF;CACF;CAIF,IAAI,CAAC,MADgB,EAA0B,GAAgB,CAAiB,GAE9E,MAAM,IAAI,EACR,GACA,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;EACP,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,GACA,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,GACA,oCACA,GACA,CACF;CACF;AACF"}
@@ -1,85 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { Q as t, _ as n, at as r, st as i, t as a } from "./chainConfig-DDA4YmAB.js";
3
- import { r as o } from "./errors-Du3LNbJN.js";
4
- import { M as s, d as c, p as l } from "./publishAuthorization-B0G1em4a.js";
5
- import { t as u } from "./publishThirdwebClient-CQ29pzG2.js";
6
- import { getContract as d, sendTransaction as f } from "thirdweb";
7
- import { addSessionKey as p, removeSessionKey as m, shouldUpdateSessionKey as h } from "thirdweb/extensions/erc4337";
8
- //#region src/helpers/ensureAutomationSessionKey.ts
9
- var g = /* @__PURE__ */ e({
10
- ensureAutomationSessionKey: () => x,
11
- isAutomationSessionActive: () => C,
12
- removeAutomationSessionKey: () => S
13
- }), _ = () => `Could not connect the managed publishing account to authorize an automation session key on ${a()}. Reconnect and try again.`, v = () => `Could not authorize the automation session key on your publishing account on ${a()}.`, y = () => `Could not remove the automation session key from your publishing account on ${a()}.`;
14
- async function b(e) {
15
- let t = s();
16
- await t.autoConnect({
17
- client: u(),
18
- chain: n()
19
- });
20
- let r = t.getAccount();
21
- if (!r) throw new o(_(), "MODULAR_SIGNER_ACTIVATION_FAILED", e);
22
- return r;
23
- }
24
- async function x(e) {
25
- let { managedAddress: t, sessionKeyAddress: r, expiresAt: a } = e, s = await b(t), m = d({
26
- client: u(),
27
- chain: n(),
28
- address: t
29
- }), g = l(c({ expiresAt: a })), _ = !1;
30
- try {
31
- _ = await h({
32
- accountContract: m,
33
- sessionKeyAddress: r,
34
- newPermissions: g
35
- });
36
- } catch (e) {
37
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
38
- }
39
- if (_) try {
40
- let e = p({
41
- contract: m,
42
- account: s,
43
- sessionKeyAddress: r,
44
- permissions: g
45
- }), t = await f({
46
- account: s,
47
- transaction: e
48
- });
49
- await i(t.transactionHash);
50
- } catch (e) {
51
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
52
- }
53
- if (!await C(t, r)) throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t);
54
- }
55
- async function S(e) {
56
- let { managedAddress: t, sessionKeyAddress: r } = e, a = await b(t), s = d({
57
- client: u(),
58
- chain: n(),
59
- address: t
60
- });
61
- try {
62
- let e = m({
63
- contract: s,
64
- account: a,
65
- sessionKeyAddress: r
66
- }), t = await f({
67
- account: a,
68
- transaction: e
69
- });
70
- await i(t.transactionHash);
71
- } catch (e) {
72
- throw new o(y(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
73
- }
74
- }
75
- async function C(e, n) {
76
- try {
77
- return await r(e) ? await t(e, n) : !1;
78
- } catch (t) {
79
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", e, t);
80
- }
81
- }
82
- //#endregion
83
- export { S as i, g as n, C as r, x as t };
84
-
85
- //# sourceMappingURL=ensureAutomationSessionKey-C8D7BFjU.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureAutomationSessionKey-C8D7BFjU.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, 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 const active = await isAutomationSessionActive(managedAddress, sessionKeyAddress)\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;CAIF,IAAI,CAAC,MADgB,EAA0B,GAAgB,CAAiB,GAE9E,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,85 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { $ as t, _ as n, ct as r, ot as i, t as a } from "./chainConfig-BYm5OXpk.js";
3
- import { r as o } from "./errors-Du3LNbJN.js";
4
- import { M as s, d as c, p as l } from "./publishAuthorization-CxBkijU6.js";
5
- import { t as u } from "./publishThirdwebClient-BnDhP3N-.js";
6
- import { getContract as d, sendTransaction as f } from "thirdweb";
7
- import { addSessionKey as p, removeSessionKey as m, shouldUpdateSessionKey as h } from "thirdweb/extensions/erc4337";
8
- //#region src/helpers/ensureAutomationSessionKey.ts
9
- var g = /* @__PURE__ */ e({
10
- ensureAutomationSessionKey: () => x,
11
- isAutomationSessionActive: () => C,
12
- removeAutomationSessionKey: () => S
13
- }), _ = () => `Could not connect the managed publishing account to authorize an automation session key on ${a()}. Reconnect and try again.`, v = () => `Could not authorize the automation session key on your publishing account on ${a()}.`, y = () => `Could not remove the automation session key from your publishing account on ${a()}.`;
14
- async function b(e) {
15
- let t = s();
16
- await t.autoConnect({
17
- client: u(),
18
- chain: n()
19
- });
20
- let r = t.getAccount();
21
- if (!r) throw new o(_(), "MODULAR_SIGNER_ACTIVATION_FAILED", e);
22
- return r;
23
- }
24
- async function x(e) {
25
- let { managedAddress: t, sessionKeyAddress: i, expiresAt: a } = e, s = await b(t), m = d({
26
- client: u(),
27
- chain: n(),
28
- address: t
29
- }), g = l(c({ expiresAt: a })), _ = !1;
30
- try {
31
- _ = await h({
32
- accountContract: m,
33
- sessionKeyAddress: i,
34
- newPermissions: g
35
- });
36
- } catch (e) {
37
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
38
- }
39
- if (_) try {
40
- let e = p({
41
- contract: m,
42
- account: s,
43
- sessionKeyAddress: i,
44
- permissions: g
45
- }), t = await f({
46
- account: s,
47
- transaction: e
48
- });
49
- await r(t.transactionHash);
50
- } catch (e) {
51
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
52
- }
53
- if (!await C(t, i)) throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t);
54
- }
55
- async function S(e) {
56
- let { managedAddress: t, sessionKeyAddress: i } = e, a = await b(t), s = d({
57
- client: u(),
58
- chain: n(),
59
- address: t
60
- });
61
- try {
62
- let e = m({
63
- contract: s,
64
- account: a,
65
- sessionKeyAddress: i
66
- }), t = await f({
67
- account: a,
68
- transaction: e
69
- });
70
- await r(t.transactionHash);
71
- } catch (e) {
72
- throw new o(y(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
73
- }
74
- }
75
- async function C(e, n) {
76
- try {
77
- return await i(e) ? await t(e, n) : !1;
78
- } catch (t) {
79
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", e, t);
80
- }
81
- }
82
- //#endregion
83
- export { S as i, g as n, C as r, x as t };
84
-
85
- //# sourceMappingURL=ensureAutomationSessionKey-CClLVX2w.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureAutomationSessionKey-CClLVX2w.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, 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 const active = await isAutomationSessionActive(managedAddress, sessionKeyAddress)\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;CAIF,IAAI,CAAC,MADgB,EAA0B,GAAgB,CAAiB,GAE9E,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,85 +0,0 @@
1
- import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { Q as t, _ as n, at as r, st as i, t as a } from "./chainConfig-BRcsMopd.js";
3
- import { r as o } from "./errors-Du3LNbJN.js";
4
- import { M as s, d as c, p as l } from "./publishAuthorization-CxWY7lAQ.js";
5
- import { t as u } from "./publishThirdwebClient-Dzb2vcEs.js";
6
- import { getContract as d, sendTransaction as f } from "thirdweb";
7
- import { addSessionKey as p, removeSessionKey as m, shouldUpdateSessionKey as h } from "thirdweb/extensions/erc4337";
8
- //#region src/helpers/ensureAutomationSessionKey.ts
9
- var g = /* @__PURE__ */ e({
10
- ensureAutomationSessionKey: () => x,
11
- isAutomationSessionActive: () => C,
12
- removeAutomationSessionKey: () => S
13
- }), _ = () => `Could not connect the managed publishing account to authorize an automation session key on ${a()}. Reconnect and try again.`, v = () => `Could not authorize the automation session key on your publishing account on ${a()}.`, y = () => `Could not remove the automation session key from your publishing account on ${a()}.`;
14
- async function b(e) {
15
- let t = s();
16
- await t.autoConnect({
17
- client: u(),
18
- chain: n()
19
- });
20
- let r = t.getAccount();
21
- if (!r) throw new o(_(), "MODULAR_SIGNER_ACTIVATION_FAILED", e);
22
- return r;
23
- }
24
- async function x(e) {
25
- let { managedAddress: t, sessionKeyAddress: r, expiresAt: a } = e, s = await b(t), m = d({
26
- client: u(),
27
- chain: n(),
28
- address: t
29
- }), g = l(c({ expiresAt: a })), _ = !1;
30
- try {
31
- _ = await h({
32
- accountContract: m,
33
- sessionKeyAddress: r,
34
- newPermissions: g
35
- });
36
- } catch (e) {
37
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
38
- }
39
- if (_) try {
40
- let e = p({
41
- contract: m,
42
- account: s,
43
- sessionKeyAddress: r,
44
- permissions: g
45
- }), t = await f({
46
- account: s,
47
- transaction: e
48
- });
49
- await i(t.transactionHash);
50
- } catch (e) {
51
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
52
- }
53
- if (!await C(t, r)) throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", t);
54
- }
55
- async function S(e) {
56
- let { managedAddress: t, sessionKeyAddress: r } = e, a = await b(t), s = d({
57
- client: u(),
58
- chain: n(),
59
- address: t
60
- });
61
- try {
62
- let e = m({
63
- contract: s,
64
- account: a,
65
- sessionKeyAddress: r
66
- }), t = await f({
67
- account: a,
68
- transaction: e
69
- });
70
- await i(t.transactionHash);
71
- } catch (e) {
72
- throw new o(y(), "MODULAR_SIGNER_ACTIVATION_FAILED", t, e);
73
- }
74
- }
75
- async function C(e, n) {
76
- try {
77
- return await r(e) ? await t(e, n) : !1;
78
- } catch (t) {
79
- throw new o(v(), "MODULAR_SIGNER_ACTIVATION_FAILED", e, t);
80
- }
81
- }
82
- //#endregion
83
- export { S as i, g as n, C as r, x as t };
84
-
85
- //# sourceMappingURL=ensureAutomationSessionKey-CNNN1jBQ.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ensureAutomationSessionKey-CNNN1jBQ.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, 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 const active = await isAutomationSessionActive(managedAddress, sessionKeyAddress)\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;CAIF,IAAI,CAAC,MADgB,EAA0B,GAAgB,CAAiB,GAE9E,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"}