@seedprotocol/publish 0.4.32 → 0.5.1

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 (193) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/README.md +64 -18
  3. package/dist/config-Q3y4Fab2.js +936 -0
  4. package/dist/config-Q3y4Fab2.js.map +1 -0
  5. package/dist/config-bUKEs4Uf.js +511 -0
  6. package/dist/config-bUKEs4Uf.js.map +1 -0
  7. package/dist/config.d.ts +42 -4
  8. package/dist/config.d.ts.map +1 -1
  9. package/dist/ensureManagedAccountEasConfigured-BXF7gQCi.js +1270 -0
  10. package/dist/ensureManagedAccountEasConfigured-BXF7gQCi.js.map +1 -0
  11. package/dist/ensureManagedAccountEasConfigured-BxdK_Vhf.js +1204 -0
  12. package/dist/ensureManagedAccountEasConfigured-BxdK_Vhf.js.map +1 -0
  13. package/dist/ensureManagedAccountEasConfigured-CZGguM7q.js +1177 -0
  14. package/dist/ensureManagedAccountEasConfigured-CZGguM7q.js.map +1 -0
  15. package/dist/ensureManagedAccountEasConfigured-CZS__-ha.js +1177 -0
  16. package/dist/ensureManagedAccountEasConfigured-CZS__-ha.js.map +1 -0
  17. package/dist/ensureManagedAccountEasConfigured-D2_Jjjxt.js +1192 -0
  18. package/dist/ensureManagedAccountEasConfigured-D2_Jjjxt.js.map +1 -0
  19. package/dist/ensureManagedAccountEasConfigured-DDFBEb-B.js +1192 -0
  20. package/dist/ensureManagedAccountEasConfigured-DDFBEb-B.js.map +1 -0
  21. package/dist/ensureManagedAccountEasConfigured-zcyqhWPe.js +1270 -0
  22. package/dist/ensureManagedAccountEasConfigured-zcyqhWPe.js.map +1 -0
  23. package/dist/ensureModularPublishBootstrap-2agkGdih.js +124 -0
  24. package/dist/ensureModularPublishBootstrap-2agkGdih.js.map +1 -0
  25. package/dist/ensureModularPublishBootstrap-B5i_dQrv.js +124 -0
  26. package/dist/ensureModularPublishBootstrap-B5i_dQrv.js.map +1 -0
  27. package/dist/ensureModularPublishBootstrap-BSXyZgld.js +124 -0
  28. package/dist/ensureModularPublishBootstrap-BSXyZgld.js.map +1 -0
  29. package/dist/ensureModularPublishBootstrap-C0gx7sbt.js +124 -0
  30. package/dist/ensureModularPublishBootstrap-C0gx7sbt.js.map +1 -0
  31. package/dist/ensureModularPublishBootstrap-DHNo4j6X.js +124 -0
  32. package/dist/ensureModularPublishBootstrap-DHNo4j6X.js.map +1 -0
  33. package/dist/ensureModularPublishBootstrap-DQ-oruO1.js +124 -0
  34. package/dist/ensureModularPublishBootstrap-DQ-oruO1.js.map +1 -0
  35. package/dist/ensureModularPublishBootstrap-QRGGgnkz.js +124 -0
  36. package/dist/ensureModularPublishBootstrap-QRGGgnkz.js.map +1 -0
  37. package/dist/ensureSmartWalletThenPublish-BmeIFGIX.js +47 -0
  38. package/dist/ensureSmartWalletThenPublish-BmeIFGIX.js.map +1 -0
  39. package/dist/ensureSmartWalletThenPublish-CR4N0M9S.js +47 -0
  40. package/dist/ensureSmartWalletThenPublish-CR4N0M9S.js.map +1 -0
  41. package/dist/ensureSmartWalletThenPublish-CRza0sML.js +47 -0
  42. package/dist/ensureSmartWalletThenPublish-CRza0sML.js.map +1 -0
  43. package/dist/ensureSmartWalletThenPublish-DzOnwM-9.js +47 -0
  44. package/dist/ensureSmartWalletThenPublish-DzOnwM-9.js.map +1 -0
  45. package/dist/ensureSmartWalletThenPublish-UFczP8th.js +47 -0
  46. package/dist/ensureSmartWalletThenPublish-UFczP8th.js.map +1 -0
  47. package/dist/ensureSmartWalletThenPublish-k085lqDO.js +47 -0
  48. package/dist/ensureSmartWalletThenPublish-k085lqDO.js.map +1 -0
  49. package/dist/ensureSmartWalletThenPublish-xcHGv06S.js +47 -0
  50. package/dist/ensureSmartWalletThenPublish-xcHGv06S.js.map +1 -0
  51. package/dist/helpers/abi/eas.d.ts +203 -0
  52. package/dist/helpers/abi/eas.d.ts.map +1 -0
  53. package/dist/helpers/abi/executor.d.ts +33 -0
  54. package/dist/helpers/abi/executor.d.ts.map +1 -0
  55. package/dist/helpers/abi/factory.d.ts +31 -0
  56. package/dist/helpers/abi/factory.d.ts.map +1 -0
  57. package/dist/helpers/abi/publisher.d.ts +199 -0
  58. package/dist/helpers/abi/publisher.d.ts.map +1 -0
  59. package/dist/helpers/abi/schemaRegistry.d.ts +45 -0
  60. package/dist/helpers/abi/schemaRegistry.d.ts.map +1 -0
  61. package/dist/helpers/adapters/eip1193.d.ts +17 -0
  62. package/dist/helpers/adapters/eip1193.d.ts.map +1 -0
  63. package/dist/helpers/adapters/permissionlessTxSender.d.ts +11 -0
  64. package/dist/helpers/adapters/permissionlessTxSender.d.ts.map +1 -0
  65. package/dist/helpers/adapters/thirdwebAccount.d.ts +13 -0
  66. package/dist/helpers/adapters/thirdwebAccount.d.ts.map +1 -0
  67. package/dist/helpers/arweave.d.ts +4 -4
  68. package/dist/helpers/arweave.d.ts.map +1 -1
  69. package/dist/helpers/chainClient.d.ts +15 -0
  70. package/dist/helpers/chainClient.d.ts.map +1 -0
  71. package/dist/helpers/chainConfig.d.ts +12 -0
  72. package/dist/helpers/chainConfig.d.ts.map +1 -0
  73. package/dist/helpers/constants.d.ts +1 -2
  74. package/dist/helpers/constants.d.ts.map +1 -1
  75. package/dist/helpers/contracts/index.d.ts +90 -0
  76. package/dist/helpers/contracts/index.d.ts.map +1 -0
  77. package/dist/helpers/defaultChain.d.ts +4 -0
  78. package/dist/helpers/defaultChain.d.ts.map +1 -0
  79. package/dist/helpers/easDirect.d.ts +7 -76
  80. package/dist/helpers/easDirect.d.ts.map +1 -1
  81. package/dist/helpers/ensureEip7702ModularAccountReady.d.ts +1 -4
  82. package/dist/helpers/ensureEip7702ModularAccountReady.d.ts.map +1 -1
  83. package/dist/helpers/ensureExecutorModule.d.ts +1 -9
  84. package/dist/helpers/ensureExecutorModule.d.ts.map +1 -1
  85. package/dist/helpers/ensureManagedAccountEasConfigured.d.ts +2 -5
  86. package/dist/helpers/ensureManagedAccountEasConfigured.d.ts.map +1 -1
  87. package/dist/helpers/ensureManagedAccountReady.d.ts.map +1 -1
  88. package/dist/helpers/ensureManagedSignerSessionKey.d.ts +1 -0
  89. package/dist/helpers/ensureManagedSignerSessionKey.d.ts.map +1 -1
  90. package/dist/helpers/ensureSmartWalletThenPublish.d.ts +3 -13
  91. package/dist/helpers/ensureSmartWalletThenPublish.d.ts.map +1 -1
  92. package/dist/helpers/ensureWalletThenPublish.d.ts +21 -0
  93. package/dist/helpers/ensureWalletThenPublish.d.ts.map +1 -0
  94. package/dist/helpers/nameSchemaAttestation.d.ts +7 -0
  95. package/dist/helpers/nameSchemaAttestation.d.ts.map +1 -0
  96. package/dist/helpers/publishWalletRegistry.d.ts +19 -0
  97. package/dist/helpers/publishWalletRegistry.d.ts.map +1 -0
  98. package/dist/helpers/resolvePublishWallet.d.ts +7 -0
  99. package/dist/helpers/resolvePublishWallet.d.ts.map +1 -0
  100. package/dist/helpers/schemaRegistry.d.ts +11 -0
  101. package/dist/helpers/schemaRegistry.d.ts.map +1 -0
  102. package/dist/helpers/seedSigner.d.ts +62 -0
  103. package/dist/helpers/seedSigner.d.ts.map +1 -0
  104. package/dist/helpers/thirdweb.d.ts +14 -2
  105. package/dist/helpers/thirdweb.d.ts.map +1 -1
  106. package/dist/index.d.ts +11 -11
  107. package/dist/index.d.ts.map +1 -1
  108. package/dist/index.js +283 -5171
  109. package/dist/index.js.map +1 -1
  110. package/dist/publishManager-1vLf1ZHv.js +3005 -0
  111. package/dist/publishManager-1vLf1ZHv.js.map +1 -0
  112. package/dist/publishManager-5hUL8Of5.js +3007 -0
  113. package/dist/publishManager-5hUL8Of5.js.map +1 -0
  114. package/dist/publishManager-BO4sSSvo.js +3007 -0
  115. package/dist/publishManager-BO4sSSvo.js.map +1 -0
  116. package/dist/publishManager-BOICv9Yl.js +3008 -0
  117. package/dist/publishManager-BOICv9Yl.js.map +1 -0
  118. package/dist/publishManager-CCXWxiT1.js +3008 -0
  119. package/dist/publishManager-CCXWxiT1.js.map +1 -0
  120. package/dist/publishManager-Ccot_poQ.js +3008 -0
  121. package/dist/publishManager-Ccot_poQ.js.map +1 -0
  122. package/dist/publishManager-De3uWE-p.js +3007 -0
  123. package/dist/publishManager-De3uWE-p.js.map +1 -0
  124. package/dist/react/ConnectButton.d.ts.map +1 -1
  125. package/dist/react/PublishConfigContext.d.ts +4 -0
  126. package/dist/react/PublishConfigContext.d.ts.map +1 -0
  127. package/dist/react/PublishProvider.d.ts +7 -1
  128. package/dist/react/PublishProvider.d.ts.map +1 -1
  129. package/dist/react/PublishProvider.thirdweb.d.ts +11 -0
  130. package/dist/react/PublishProvider.thirdweb.d.ts.map +1 -0
  131. package/dist/react/useSeedWallet.d.ts +17 -0
  132. package/dist/react/useSeedWallet.d.ts.map +1 -0
  133. package/dist/resolveRevokeAccount-BGVjf-kI.js +30 -0
  134. package/dist/resolveRevokeAccount-BGVjf-kI.js.map +1 -0
  135. package/dist/resolveRevokeAccount-BRwOBTJ4.js +30 -0
  136. package/dist/resolveRevokeAccount-BRwOBTJ4.js.map +1 -0
  137. package/dist/resolveRevokeAccount-C0ZWAcHX.js +30 -0
  138. package/dist/resolveRevokeAccount-C0ZWAcHX.js.map +1 -0
  139. package/dist/resolveRevokeAccount-CKcr55EY.js +30 -0
  140. package/dist/resolveRevokeAccount-CKcr55EY.js.map +1 -0
  141. package/dist/resolveRevokeAccount-DNvuOQ1c.js +30 -0
  142. package/dist/resolveRevokeAccount-DNvuOQ1c.js.map +1 -0
  143. package/dist/resolveRevokeAccount-DvEPXZKI.js +30 -0
  144. package/dist/resolveRevokeAccount-DvEPXZKI.js.map +1 -0
  145. package/dist/resolveRevokeAccount-rOof3dUA.js +30 -0
  146. package/dist/resolveRevokeAccount-rOof3dUA.js.map +1 -0
  147. package/dist/seedSigner-BvK5WjmV.js +66 -0
  148. package/dist/seedSigner-BvK5WjmV.js.map +1 -0
  149. package/dist/services/PublishManager/actions/createPublish.d.ts.map +1 -1
  150. package/dist/services/PublishManager/actions/retryAttestations.d.ts +3 -2
  151. package/dist/services/PublishManager/actions/retryAttestations.d.ts.map +1 -1
  152. package/dist/services/PublishManager/actors/restoreFromDb.d.ts.map +1 -1
  153. package/dist/services/PublishManager/index.d.ts +2 -2
  154. package/dist/services/PublishManager/index.d.ts.map +1 -1
  155. package/dist/services/publish/actors/checking.d.ts.map +1 -1
  156. package/dist/services/publish/actors/createArweaveDataItems.d.ts.map +1 -1
  157. package/dist/services/publish/actors/createAttestations.d.ts.map +1 -1
  158. package/dist/services/publish/actors/createAttestationsDirectToEas.d.ts.map +1 -1
  159. package/dist/services/publish/actors/seedUidHelpers.d.ts +1 -17
  160. package/dist/services/publish/actors/seedUidHelpers.d.ts.map +1 -1
  161. package/dist/services/publish/helpers/ensureEasSchemas.d.ts +2 -5
  162. package/dist/services/publish/helpers/ensureEasSchemas.d.ts.map +1 -1
  163. package/dist/services/publish/helpers/receiptAttestationMs.d.ts +1 -3
  164. package/dist/services/publish/helpers/receiptAttestationMs.d.ts.map +1 -1
  165. package/dist/services/publish/index.d.ts.map +1 -1
  166. package/dist/services/revoke/revokeAttestations.d.ts +1 -3
  167. package/dist/services/revoke/revokeAttestations.d.ts.map +1 -1
  168. package/dist/services/upload/uploadMachine.d.ts +1 -1
  169. package/dist/thirdweb.d.ts +17 -0
  170. package/dist/thirdweb.d.ts.map +1 -0
  171. package/dist/thirdweb.js +176 -0
  172. package/dist/thirdweb.js.map +1 -0
  173. package/dist/types.d.ts +9 -4
  174. package/dist/types.d.ts.map +1 -1
  175. package/dist/worker-B3R2zwxm.js +69 -0
  176. package/dist/worker-B3R2zwxm.js.map +1 -0
  177. package/dist/worker-BVc0OzNI.js +105 -0
  178. package/dist/worker-BVc0OzNI.js.map +1 -0
  179. package/dist/worker-BWERw2Le.js +69 -0
  180. package/dist/worker-BWERw2Le.js.map +1 -0
  181. package/dist/worker-Bb3a6nOf.js +69 -0
  182. package/dist/worker-Bb3a6nOf.js.map +1 -0
  183. package/dist/worker-BqeFFnN_.js +69 -0
  184. package/dist/worker-BqeFFnN_.js.map +1 -0
  185. package/dist/worker-CqCsdQeT.js +69 -0
  186. package/dist/worker-CqCsdQeT.js.map +1 -0
  187. package/dist/worker-QZN_HMAs.js +69 -0
  188. package/dist/worker-QZN_HMAs.js.map +1 -0
  189. package/dist/worker-VilzVQ8C.js +69 -0
  190. package/dist/worker-VilzVQ8C.js.map +1 -0
  191. package/dist/worker-j_9ajZZU.js +100 -0
  192. package/dist/worker-j_9ajZZU.js.map +1 -0
  193. package/package.json +20 -5
