@seedprotocol/publish 0.6.7 → 0.6.8

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