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