@@ -0,0 +1,1204 @@
1
+ import { DEFAULT_ARWEAVE_GRAPHQL_URL as e, VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA as t, client as n, getAttesterForSeed as r, getGetAdditionalSyncAddresses as i, getMetadataAttestationUidsForSeedUid as a, getVersionsForSeedUid as o, isValidEasAttestationUid as s, setAdditionalSyncAddresses as c, setGetPublisherForNewSeeds as ee, setRevokeExecutor as l, updateSeedRevokedAt as te } from "@seedprotocol/sdk";
2
+ import { createPublicClient as ne, encodeAbiParameters as u, encodeFunctionData as d, http as f, parseEventLogs as p, zeroAddress as m } from "viem";
3
+ import { optimismSepolia as re } from "viem/chains";
4
+ import { createThirdwebClient as ie, defineChain as ae, deploySmartAccount as oe, getContract as h, prepareTransaction as se, sendTransaction as ce } from "thirdweb";
5
+ import { optimismSepolia as g } from "thirdweb/chains";
6
+ import { ethers as le } from "ethers";
7
+ import { createContext as ue, useContext as de, useEffect as fe, useRef as pe, useState as me } from "react";
8
+ import he from "debug";
9
+ import { createWallet as _, inAppWallet as ge } from "thirdweb/wallets";
10
+ import { useActiveAccount as _e } from "thirdweb/react";
11
+ //#region \0rolldown/runtime.js
12
+ var ve = Object.defineProperty, v = (e, t) => {
13
+ let n = {};
14
+ for (var r in e) ve(n, r, {
15
+ get: e[r],
16
+ enumerable: !0
17
+ });
18
+ return t || ve(n, Symbol.toStringTag, { value: "Module" }), n;
19
+ }, ye = "0x4200000000000000000000000000000000000020", be = "0x44d562ac1d7cd77e232978687fea027ace48f719cf1d58c7888e509663bb87fc", xe = "0x76f47d88bfaf670f5208911181fcdc0e160cb16d", Se = "0x4200000000000000000000000000000000000021", Ce = "0xcd8c945872df8e664e55cf8885c85ea3ea8f2148", we = Ce, Te = {
20
+ SUCCESS: "success",
21
+ FAILURE: "failure"
22
+ }, Ee = [
23
+ "pollingForConfirmation",
24
+ "uploadingData",
25
+ "uploadingViaBundler",
26
+ "uploadingViaBundlerPhase2"
27
+ ], De = 3e4, Oe = [
28
+ {
29
+ type: "error",
30
+ name: "AccessDenied",
31
+ inputs: []
32
+ },
33
+ {
34
+ type: "error",
35
+ name: "AlreadyRevoked",
36
+ inputs: []
37
+ },
38
+ {
39
+ type: "error",
40
+ name: "InvalidRevocation",
41
+ inputs: []
42
+ },
43
+ {
44
+ type: "error",
45
+ name: "InvalidRevocations",
46
+ inputs: []
47
+ },
48
+ {
49
+ type: "error",
50
+ name: "InvalidSchema",
51
+ inputs: []
52
+ },
53
+ {
54
+ type: "error",
55
+ name: "Irrevocable",
56
+ inputs: []
57
+ },
58
+ {
59
+ type: "error",
60
+ name: "NotFound",
61
+ inputs: []
62
+ },
63
+ {
64
+ type: "error",
65
+ name: "NotPayable",
66
+ inputs: []
67
+ },
68
+ {
69
+ type: "error",
70
+ name: "InsufficientValue",
71
+ inputs: []
72
+ },
73
+ {
74
+ type: "error",
75
+ name: "InvalidLength",
76
+ inputs: []
77
+ }
78
+ ], ke = [
79
+ {
80
+ name: "recipient",
81
+ type: "address"
82
+ },
83
+ {
84
+ name: "expirationTime",
85
+ type: "uint64"
86
+ },
87
+ {
88
+ name: "revocable",
89
+ type: "bool"
90
+ },
91
+ {
92
+ name: "refUID",
93
+ type: "bytes32"
94
+ },
95
+ {
96
+ name: "data",
97
+ type: "bytes"
98
+ },
99
+ {
100
+ name: "value",
101
+ type: "uint256"
102
+ }
103
+ ], y = [
104
+ {
105
+ type: "function",
106
+ name: "attest",
107
+ stateMutability: "payable",
108
+ inputs: [{
109
+ name: "request",
110
+ type: "tuple",
111
+ components: [{
112
+ name: "schema",
113
+ type: "bytes32"
114
+ }, {
115
+ name: "data",
116
+ type: "tuple",
117
+ components: ke
118
+ }]
119
+ }],
120
+ outputs: [{ type: "bytes32" }]
121
+ },
122
+ {
123
+ type: "function",
124
+ name: "multiAttest",
125
+ stateMutability: "payable",
126
+ inputs: [{
127
+ name: "requests",
128
+ type: "tuple[]",
129
+ components: [{
130
+ name: "schema",
131
+ type: "bytes32"
132
+ }, {
133
+ name: "data",
134
+ type: "tuple[]",
135
+ components: ke
136
+ }]
137
+ }],
138
+ outputs: [{ type: "bytes32[]" }]
139
+ },
140
+ {
141
+ type: "function",
142
+ name: "multiRevoke",
143
+ stateMutability: "payable",
144
+ inputs: [{
145
+ name: "multiRequests",
146
+ type: "tuple[]",
147
+ components: [{
148
+ name: "schema",
149
+ type: "bytes32"
150
+ }, {
151
+ name: "data",
152
+ type: "tuple[]",
153
+ components: [{
154
+ name: "uid",
155
+ type: "bytes32"
156
+ }, {
157
+ name: "value",
158
+ type: "uint256"
159
+ }]
160
+ }]
161
+ }],
162
+ outputs: []
163
+ },
164
+ {
165
+ type: "event",
166
+ name: "Attested",
167
+ inputs: [
168
+ {
169
+ name: "recipient",
170
+ type: "address",
171
+ indexed: !0
172
+ },
173
+ {
174
+ name: "attester",
175
+ type: "address",
176
+ indexed: !0
177
+ },
178
+ {
179
+ name: "uid",
180
+ type: "bytes32",
181
+ indexed: !1
182
+ },
183
+ {
184
+ name: "schemaUID",
185
+ type: "bytes32",
186
+ indexed: !0
187
+ }
188
+ ]
189
+ },
190
+ ...Oe
191
+ ], Ae = [{
192
+ name: "schema",
193
+ type: "bytes32"
194
+ }, {
195
+ name: "data",
196
+ type: "tuple[]",
197
+ components: [
198
+ {
199
+ name: "recipient",
200
+ type: "address"
201
+ },
202
+ {
203
+ name: "expirationTime",
204
+ type: "uint64"
205
+ },
206
+ {
207
+ name: "revocable",
208
+ type: "bool"
209
+ },
210
+ {
211
+ name: "refUID",
212
+ type: "bytes32"
213
+ },
214
+ {
215
+ name: "data",
216
+ type: "bytes"
217
+ },
218
+ {
219
+ name: "value",
220
+ type: "uint256"
221
+ }
222
+ ]
223
+ }], je = [{
224
+ type: "function",
225
+ name: "multiPublish",
226
+ stateMutability: "nonpayable",
227
+ inputs: [{
228
+ name: "requests",
229
+ type: "tuple[]",
230
+ components: [
231
+ {
232
+ name: "localId",
233
+ type: "string"
234
+ },
235
+ {
236
+ name: "seedUid",
237
+ type: "bytes32"
238
+ },
239
+ {
240
+ name: "seedSchemaUid",
241
+ type: "bytes32"
242
+ },
243
+ {
244
+ name: "versionUid",
245
+ type: "bytes32"
246
+ },
247
+ {
248
+ name: "versionSchemaUid",
249
+ type: "bytes32"
250
+ },
251
+ {
252
+ name: "seedIsRevocable",
253
+ type: "bool"
254
+ },
255
+ {
256
+ name: "listOfAttestations",
257
+ type: "tuple[]",
258
+ components: Ae
259
+ },
260
+ {
261
+ name: "propertiesToUpdate",
262
+ type: "tuple[]",
263
+ components: [{
264
+ name: "publishLocalId",
265
+ type: "string"
266
+ }, {
267
+ name: "propertySchemaUid",
268
+ type: "bytes32"
269
+ }]
270
+ }
271
+ ]
272
+ }],
273
+ outputs: [{ type: "bytes32[]" }]
274
+ }], Me = [{
275
+ type: "function",
276
+ name: "multiPublish",
277
+ stateMutability: "nonpayable",
278
+ inputs: [{
279
+ name: "requests",
280
+ type: "tuple[]",
281
+ components: [
282
+ {
283
+ name: "localIdIndex",
284
+ type: "uint256"
285
+ },
286
+ {
287
+ name: "seedUid",
288
+ type: "bytes32"
289
+ },
290
+ {
291
+ name: "seedSchemaUid",
292
+ type: "bytes32"
293
+ },
294
+ {
295
+ name: "versionUid",
296
+ type: "bytes32"
297
+ },
298
+ {
299
+ name: "versionSchemaUid",
300
+ type: "bytes32"
301
+ },
302
+ {
303
+ name: "seedIsRevocable",
304
+ type: "bool"
305
+ },
306
+ {
307
+ name: "listOfAttestations",
308
+ type: "tuple[]",
309
+ components: Ae
310
+ },
311
+ {
312
+ name: "propertiesToUpdate",
313
+ type: "tuple[]",
314
+ components: [{
315
+ name: "publishLocalIdIndex",
316
+ type: "uint256"
317
+ }, {
318
+ name: "propertySchemaUid",
319
+ type: "bytes32"
320
+ }]
321
+ }
322
+ ]
323
+ }],
324
+ outputs: [{ type: "bytes32[]" }]
325
+ }], b = [
326
+ {
327
+ type: "function",
328
+ name: "getEas",
329
+ stateMutability: "view",
330
+ inputs: [],
331
+ outputs: [{ type: "address" }]
332
+ },
333
+ {
334
+ type: "function",
335
+ name: "setEas",
336
+ stateMutability: "nonpayable",
337
+ inputs: [{
338
+ name: "_eas",
339
+ type: "address"
340
+ }],
341
+ outputs: [{ type: "string" }]
342
+ },
343
+ {
344
+ type: "function",
345
+ name: "isActiveSigner",
346
+ stateMutability: "view",
347
+ inputs: [{
348
+ name: "signer",
349
+ type: "address"
350
+ }],
351
+ outputs: [{ type: "bool" }]
352
+ }
353
+ ], Ne = [{
354
+ type: "event",
355
+ name: "CreatedAttestation",
356
+ inputs: [{
357
+ name: "result",
358
+ type: "tuple",
359
+ indexed: !1,
360
+ components: [{
361
+ name: "schemaUid",
362
+ type: "bytes32"
363
+ }, {
364
+ name: "attestationUid",
365
+ type: "bytes32"
366
+ }]
367
+ }]
368
+ }, {
369
+ type: "event",
370
+ name: "SeedPublished",
371
+ inputs: [{
372
+ name: "returnedDataFromEAS",
373
+ type: "bytes",
374
+ indexed: !1
375
+ }]
376
+ }], x = [{
377
+ type: "function",
378
+ name: "getAddress",
379
+ stateMutability: "view",
380
+ inputs: [{
381
+ name: "_adminSigner",
382
+ type: "address"
383
+ }, {
384
+ name: "_data",
385
+ type: "bytes"
386
+ }],
387
+ outputs: [{ type: "address" }]
388
+ }, {
389
+ type: "function",
390
+ name: "createAccount",
391
+ stateMutability: "nonpayable",
392
+ inputs: [{
393
+ name: "_admin",
394
+ type: "address"
395
+ }, {
396
+ name: "_data",
397
+ type: "bytes"
398
+ }],
399
+ outputs: [{ type: "address" }]
400
+ }], S = [{
401
+ type: "function",
402
+ name: "getSchema",
403
+ stateMutability: "view",
404
+ inputs: [{
405
+ name: "uid",
406
+ type: "bytes32"
407
+ }],
408
+ outputs: [{
409
+ name: "",
410
+ type: "tuple",
411
+ components: [
412
+ {
413
+ name: "uid",
414
+ type: "bytes32"
415
+ },
416
+ {
417
+ name: "resolver",
418
+ type: "address"
419
+ },
420
+ {
421
+ name: "revocable",
422
+ type: "bool"
423
+ },
424
+ {
425
+ name: "schema",
426
+ type: "string"
427
+ }
428
+ ]
429
+ }]
430
+ }, {
431
+ type: "function",
432
+ name: "register",
433
+ stateMutability: "nonpayable",
434
+ inputs: [
435
+ {
436
+ name: "schema",
437
+ type: "string"
438
+ },
439
+ {
440
+ name: "resolver",
441
+ type: "address"
442
+ },
443
+ {
444
+ name: "revocable",
445
+ type: "bool"
446
+ }
447
+ ],
448
+ outputs: [{ type: "bytes32" }]
449
+ }], C = re;
450
+ //#endregion
451
+ //#region src/helpers/chainConfig.ts
452
+ function w() {
453
+ try {
454
+ return z().chain ?? C;
455
+ } catch {
456
+ return C;
457
+ }
458
+ }
459
+ function T() {
460
+ let e = z();
461
+ if (e.rpcUrl) return e.rpcUrl;
462
+ if (e.thirdwebClientId) return `https://${(e.chain ?? C).id}.rpc.thirdweb.com/${e.thirdwebClientId}`;
463
+ throw Error("@seedprotocol/publish: rpcUrl is required when thirdwebClientId is not set. Pass rpcUrl in initPublish / PublishProvider config.");
464
+ }
465
+ //#endregion
466
+ //#region src/helpers/chainClient.ts
467
+ var E = null, Pe = null;
468
+ function Fe() {
469
+ return ne({
470
+ chain: w(),
471
+ transport: f(T())
472
+ });
473
+ }
474
+ function D() {
475
+ let e = w(), t = T(), n = `${e.id}:${t}`;
476
+ return (!E || Pe !== n) && (Pe = n, E = Fe()), E;
477
+ }
478
+ async function O(e) {
479
+ return D().waitForTransactionReceipt({ hash: e });
480
+ }
481
+ async function k(e) {
482
+ let t = await D().getBytecode({ address: e });
483
+ return !!t && t !== "0x";
484
+ }
485
+ async function Ie(e) {
486
+ try {
487
+ let t = await D().getBlock({ blockNumber: e });
488
+ if (t?.timestamp != null) return Number(t.timestamp) * 1e3;
489
+ } catch {}
490
+ return null;
491
+ }
492
+ var Le = 5, Re = 6e3;
493
+ async function ze(e, t = Le, n = Re) {
494
+ for (let r = 0; r < t; r++) {
495
+ if (await k(e)) return !0;
496
+ r < t - 1 && await new Promise((e) => {
497
+ setTimeout(e, n);
498
+ });
499
+ }
500
+ return !1;
501
+ }
502
+ //#endregion
503
+ //#region src/helpers/contracts/index.ts
504
+ function Be(e, t, n) {
505
+ return {
506
+ to: e,
507
+ data: d({
508
+ abi: je,
509
+ functionName: "multiPublish",
510
+ args: [t]
511
+ }),
512
+ gas: n
513
+ };
514
+ }
515
+ function Ve(e, t, n) {
516
+ return {
517
+ to: e,
518
+ data: d({
519
+ abi: Me,
520
+ functionName: "multiPublish",
521
+ args: [t]
522
+ }),
523
+ gas: n
524
+ };
525
+ }
526
+ function He(e, t) {
527
+ return {
528
+ to: e,
529
+ data: d({
530
+ abi: b,
531
+ functionName: "setEas",
532
+ args: [t]
533
+ })
534
+ };
535
+ }
536
+ async function Ue(e) {
537
+ return D().readContract({
538
+ address: e,
539
+ abi: b,
540
+ functionName: "getEas"
541
+ });
542
+ }
543
+ async function We(e, t) {
544
+ return D().readContract({
545
+ address: e,
546
+ abi: b,
547
+ functionName: "isActiveSigner",
548
+ args: [t]
549
+ });
550
+ }
551
+ async function Ge(e, t = "0x") {
552
+ let { thirdwebAccountFactoryAddress: n } = z();
553
+ return D().readContract({
554
+ address: n || "0x76f47d88bfaf670f5208911181fcdc0e160cb16d",
555
+ abi: x,
556
+ functionName: "getAddress",
557
+ args: [e, t]
558
+ });
559
+ }
560
+ function Ke(e, t = "0x") {
561
+ let { thirdwebAccountFactoryAddress: n } = z();
562
+ return {
563
+ to: n || "0x76f47d88bfaf670f5208911181fcdc0e160cb16d",
564
+ data: d({
565
+ abi: x,
566
+ functionName: "createAccount",
567
+ args: [e, t]
568
+ })
569
+ };
570
+ }
571
+ var qe = "0x0000000000000000000000000000000000000000";
572
+ function Je(e) {
573
+ let { easContractAddress: t } = z();
574
+ return {
575
+ to: t,
576
+ data: d({
577
+ abi: y,
578
+ functionName: "attest",
579
+ args: [{
580
+ schema: e.schema,
581
+ data: {
582
+ recipient: e.data.recipient ?? qe,
583
+ expirationTime: e.data.expirationTime ?? 0n,
584
+ revocable: e.data.revocable ?? !0,
585
+ refUID: e.data.refUID,
586
+ data: e.data.data,
587
+ value: e.data.value ?? 0n
588
+ }
589
+ }]
590
+ })
591
+ };
592
+ }
593
+ function Ye(e) {
594
+ let { easContractAddress: t } = z();
595
+ return {
596
+ to: t,
597
+ data: d({
598
+ abi: y,
599
+ functionName: "multiAttest",
600
+ args: [e]
601
+ })
602
+ };
603
+ }
604
+ function Xe(e) {
605
+ let { easContractAddress: t } = z();
606
+ return {
607
+ to: t,
608
+ data: d({
609
+ abi: y,
610
+ functionName: "multiRevoke",
611
+ args: [e.map((e) => ({
612
+ schema: e.schema,
613
+ data: e.data.map((e) => ({
614
+ uid: e.uid,
615
+ value: e.value ?? 0n
616
+ }))
617
+ }))]
618
+ })
619
+ };
620
+ }
621
+ var Ze = "0x" + "0".repeat(64);
622
+ async function Qe(e) {
623
+ let t = await D().readContract({
624
+ address: ye,
625
+ abi: S,
626
+ functionName: "getSchema",
627
+ args: [e]
628
+ });
629
+ return !t || t.uid === Ze ? null : {
630
+ uid: t.uid,
631
+ resolver: t.resolver,
632
+ revocable: t.revocable,
633
+ schema: t.schema
634
+ };
635
+ }
636
+ function $e(e) {
637
+ return {
638
+ to: ye,
639
+ data: d({
640
+ abi: S,
641
+ functionName: "register",
642
+ args: [
643
+ e.schema,
644
+ e.resolverAddress,
645
+ e.revocable
646
+ ]
647
+ })
648
+ };
649
+ }
650
+ //#endregion
651
+ //#region src/helpers/easDirect.ts
652
+ var et = "0x" + "0".repeat(64);
653
+ function tt(e) {
654
+ return Je(e);
655
+ }
656
+ function nt(e) {
657
+ return Ye(e);
658
+ }
659
+ function rt(e) {
660
+ return u([{ type: "bytes32" }], [e]);
661
+ }
662
+ function it(e, t) {
663
+ return at(e, t)[0]?.uid;
664
+ }
665
+ function at(e, t) {
666
+ if (!e.logs?.length) return [];
667
+ let n = t.toLowerCase(), r = e.logs.filter((e) => e.address && e.address.toLowerCase() === n);
668
+ if (!r.length) return [];
669
+ try {
670
+ let e = p({
671
+ abi: y,
672
+ eventName: "Attested",
673
+ logs: r,
674
+ strict: !1
675
+ }), t = [];
676
+ for (let n of e) {
677
+ let e = n.args?.uid, r = n.args?.schemaUID;
678
+ !e || e === et || r && t.push({
679
+ schemaUid: r,
680
+ uid: e
681
+ });
682
+ }
683
+ return t;
684
+ } catch {
685
+ return [];
686
+ }
687
+ }
688
+ function ot(e) {
689
+ return z(), Xe(e);
690
+ }
691
+ //#endregion
692
+ //#region src/helpers/publishWalletRegistry.ts
693
+ var A = null;
694
+ function st() {
695
+ return n.isInitialized() ? Promise.resolve() : new Promise((e) => {
696
+ n.onReady(() => e());
697
+ });
698
+ }
699
+ async function ct(e) {
700
+ if (A = e, !e) return;
701
+ await st();
702
+ let t = /* @__PURE__ */ new Set();
703
+ for (let n of e.ownedAddresses ?? []) n && t.add(n.toLowerCase());
704
+ t.add(e.signer.address.toLowerCase()), t.add(e.txSender.address.toLowerCase()), e.publisherAddress && t.add(e.publisherAddress.toLowerCase());
705
+ try {
706
+ await n.setAddresses({ owned: [...t] });
707
+ } catch (e) {
708
+ console.warn("[publishWalletRegistry] Failed to set seed client addresses:", e);
709
+ }
710
+ }
711
+ function j() {
712
+ return A;
713
+ }
714
+ function lt() {
715
+ A = null;
716
+ }
717
+ //#endregion
718
+ //#region src/helpers/seedSigner.ts
719
+ var ut = Symbol.for("seedprotocol.SeedSigner"), dt = Symbol.for("seedprotocol.SeedTxSender");
720
+ function M(e) {
721
+ return Object.assign(e, { [ut]: !0 });
722
+ }
723
+ function N(e) {
724
+ return Object.assign(e, { [dt]: !0 });
725
+ }
726
+ function P(e) {
727
+ return !!e && typeof e == "object" && ut in e;
728
+ }
729
+ function F(e) {
730
+ return !!e && typeof e == "object" && dt in e;
731
+ }
732
+ function I(e) {
733
+ return !!e && typeof e == "object" && "signer" in e && "txSender" in e && P(e.signer) && F(e.txSender);
734
+ }
735
+ function ft(e) {
736
+ let t = e.address;
737
+ return {
738
+ signer: M({
739
+ address: t,
740
+ signMessage: async ({ message: t }) => {
741
+ if (typeof t == "string") return await e.signMessage(t);
742
+ let n = t.raw, r = typeof n == "string" ? le.getBytes(n) : n instanceof Uint8Array ? n : new Uint8Array(n);
743
+ return await e.signMessage(r);
744
+ }
745
+ }),
746
+ txSender: N({
747
+ address: t,
748
+ sendTransaction: async (t) => ({ transactionHash: (await e.sendTransaction({
749
+ to: t.to,
750
+ data: t.data,
751
+ value: t.value,
752
+ gasLimit: t.gas
753
+ })).hash })
754
+ })
755
+ };
756
+ }
757
+ function pt(e) {
758
+ if (I(e)) return e.signer;
759
+ if (P(e)) return e;
760
+ throw Error("@seedprotocol/publish: expected a SeedSigner or PublishWallet. Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
761
+ }
762
+ function mt(e) {
763
+ if (I(e)) return e.txSender;
764
+ if (F(e)) return e;
765
+ throw Error("@seedprotocol/publish: expected a SeedTxSender or PublishWallet. Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
766
+ }
767
+ function ht(e) {
768
+ if (I(e)) return e;
769
+ throw Error("@seedprotocol/publish: expected a PublishWallet (signer + txSender). Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
770
+ }
771
+ //#endregion
772
+ //#region src/helpers/adapters/thirdwebAccount.ts
773
+ var gt = /* @__PURE__ */ v({
774
+ asSeedSignerFromThirdweb: () => yt,
775
+ asThirdwebPublishWallet: () => vt,
776
+ fromThirdwebAccount: () => L
777
+ });
778
+ function _t() {
779
+ let e = w();
780
+ return e.id === g.id ? g : ae({
781
+ id: e.id,
782
+ name: e.name,
783
+ nativeCurrency: e.nativeCurrency,
784
+ rpc: e.rpcUrls.default.http[0] ?? ""
785
+ });
786
+ }
787
+ function L(e) {
788
+ let t = e.address;
789
+ return {
790
+ signer: M({
791
+ address: t,
792
+ signMessage: async ({ message: t }) => await e.signMessage({ message: t })
793
+ }),
794
+ txSender: N({
795
+ address: t,
796
+ sendTransaction: async (t) => {
797
+ let { getClient: n } = await Promise.resolve().then(() => Pt), r = _t();
798
+ return { transactionHash: (await ce({
799
+ account: e,
800
+ transaction: se({
801
+ client: n(),
802
+ chain: r,
803
+ to: t.to,
804
+ data: t.data,
805
+ value: t.value,
806
+ gas: t.gas
807
+ })
808
+ })).transactionHash };
809
+ }
810
+ })
811
+ };
812
+ }
813
+ function vt(e) {
814
+ if (I(e)) return e;
815
+ if (P(e)) throw Error("@seedprotocol/publish/thirdweb: SeedSigner alone cannot send sponsored txs. Pass fromThirdwebAccount(account) or a PublishWallet.");
816
+ return L(e);
817
+ }
818
+ function yt(e) {
819
+ return I(e) ? e.signer : P(e) ? e : L(e).signer;
820
+ }
821
+ //#endregion
822
+ //#region src/services/revoke/revokeAttestations.ts
823
+ async function bt(e) {
824
+ let { seedLocalId: n, seedUid: c, seedSchemaUid: ee } = e, l = j();
825
+ if (l) {
826
+ let e = await r({
827
+ seedLocalId: n,
828
+ seedUid: c
829
+ }), t = i();
830
+ if (e && t) {
831
+ let n = await t(), r = e.toLowerCase();
832
+ if (n?.some((e) => e?.toLowerCase() === r)) throw Error("Revocation not supported for items published via the modular executor.");
833
+ }
834
+ } else try {
835
+ let { getConnectedAccount: e } = await Promise.resolve().then(() => Pt), { resolveRevokeAccount: t } = await import("./resolveRevokeAccount-BRwOBTJ4.js"), i = await e();
836
+ if (!i) throw Error("No wallet connected. Connect a wallet to revoke attestations.");
837
+ l = L(await t({
838
+ account: i,
839
+ attester: await r({
840
+ seedLocalId: n,
841
+ seedUid: c
842
+ })
843
+ }));
844
+ } catch (e) {
845
+ 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 });
846
+ }
847
+ let ne = l.txSender, [u, d] = await Promise.all([o(c), a(c)]), f = u.map((e) => e.uid).filter((e) => s(e)), p = /* @__PURE__ */ new Map();
848
+ for (let { uid: e, schemaUid: t } of d) {
849
+ if (!s(e)) continue;
850
+ let n = p.get(t) ?? [];
851
+ n.push(e), p.set(t, n);
852
+ }
853
+ let m = [];
854
+ for (let [e, t] of p) t.length > 0 && m.push({
855
+ schema: e,
856
+ data: t.map((e) => ({ uid: e }))
857
+ });
858
+ f.length > 0 && m.push({
859
+ schema: t,
860
+ data: f.map((e) => ({ uid: e }))
861
+ }), m.push({
862
+ schema: ee,
863
+ data: [{ uid: c }]
864
+ });
865
+ for (let e of m) {
866
+ if (e.data.length === 0) continue;
867
+ let t = ot([e]);
868
+ try {
869
+ await O((await ne.sendTransaction(t)).transactionHash);
870
+ } catch (e) {
871
+ let t = e instanceof Error ? e.message : String(e);
872
+ if (t.includes("AccessDenied") || t.includes("0x4ca88867")) throw Error("Only the original attester can revoke attestations. Connect the wallet that published this item.");
873
+ if (t.includes("AlreadyRevoked")) continue;
874
+ throw e;
875
+ }
876
+ }
877
+ await te({
878
+ seedLocalId: n,
879
+ revokedAt: Math.floor(Date.now() / 1e3)
880
+ });
881
+ }
882
+ //#endregion
883
+ //#region src/config.ts
884
+ var R = null;
885
+ function xt(e) {
886
+ R = e;
887
+ }
888
+ function St() {
889
+ return R;
890
+ }
891
+ function Ct(e) {
892
+ xt(e), ee(async () => {
893
+ let e = j();
894
+ if (e?.publisherAddress) return e.publisherAddress;
895
+ if (e?.signer?.address) return e.signer.address;
896
+ }), l(bt), import("./worker-VilzVQ8C.js").then((e) => {
897
+ e.startArweaveL1FinalizeWorker();
898
+ }), c(async () => e.useModularExecutor && e.modularAccountModuleContract ? [e.modularAccountModuleContract] : []);
899
+ }
900
+ var wt = Ct;
901
+ function z() {
902
+ let t = R;
903
+ if (!t) throw Error("@seedprotocol/publish: Call initPublish() or ensure PublishProvider is mounted with config before using the publish package");
904
+ let n = t.useArweaveBundler ?? !1, r = t.arweaveUploadVerificationBaseUrl ?? t.uploadApiBaseUrl, i = t.arweaveGraphqlUrl ?? e, a = t.useModularExecutor ?? !1, o = t.chain ?? C, s = t.accountMode ?? (t.bundlerUrl ? "eip7702" : "eoa");
905
+ return {
906
+ ...t,
907
+ thirdwebAccountFactoryAddress: xe,
908
+ easContractAddress: Se,
909
+ useIntegerLocalIds: t.useIntegerLocalIds ?? !1,
910
+ useDirectEas: t.useDirectEas ?? !1,
911
+ modularAccountModuleData: t.modularAccountModuleData ?? "0x",
912
+ useModularExecutor: a,
913
+ useArweaveBundler: n,
914
+ arweaveUploadVerificationBaseUrl: r,
915
+ arweaveGraphqlUrl: i,
916
+ autoDeployManagedAccount: t.autoDeployManagedAccount ?? !1,
917
+ autoDeployEip7702ModularAccount: Tt(t, a),
918
+ chain: o,
919
+ accountMode: s
920
+ };
921
+ }
922
+ function Tt(e, t) {
923
+ return e.autoDeployEip7702ModularAccount === !0 ? !0 : e.autoDeployEip7702ModularAccount === !1 ? !1 : t;
924
+ }
925
+ //#endregion
926
+ //#region src/errors.ts
927
+ var Et = class extends Error {
928
+ seedLocalId;
929
+ expectedSchemas;
930
+ foundSchemas;
931
+ code;
932
+ constructor(e, t, n, r, i = "METADATA_PROPERTIES_MISSING") {
933
+ super(e), this.seedLocalId = t, this.expectedSchemas = n, this.foundSchemas = r, this.code = i, this.name = "AttestationVerificationError";
934
+ }
935
+ };
936
+ function B(e, t = 700) {
937
+ if (e == null) return "";
938
+ if (e instanceof Error) {
939
+ let n = e.cause instanceof Error ? ` | cause: ${e.cause.message}` : "";
940
+ return (e.message + n).slice(0, t);
941
+ }
942
+ if (typeof e == "object") {
943
+ let n = e, r = [];
944
+ if (typeof n.message == "string" && r.push(n.message), typeof n.shortMessage == "string" && r.push(n.shortMessage), typeof n.details == "string" && r.push(n.details), typeof n.reason == "string" && r.push(n.reason), r.length) return r.join(" | ").slice(0, t);
945
+ try {
946
+ return JSON.stringify(e).slice(0, t);
947
+ } catch {
948
+ return String(e).slice(0, t);
949
+ }
950
+ }
951
+ return String(e).slice(0, t);
952
+ }
953
+ var V = class extends Error {
954
+ code;
955
+ managedAddress;
956
+ underlyingCause;
957
+ constructor(e, t, n, r) {
958
+ let i = r != null && r !== "" ? ` (${B(r)})` : "";
959
+ super(e + i), this.code = t, this.managedAddress = n, this.name = "ManagedAccountPublishError", this.underlyingCause = r;
960
+ }
961
+ };
962
+ function Dt(e) {
963
+ if (e instanceof V) return !0;
964
+ if (typeof e != "object" || !e) return !1;
965
+ let t = e;
966
+ return t.name === "ManagedAccountPublishError" && typeof t.code == "string";
967
+ }
968
+ var Ot = class extends Error {
969
+ code;
970
+ modularAddress;
971
+ underlyingCause;
972
+ constructor(e, t, n, r) {
973
+ let i = r != null && r !== "" ? ` (${B(r)})` : "";
974
+ super(e + i), this.code = t, this.modularAddress = n, this.name = "Eip7702ModularAccountPublishError", this.underlyingCause = r;
975
+ }
976
+ }, kt = [
977
+ "EIP7702_MODULAR_ACCOUNT_UNAVAILABLE",
978
+ "EIP7702_MODULAR_NOT_UPGRADED",
979
+ "EIP7702_MODULAR_DEPLOY_FAILED",
980
+ "EIP7702_MODULAR_NOT_CONFIRMED"
981
+ ];
982
+ function At(e) {
983
+ if (e instanceof Ot) return !0;
984
+ if (typeof e != "object" || !e) return !1;
985
+ let t = e;
986
+ return t.name === "Eip7702ModularAccountPublishError" && typeof t.code == "string" && kt.includes(t.code);
987
+ }
988
+ function jt(e) {
989
+ let t = B(e);
990
+ return !!(/Router:\s*function does not exist/i.test(t) || /Cannot decode zero data\s*\(\s*["']0x["']\s*\)/i.test(t));
991
+ }
992
+ //#endregion
993
+ //#region src/react/PublishConfigContext.tsx
994
+ var Mt = ue(null);
995
+ function Nt() {
996
+ let e = de(Mt);
997
+ if (!e) throw Error("usePublishConfig: PublishConfig is missing. Pass config to PublishProvider or call initPublish() before render.");
998
+ return e;
999
+ }
1000
+ //#endregion
1001
+ //#region src/helpers/thirdweb.ts
1002
+ var Pt = /* @__PURE__ */ v({
1003
+ ExternalWalletsForDeploy: () => Ut,
1004
+ appMetadata: () => Gt,
1005
+ deployManagedAccountViaFactory: () => Y,
1006
+ deploySmartWalletContract: () => Wt,
1007
+ getClient: () => K,
1008
+ getConnectedAccount: () => X,
1009
+ getConnectedManagedAccountAddress: () => Kt,
1010
+ getConnectedModularAccount: () => qt,
1011
+ getManagedAccountWallet: () => Z,
1012
+ getModularAccountWallet: () => Q,
1013
+ getSharedPublishInAppWalletStorage: () => U,
1014
+ getSmartWalletAddressForAdmin: () => q,
1015
+ getWalletsForConnectButton: () => Zt,
1016
+ isSmartWalletDeployed: () => J,
1017
+ pollSmartWalletDeployed: () => Vt,
1018
+ resolveSmartWalletForPublish: () => Ht,
1019
+ syncPublishInAppAuthToken: () => W,
1020
+ useActiveSmartWalletContract: () => Bt,
1021
+ useLocalWalletAccount: () => zt,
1022
+ wallets: () => Rt
1023
+ }), Ft = he("permaPress:helpers:thirdweb"), H = "seedProtocol:inAppPublish:", It = null;
1024
+ function U() {
1025
+ return It ||= {
1026
+ getItem: async (e) => typeof window > "u" ? null : localStorage.getItem(H + e),
1027
+ setItem: async (e, t) => {
1028
+ typeof window > "u" || localStorage.setItem(H + e, t);
1029
+ },
1030
+ removeItem: async (e) => {
1031
+ typeof window > "u" || localStorage.removeItem(H + e);
1032
+ }
1033
+ }, It;
1034
+ }
1035
+ function W() {
1036
+ if (typeof window > "u") return {
1037
+ syncedBareToPrefixed: !1,
1038
+ syncedPrefixedToBare: !1
1039
+ };
1040
+ let { thirdwebClientId: e } = z();
1041
+ if (!e) return {
1042
+ syncedBareToPrefixed: !1,
1043
+ syncedPrefixedToBare: !1
1044
+ };
1045
+ try {
1046
+ let t = `walletToken-${e}`, n = `${H}${t}`, r = localStorage.getItem(t), i = localStorage.getItem(n), a = !1, o = !1;
1047
+ return r && !i && (localStorage.setItem(n, r), a = !0), i && !r && (localStorage.setItem(t, i), o = !0), i && r && r !== i && (localStorage.setItem(t, i), o = !0), {
1048
+ syncedBareToPrefixed: a,
1049
+ syncedPrefixedToBare: o
1050
+ };
1051
+ } catch {
1052
+ return {
1053
+ syncedBareToPrefixed: !1,
1054
+ syncedPrefixedToBare: !1
1055
+ };
1056
+ }
1057
+ }
1058
+ async function Lt(e = g) {
1059
+ W();
1060
+ let t = Z();
1061
+ return await t.autoConnect({
1062
+ client: K(),
1063
+ chain: e
1064
+ }), t;
1065
+ }
1066
+ var G = null;
1067
+ function K() {
1068
+ if (!G) {
1069
+ let { thirdwebClientId: e } = z();
1070
+ if (!e) throw Error("@seedprotocol/publish/thirdweb: thirdwebClientId is required. Pass it in initPublish / PublishProvider config.");
1071
+ G = ie({ clientId: e });
1072
+ }
1073
+ return G;
1074
+ }
1075
+ var Rt = [_("io.metamask")], zt = () => {
1076
+ let [e, t] = me(null);
1077
+ return _("io.metamask"), pe(!1), fe(() => {}, []), e;
1078
+ }, Bt = () => {
1079
+ let e = _e(), [t, n] = me(null);
1080
+ return fe(() => {
1081
+ !e || !e.address || n(h({
1082
+ client: K(),
1083
+ chain: g,
1084
+ address: e.address
1085
+ }));
1086
+ }, [e]), t;
1087
+ };
1088
+ async function q(e, t = "0x") {
1089
+ return Ge(e, t);
1090
+ }
1091
+ async function J(e) {
1092
+ return k(e);
1093
+ }
1094
+ async function Vt(e, t, n) {
1095
+ return ze(e, t, n);
1096
+ }
1097
+ async function Ht(e) {
1098
+ if (!e) return { needsDeploy: !0 };
1099
+ if (await J(e.address)) return {
1100
+ address: e.address,
1101
+ account: e
1102
+ };
1103
+ let t = await q(e.address);
1104
+ return await J(t) ? {
1105
+ address: t,
1106
+ account: e
1107
+ } : { needsDeploy: !0 };
1108
+ }
1109
+ var Ut = [_("io.metamask"), _("me.rainbow")], Wt = async (e) => {
1110
+ let t = h({
1111
+ client: K(),
1112
+ chain: g,
1113
+ address: e.address
1114
+ }), n = await oe({
1115
+ smartAccount: e,
1116
+ chain: g,
1117
+ client: K(),
1118
+ accountContract: t
1119
+ });
1120
+ return Ft("deploySmartAccount result:", n), n;
1121
+ };
1122
+ async function Y(e) {
1123
+ let { asThirdwebPublishWallet: t } = await Promise.resolve().then(() => gt), n = t(e.signingAccount), r = Ke(e.adminAddress, e.data ?? "0x");
1124
+ await n.txSender.sendTransaction(r);
1125
+ }
1126
+ var Gt = {
1127
+ name: "Seed Protocol",
1128
+ description: "Seed Protocol",
1129
+ url: "https://seedprotocol.io"
1130
+ };
1131
+ async function Kt(e = g) {
1132
+ let t = (await Lt(e)).getAccount();
1133
+ if (!t) throw Error("Failed to get managed account");
1134
+ return t.address;
1135
+ }
1136
+ async function X() {
1137
+ try {
1138
+ let e = Q();
1139
+ return await e.autoConnect({
1140
+ client: K(),
1141
+ chain: g
1142
+ }), e.getAccount() ?? null;
1143
+ } catch {
1144
+ return null;
1145
+ }
1146
+ }
1147
+ async function qt() {
1148
+ return X();
1149
+ }
1150
+ var Jt = null, Z = () => (Jt ||= ge({
1151
+ storage: U(),
1152
+ auth: { options: [
1153
+ "farcaster",
1154
+ "email",
1155
+ "passkey",
1156
+ "phone"
1157
+ ] },
1158
+ executionMode: {
1159
+ mode: "EIP4337",
1160
+ smartAccount: {
1161
+ chain: g,
1162
+ factoryAddress: xe,
1163
+ gasless: !0
1164
+ }
1165
+ }
1166
+ }), Jt), Yt = null, Q = () => (Yt ||= ge({
1167
+ storage: U(),
1168
+ auth: { options: [
1169
+ "farcaster",
1170
+ "email",
1171
+ "passkey",
1172
+ "phone"
1173
+ ] },
1174
+ executionMode: {
1175
+ mode: "EIP7702",
1176
+ sponsorGas: !0
1177
+ }
1178
+ }), Yt), Xt = null, Zt = () => (Xt ||= z().useModularExecutor ? [Q()] : [Z()], Xt), Qt = "Could not verify or set the EAS contract address on your publishing account on Optimism Sepolia.";
1179
+ function $(e) {
1180
+ return e.toLowerCase();
1181
+ }
1182
+ async function $t(e, t) {
1183
+ let n = I(t) ? t.txSender : F(t) ? t : (() => {
1184
+ throw Error("@seedprotocol/publish: ensureManagedAccountEasConfigured requires PublishWallet or SeedTxSender");
1185
+ })(), { easContractAddress: r } = z(), i = $(r);
1186
+ if (!i || i === $(m)) throw new V("Publish config is missing a valid easContractAddress.", "MANAGED_ACCOUNT_SET_EAS_FAILED", e);
1187
+ let a;
1188
+ try {
1189
+ let t = await Ue(e);
1190
+ a = $(typeof t == "string" ? t : String(t));
1191
+ } catch (t) {
1192
+ throw new V(Qt, "MANAGED_ACCOUNT_SET_EAS_FAILED", e, t);
1193
+ }
1194
+ if (a !== i) try {
1195
+ let t = He(e, r);
1196
+ await O((await n.sendTransaction(t)).transactionHash);
1197
+ } catch (t) {
1198
+ throw new V(Qt, "MANAGED_ACCOUNT_SET_EAS_FAILED", e, t);
1199
+ }
1200
+ }
1201
+ //#endregion
1202
+ export { it as $, B as A, pt as B, Nt as C, Ee as Ct, At as D, we as Dt, V as E, Te as Et, yt as F, I as G, M as H, vt as I, lt as J, P as K, L, St as M, z as N, Dt as O, v as Ot, Ct as P, rt as Q, gt as R, Mt as S, be as St, Ot as T, De as Tt, N as U, mt as V, ft as W, ct as X, j as Y, et as Z, Ht as _, O as _t, Wt as a, Xe as at, zt as b, Ne as bt, Kt as c, $e as ct, Q as d, We as dt, at as et, U as f, Qe as ft, Vt as g, ze as gt, J as h, k as ht, Y as i, Ye as it, wt as j, jt as k, qt as l, He as lt, Zt as m, D as mt, Ut as n, nt, K as o, Be as ot, q as p, Ie as pt, F as q, Gt as r, Je as rt, X as s, Ve as st, $t as t, tt, Z as u, Ue as ut, W as v, T as vt, Et as w, Ce as wt, Rt as x, Se as xt, Bt as y, w as yt, ht as z };
1203
+
1204
+ //# sourceMappingURL=ensureManagedAccountEasConfigured-BxdK_Vhf.js.map