@seedprotocol/publish 0.4.31 → 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,936 @@
1
+ import { o as e, t } from "./seedSigner-BvK5WjmV.js";
2
+ import { DEFAULT_ARWEAVE_GRAPHQL_URL as n, VERSION_SCHEMA_UID_OPTIMISM_SEPOLIA as r, getAttesterForSeed as i, getGetAdditionalSyncAddresses as a, getMetadataAttestationUidsForSeedUid as ee, getVersionsForSeedUid as te, isValidEasAttestationUid as o, setAdditionalSyncAddresses as s, setGetPublisherForNewSeeds as c, setRevokeExecutor as ne, updateSeedRevokedAt as re } from "@seedprotocol/sdk";
3
+ import { createThirdwebClient as l, deploySmartAccount as u, getContract as d } from "thirdweb";
4
+ import { createWallet as f, inAppWallet as p } from "thirdweb/wallets";
5
+ import { useActiveAccount as ie } from "thirdweb/react";
6
+ import { useEffect as m, useRef as ae, useState as h } from "react";
7
+ import { optimismSepolia as g } from "thirdweb/chains";
8
+ import oe from "debug";
9
+ import { createPublicClient as se, encodeAbiParameters as ce, encodeFunctionData as _, http as le, parseEventLogs as ue } from "viem";
10
+ import { optimismSepolia as de } from "viem/chains";
11
+ //#region src/helpers/constants.ts
12
+ var v = "0x4200000000000000000000000000000000000020", fe = "0x44d562ac1d7cd77e232978687fea027ace48f719cf1d58c7888e509663bb87fc", y = "0x76f47d88bfaf670f5208911181fcdc0e160cb16d", b = "0x4200000000000000000000000000000000000021", x = "0xcd8c945872df8e664e55cf8885c85ea3ea8f2148", pe = x, me = {
13
+ SUCCESS: "success",
14
+ FAILURE: "failure"
15
+ }, he = [
16
+ "pollingForConfirmation",
17
+ "uploadingData",
18
+ "uploadingViaBundler",
19
+ "uploadingViaBundlerPhase2"
20
+ ], ge = 3e4;
21
+ //#endregion
22
+ //#region src/helpers/chainClient.ts
23
+ function _e(e) {
24
+ return se({
25
+ chain: de,
26
+ transport: le(`https://11155420.rpc.thirdweb.com/${e}`)
27
+ });
28
+ }
29
+ var S = null, C = null;
30
+ function w() {
31
+ let { thirdwebClientId: e } = $();
32
+ return (!S || C !== e) && (C = e, S = _e(e)), S;
33
+ }
34
+ async function T(e) {
35
+ return w().waitForTransactionReceipt({ hash: e });
36
+ }
37
+ async function E(e) {
38
+ let t = await w().getBytecode({ address: e });
39
+ return !!t && t !== "0x";
40
+ }
41
+ async function ve(e) {
42
+ try {
43
+ let t = await w().getBlock({ blockNumber: e });
44
+ if (t?.timestamp != null) return Number(t.timestamp) * 1e3;
45
+ } catch {}
46
+ return null;
47
+ }
48
+ var ye = 5, be = 6e3;
49
+ async function D(e, t = ye, n = be) {
50
+ for (let r = 0; r < t; r++) {
51
+ if (await E(e)) return !0;
52
+ r < t - 1 && await new Promise((e) => {
53
+ setTimeout(e, n);
54
+ });
55
+ }
56
+ return !1;
57
+ }
58
+ //#endregion
59
+ //#region src/helpers/abi/publisher.ts
60
+ var O = [{
61
+ name: "schema",
62
+ type: "bytes32"
63
+ }, {
64
+ name: "data",
65
+ type: "tuple[]",
66
+ components: [
67
+ {
68
+ name: "recipient",
69
+ type: "address"
70
+ },
71
+ {
72
+ name: "expirationTime",
73
+ type: "uint64"
74
+ },
75
+ {
76
+ name: "revocable",
77
+ type: "bool"
78
+ },
79
+ {
80
+ name: "refUID",
81
+ type: "bytes32"
82
+ },
83
+ {
84
+ name: "data",
85
+ type: "bytes"
86
+ },
87
+ {
88
+ name: "value",
89
+ type: "uint256"
90
+ }
91
+ ]
92
+ }], xe = [{
93
+ type: "function",
94
+ name: "multiPublish",
95
+ stateMutability: "nonpayable",
96
+ inputs: [{
97
+ name: "requests",
98
+ type: "tuple[]",
99
+ components: [
100
+ {
101
+ name: "localId",
102
+ type: "string"
103
+ },
104
+ {
105
+ name: "seedUid",
106
+ type: "bytes32"
107
+ },
108
+ {
109
+ name: "seedSchemaUid",
110
+ type: "bytes32"
111
+ },
112
+ {
113
+ name: "versionUid",
114
+ type: "bytes32"
115
+ },
116
+ {
117
+ name: "versionSchemaUid",
118
+ type: "bytes32"
119
+ },
120
+ {
121
+ name: "seedIsRevocable",
122
+ type: "bool"
123
+ },
124
+ {
125
+ name: "listOfAttestations",
126
+ type: "tuple[]",
127
+ components: O
128
+ },
129
+ {
130
+ name: "propertiesToUpdate",
131
+ type: "tuple[]",
132
+ components: [{
133
+ name: "publishLocalId",
134
+ type: "string"
135
+ }, {
136
+ name: "propertySchemaUid",
137
+ type: "bytes32"
138
+ }]
139
+ }
140
+ ]
141
+ }],
142
+ outputs: [{ type: "bytes32[]" }]
143
+ }], Se = [{
144
+ type: "function",
145
+ name: "multiPublish",
146
+ stateMutability: "nonpayable",
147
+ inputs: [{
148
+ name: "requests",
149
+ type: "tuple[]",
150
+ components: [
151
+ {
152
+ name: "localIdIndex",
153
+ type: "uint256"
154
+ },
155
+ {
156
+ name: "seedUid",
157
+ type: "bytes32"
158
+ },
159
+ {
160
+ name: "seedSchemaUid",
161
+ type: "bytes32"
162
+ },
163
+ {
164
+ name: "versionUid",
165
+ type: "bytes32"
166
+ },
167
+ {
168
+ name: "versionSchemaUid",
169
+ type: "bytes32"
170
+ },
171
+ {
172
+ name: "seedIsRevocable",
173
+ type: "bool"
174
+ },
175
+ {
176
+ name: "listOfAttestations",
177
+ type: "tuple[]",
178
+ components: O
179
+ },
180
+ {
181
+ name: "propertiesToUpdate",
182
+ type: "tuple[]",
183
+ components: [{
184
+ name: "publishLocalIdIndex",
185
+ type: "uint256"
186
+ }, {
187
+ name: "propertySchemaUid",
188
+ type: "bytes32"
189
+ }]
190
+ }
191
+ ]
192
+ }],
193
+ outputs: [{ type: "bytes32[]" }]
194
+ }], k = [
195
+ {
196
+ type: "function",
197
+ name: "getEas",
198
+ stateMutability: "view",
199
+ inputs: [],
200
+ outputs: [{ type: "address" }]
201
+ },
202
+ {
203
+ type: "function",
204
+ name: "setEas",
205
+ stateMutability: "nonpayable",
206
+ inputs: [{
207
+ name: "_eas",
208
+ type: "address"
209
+ }],
210
+ outputs: [{ type: "string" }]
211
+ },
212
+ {
213
+ type: "function",
214
+ name: "isActiveSigner",
215
+ stateMutability: "view",
216
+ inputs: [{
217
+ name: "signer",
218
+ type: "address"
219
+ }],
220
+ outputs: [{ type: "bool" }]
221
+ }
222
+ ], Ce = [{
223
+ type: "event",
224
+ name: "CreatedAttestation",
225
+ inputs: [{
226
+ name: "result",
227
+ type: "tuple",
228
+ indexed: !1,
229
+ components: [{
230
+ name: "schemaUid",
231
+ type: "bytes32"
232
+ }, {
233
+ name: "attestationUid",
234
+ type: "bytes32"
235
+ }]
236
+ }]
237
+ }, {
238
+ type: "event",
239
+ name: "SeedPublished",
240
+ inputs: [{
241
+ name: "returnedDataFromEAS",
242
+ type: "bytes",
243
+ indexed: !1
244
+ }]
245
+ }], A = [{
246
+ type: "function",
247
+ name: "getAddress",
248
+ stateMutability: "view",
249
+ inputs: [{
250
+ name: "_adminSigner",
251
+ type: "address"
252
+ }, {
253
+ name: "_data",
254
+ type: "bytes"
255
+ }],
256
+ outputs: [{ type: "address" }]
257
+ }, {
258
+ type: "function",
259
+ name: "createAccount",
260
+ stateMutability: "nonpayable",
261
+ inputs: [{
262
+ name: "_admin",
263
+ type: "address"
264
+ }, {
265
+ name: "_data",
266
+ type: "bytes"
267
+ }],
268
+ outputs: [{ type: "address" }]
269
+ }], we = [
270
+ {
271
+ type: "error",
272
+ name: "AccessDenied",
273
+ inputs: []
274
+ },
275
+ {
276
+ type: "error",
277
+ name: "AlreadyRevoked",
278
+ inputs: []
279
+ },
280
+ {
281
+ type: "error",
282
+ name: "InvalidRevocation",
283
+ inputs: []
284
+ },
285
+ {
286
+ type: "error",
287
+ name: "InvalidRevocations",
288
+ inputs: []
289
+ },
290
+ {
291
+ type: "error",
292
+ name: "InvalidSchema",
293
+ inputs: []
294
+ },
295
+ {
296
+ type: "error",
297
+ name: "Irrevocable",
298
+ inputs: []
299
+ },
300
+ {
301
+ type: "error",
302
+ name: "NotFound",
303
+ inputs: []
304
+ },
305
+ {
306
+ type: "error",
307
+ name: "NotPayable",
308
+ inputs: []
309
+ },
310
+ {
311
+ type: "error",
312
+ name: "InsufficientValue",
313
+ inputs: []
314
+ },
315
+ {
316
+ type: "error",
317
+ name: "InvalidLength",
318
+ inputs: []
319
+ }
320
+ ], j = [
321
+ {
322
+ name: "recipient",
323
+ type: "address"
324
+ },
325
+ {
326
+ name: "expirationTime",
327
+ type: "uint64"
328
+ },
329
+ {
330
+ name: "revocable",
331
+ type: "bool"
332
+ },
333
+ {
334
+ name: "refUID",
335
+ type: "bytes32"
336
+ },
337
+ {
338
+ name: "data",
339
+ type: "bytes"
340
+ },
341
+ {
342
+ name: "value",
343
+ type: "uint256"
344
+ }
345
+ ], M = [
346
+ {
347
+ type: "function",
348
+ name: "attest",
349
+ stateMutability: "payable",
350
+ inputs: [{
351
+ name: "request",
352
+ type: "tuple",
353
+ components: [{
354
+ name: "schema",
355
+ type: "bytes32"
356
+ }, {
357
+ name: "data",
358
+ type: "tuple",
359
+ components: j
360
+ }]
361
+ }],
362
+ outputs: [{ type: "bytes32" }]
363
+ },
364
+ {
365
+ type: "function",
366
+ name: "multiAttest",
367
+ stateMutability: "payable",
368
+ inputs: [{
369
+ name: "requests",
370
+ type: "tuple[]",
371
+ components: [{
372
+ name: "schema",
373
+ type: "bytes32"
374
+ }, {
375
+ name: "data",
376
+ type: "tuple[]",
377
+ components: j
378
+ }]
379
+ }],
380
+ outputs: [{ type: "bytes32[]" }]
381
+ },
382
+ {
383
+ type: "function",
384
+ name: "multiRevoke",
385
+ stateMutability: "payable",
386
+ inputs: [{
387
+ name: "multiRequests",
388
+ type: "tuple[]",
389
+ components: [{
390
+ name: "schema",
391
+ type: "bytes32"
392
+ }, {
393
+ name: "data",
394
+ type: "tuple[]",
395
+ components: [{
396
+ name: "uid",
397
+ type: "bytes32"
398
+ }, {
399
+ name: "value",
400
+ type: "uint256"
401
+ }]
402
+ }]
403
+ }],
404
+ outputs: []
405
+ },
406
+ {
407
+ type: "event",
408
+ name: "Attested",
409
+ inputs: [
410
+ {
411
+ name: "recipient",
412
+ type: "address",
413
+ indexed: !0
414
+ },
415
+ {
416
+ name: "attester",
417
+ type: "address",
418
+ indexed: !0
419
+ },
420
+ {
421
+ name: "uid",
422
+ type: "bytes32",
423
+ indexed: !1
424
+ },
425
+ {
426
+ name: "schemaUID",
427
+ type: "bytes32",
428
+ indexed: !0
429
+ }
430
+ ]
431
+ },
432
+ ...we
433
+ ], N = [{
434
+ type: "function",
435
+ name: "getSchema",
436
+ stateMutability: "view",
437
+ inputs: [{
438
+ name: "uid",
439
+ type: "bytes32"
440
+ }],
441
+ outputs: [{
442
+ name: "",
443
+ type: "tuple",
444
+ components: [
445
+ {
446
+ name: "uid",
447
+ type: "bytes32"
448
+ },
449
+ {
450
+ name: "resolver",
451
+ type: "address"
452
+ },
453
+ {
454
+ name: "revocable",
455
+ type: "bool"
456
+ },
457
+ {
458
+ name: "schema",
459
+ type: "string"
460
+ }
461
+ ]
462
+ }]
463
+ }, {
464
+ type: "function",
465
+ name: "register",
466
+ stateMutability: "nonpayable",
467
+ inputs: [
468
+ {
469
+ name: "schema",
470
+ type: "string"
471
+ },
472
+ {
473
+ name: "resolver",
474
+ type: "address"
475
+ },
476
+ {
477
+ name: "revocable",
478
+ type: "bool"
479
+ }
480
+ ],
481
+ outputs: [{ type: "bytes32" }]
482
+ }];
483
+ //#endregion
484
+ //#region src/helpers/contracts/index.ts
485
+ function Te(e, t, n) {
486
+ return {
487
+ to: e,
488
+ data: _({
489
+ abi: xe,
490
+ functionName: "multiPublish",
491
+ args: [t]
492
+ }),
493
+ gas: n
494
+ };
495
+ }
496
+ function Ee(e, t, n) {
497
+ return {
498
+ to: e,
499
+ data: _({
500
+ abi: Se,
501
+ functionName: "multiPublish",
502
+ args: [t]
503
+ }),
504
+ gas: n
505
+ };
506
+ }
507
+ function De(e, t) {
508
+ return {
509
+ to: e,
510
+ data: _({
511
+ abi: k,
512
+ functionName: "setEas",
513
+ args: [t]
514
+ })
515
+ };
516
+ }
517
+ async function Oe(e) {
518
+ return w().readContract({
519
+ address: e,
520
+ abi: k,
521
+ functionName: "getEas"
522
+ });
523
+ }
524
+ async function ke(e, t) {
525
+ return w().readContract({
526
+ address: e,
527
+ abi: k,
528
+ functionName: "isActiveSigner",
529
+ args: [t]
530
+ });
531
+ }
532
+ async function Ae(e, t = "0x") {
533
+ let { thirdwebAccountFactoryAddress: n } = $();
534
+ return w().readContract({
535
+ address: n || "0x76f47d88bfaf670f5208911181fcdc0e160cb16d",
536
+ abi: A,
537
+ functionName: "getAddress",
538
+ args: [e, t]
539
+ });
540
+ }
541
+ function je(e, t = "0x") {
542
+ let { thirdwebAccountFactoryAddress: n } = $();
543
+ return {
544
+ to: n || "0x76f47d88bfaf670f5208911181fcdc0e160cb16d",
545
+ data: _({
546
+ abi: A,
547
+ functionName: "createAccount",
548
+ args: [e, t]
549
+ })
550
+ };
551
+ }
552
+ var Me = "0x0000000000000000000000000000000000000000";
553
+ function P(e) {
554
+ let { easContractAddress: t } = $();
555
+ return {
556
+ to: t,
557
+ data: _({
558
+ abi: M,
559
+ functionName: "attest",
560
+ args: [{
561
+ schema: e.schema,
562
+ data: {
563
+ recipient: e.data.recipient ?? Me,
564
+ expirationTime: e.data.expirationTime ?? 0n,
565
+ revocable: e.data.revocable ?? !0,
566
+ refUID: e.data.refUID,
567
+ data: e.data.data,
568
+ value: e.data.value ?? 0n
569
+ }
570
+ }]
571
+ })
572
+ };
573
+ }
574
+ function F(e) {
575
+ let { easContractAddress: t } = $();
576
+ return {
577
+ to: t,
578
+ data: _({
579
+ abi: M,
580
+ functionName: "multiAttest",
581
+ args: [e]
582
+ })
583
+ };
584
+ }
585
+ function Ne(e) {
586
+ let { easContractAddress: t } = $();
587
+ return {
588
+ to: t,
589
+ data: _({
590
+ abi: M,
591
+ functionName: "multiRevoke",
592
+ args: [e.map((e) => ({
593
+ schema: e.schema,
594
+ data: e.data.map((e) => ({
595
+ uid: e.uid,
596
+ value: e.value ?? 0n
597
+ }))
598
+ }))]
599
+ })
600
+ };
601
+ }
602
+ var Pe = "0x" + "0".repeat(64);
603
+ async function Fe(e) {
604
+ let t = await w().readContract({
605
+ address: v,
606
+ abi: N,
607
+ functionName: "getSchema",
608
+ args: [e]
609
+ });
610
+ return !t || t.uid === Pe ? null : {
611
+ uid: t.uid,
612
+ resolver: t.resolver,
613
+ revocable: t.revocable,
614
+ schema: t.schema
615
+ };
616
+ }
617
+ function Ie(e) {
618
+ return {
619
+ to: v,
620
+ data: _({
621
+ abi: N,
622
+ functionName: "register",
623
+ args: [
624
+ e.schema,
625
+ e.resolverAddress,
626
+ e.revocable
627
+ ]
628
+ })
629
+ };
630
+ }
631
+ //#endregion
632
+ //#region src/helpers/thirdweb.ts
633
+ var Le = /* @__PURE__ */ e({
634
+ ExternalWalletsForDeploy: () => ze,
635
+ appMetadata: () => He,
636
+ deployManagedAccountViaFactory: () => Ve,
637
+ deploySmartWalletContract: () => Be,
638
+ getClient: () => B,
639
+ getConnectedAccount: () => Y,
640
+ getConnectedManagedAccountAddress: () => J,
641
+ getConnectedModularAccount: () => Ue,
642
+ getManagedAccountWallet: () => X,
643
+ getModularAccountWallet: () => Z,
644
+ getSharedPublishInAppWalletStorage: () => R,
645
+ getSmartWalletAddressForAdmin: () => W,
646
+ getWalletsForConnectButton: () => qe,
647
+ isSmartWalletDeployed: () => G,
648
+ pollSmartWalletDeployed: () => K,
649
+ resolveSmartWalletForPublish: () => q,
650
+ useActiveSmartWalletContract: () => U,
651
+ useLocalWalletAccount: () => H,
652
+ wallets: () => V
653
+ }), Re = oe("permaPress:helpers:thirdweb"), I = "seedProtocol:inAppPublish:", L = null;
654
+ function R() {
655
+ return L ||= {
656
+ getItem: async (e) => typeof window > "u" ? null : localStorage.getItem(I + e),
657
+ setItem: async (e, t) => {
658
+ typeof window > "u" || localStorage.setItem(I + e, t);
659
+ },
660
+ removeItem: async (e) => {
661
+ typeof window > "u" || localStorage.removeItem(I + e);
662
+ }
663
+ }, L;
664
+ }
665
+ var z = null;
666
+ function B() {
667
+ if (!z) {
668
+ let { thirdwebClientId: e } = $();
669
+ z = l({ clientId: e });
670
+ }
671
+ return z;
672
+ }
673
+ var V = [f("io.metamask")], H = () => {
674
+ let [e, t] = h(null);
675
+ return f("io.metamask"), ae(!1), m(() => {}, []), e;
676
+ }, U = () => {
677
+ let e = ie(), [t, n] = h(null);
678
+ return m(() => {
679
+ !e || !e.address || n(d({
680
+ client: B(),
681
+ chain: g,
682
+ address: e.address
683
+ }));
684
+ }, [e]), t;
685
+ };
686
+ async function W(e, t = "0x") {
687
+ return Ae(e, t);
688
+ }
689
+ async function G(e) {
690
+ return E(e);
691
+ }
692
+ async function K(e, t, n) {
693
+ return D(e, t, n);
694
+ }
695
+ async function q(e) {
696
+ if (!e) return { needsDeploy: !0 };
697
+ if (await G(e.address)) return {
698
+ address: e.address,
699
+ account: e
700
+ };
701
+ let t = await W(e.address);
702
+ return await G(t) ? {
703
+ address: t,
704
+ account: e
705
+ } : { needsDeploy: !0 };
706
+ }
707
+ var ze = [f("io.metamask"), f("me.rainbow")], Be = async (e) => {
708
+ let t = d({
709
+ client: B(),
710
+ chain: g,
711
+ address: e.address
712
+ }), n = await u({
713
+ smartAccount: e,
714
+ chain: g,
715
+ client: B(),
716
+ accountContract: t
717
+ });
718
+ return Re("deploySmartAccount result:", n), n;
719
+ };
720
+ async function Ve(e) {
721
+ let n = t(e.signingAccount), r = je(e.adminAddress, e.data ?? "0x");
722
+ await n.sendTransaction(r);
723
+ }
724
+ var He = {
725
+ name: "Seed Protocol",
726
+ description: "Seed Protocol",
727
+ url: "https://seedprotocol.io"
728
+ };
729
+ async function J(e = g) {
730
+ let t = X();
731
+ await t.autoConnect({
732
+ client: B(),
733
+ chain: e
734
+ });
735
+ let n = t.getAccount();
736
+ if (!n) throw Error("Failed to get managed account");
737
+ return n.address;
738
+ }
739
+ async function Y() {
740
+ try {
741
+ let e = Z();
742
+ return await e.autoConnect({
743
+ client: B(),
744
+ chain: g
745
+ }), e.getAccount() ?? null;
746
+ } catch {
747
+ return null;
748
+ }
749
+ }
750
+ async function Ue() {
751
+ return Y();
752
+ }
753
+ var We = null, X = () => (We ||= p({
754
+ storage: R(),
755
+ auth: { options: [
756
+ "farcaster",
757
+ "email",
758
+ "passkey",
759
+ "phone"
760
+ ] },
761
+ executionMode: {
762
+ mode: "EIP4337",
763
+ smartAccount: {
764
+ chain: g,
765
+ factoryAddress: y,
766
+ gasless: !0
767
+ }
768
+ }
769
+ }), We), Ge = null, Z = () => (Ge ||= p({
770
+ storage: R(),
771
+ auth: { options: [
772
+ "farcaster",
773
+ "email",
774
+ "passkey",
775
+ "phone"
776
+ ] },
777
+ executionMode: {
778
+ mode: "EIP7702",
779
+ sponsorGas: !0
780
+ }
781
+ }), Ge), Ke = null, qe = () => (Ke ||= $().useModularExecutor ? [Z()] : [X()], Ke), Je = "0x" + "0".repeat(64);
782
+ function Ye(e) {
783
+ return P(e);
784
+ }
785
+ function Xe(e) {
786
+ return F(e);
787
+ }
788
+ function Ze(e) {
789
+ return ce([{ type: "bytes32" }], [e]);
790
+ }
791
+ function Qe(e, t) {
792
+ return $e(e, t)[0]?.uid;
793
+ }
794
+ function $e(e, t) {
795
+ if (!e.logs?.length) return [];
796
+ let n = t.toLowerCase(), r = e.logs.filter((e) => e.address && e.address.toLowerCase() === n);
797
+ if (!r.length) return [];
798
+ try {
799
+ let e = ue({
800
+ abi: M,
801
+ eventName: "Attested",
802
+ logs: r,
803
+ strict: !1
804
+ }), t = [];
805
+ for (let n of e) {
806
+ let e = n.args?.uid, r = n.args?.schemaUID;
807
+ !e || e === Je || r && t.push({
808
+ schemaUid: r,
809
+ uid: e
810
+ });
811
+ }
812
+ return t;
813
+ } catch {
814
+ return [];
815
+ }
816
+ }
817
+ function et(e) {
818
+ return $(), Ne(e);
819
+ }
820
+ //#endregion
821
+ //#region src/helpers/resolveRevokeAccount.ts
822
+ async function tt(e) {
823
+ let { account: t, attester: n } = e;
824
+ if (!n || t.address.toLowerCase() === n.toLowerCase()) return t;
825
+ let r = a();
826
+ if (r) {
827
+ let e = await r(), t = n.toLowerCase();
828
+ if (e?.some((e) => e?.toLowerCase() === t)) throw Error("Revocation not supported for items published via the modular executor.");
829
+ }
830
+ try {
831
+ let e = await W(t.address);
832
+ if (n.toLowerCase() === e.toLowerCase() && await G(e)) {
833
+ let e = X();
834
+ await e.autoConnect({
835
+ client: B(),
836
+ chain: g
837
+ });
838
+ let t = e.getAccount();
839
+ if (t) return t;
840
+ }
841
+ } catch {}
842
+ return t;
843
+ }
844
+ //#endregion
845
+ //#region src/services/revoke/revokeAttestations.ts
846
+ async function nt(e) {
847
+ let { seedLocalId: n, seedUid: a, seedSchemaUid: s } = e, c = await Y();
848
+ if (!c) throw Error("No wallet connected. Connect a wallet to revoke attestations.");
849
+ let ne = t(await tt({
850
+ account: c,
851
+ attester: await i({
852
+ seedLocalId: n,
853
+ seedUid: a
854
+ })
855
+ })), [l, u] = await Promise.all([te(a), ee(a)]), d = l.map((e) => e.uid).filter((e) => o(e)), f = /* @__PURE__ */ new Map();
856
+ for (let { uid: e, schemaUid: t } of u) {
857
+ if (!o(e)) continue;
858
+ let n = f.get(t) ?? [];
859
+ n.push(e), f.set(t, n);
860
+ }
861
+ let p = [];
862
+ for (let [e, t] of f) t.length > 0 && p.push({
863
+ schema: e,
864
+ data: t.map((e) => ({ uid: e }))
865
+ });
866
+ d.length > 0 && p.push({
867
+ schema: r,
868
+ data: d.map((e) => ({ uid: e }))
869
+ }), p.push({
870
+ schema: s,
871
+ data: [{ uid: a }]
872
+ });
873
+ for (let e of p) {
874
+ if (e.data.length === 0) continue;
875
+ let t = et([e]);
876
+ try {
877
+ await T((await ne.sendTransaction(t)).transactionHash);
878
+ } catch (e) {
879
+ let t = e instanceof Error ? e.message : String(e);
880
+ if (t.includes("AccessDenied") || t.includes("0x4ca88867")) throw Error("Only the original attester can revoke attestations. Connect the wallet that published this item.");
881
+ if (t.includes("AlreadyRevoked")) continue;
882
+ throw e;
883
+ }
884
+ }
885
+ await re({
886
+ seedLocalId: n,
887
+ revokedAt: Math.floor(Date.now() / 1e3)
888
+ });
889
+ }
890
+ //#endregion
891
+ //#region src/config.ts
892
+ var Q = null;
893
+ function rt(e) {
894
+ Q = e;
895
+ }
896
+ function it() {
897
+ return Q;
898
+ }
899
+ function at(e) {
900
+ rt(e), c(async () => {
901
+ try {
902
+ return await J(g);
903
+ } catch {
904
+ return;
905
+ }
906
+ }), ne(nt), import("./worker-QZN_HMAs.js").then((e) => {
907
+ e.startArweaveL1FinalizeWorker();
908
+ }), s(async () => e.useModularExecutor && e.modularAccountModuleContract ? [e.modularAccountModuleContract] : []);
909
+ }
910
+ var ot = at;
911
+ function $() {
912
+ let e = Q;
913
+ if (!e) throw Error("@seedprotocol/publish: Call initPublish() or ensure PublishProvider is mounted with config before using the publish package");
914
+ let t = e.useArweaveBundler ?? !1, r = e.arweaveUploadVerificationBaseUrl ?? e.uploadApiBaseUrl, i = e.arweaveGraphqlUrl ?? n, a = e.useModularExecutor ?? !1;
915
+ return {
916
+ ...e,
917
+ thirdwebAccountFactoryAddress: y,
918
+ easContractAddress: b,
919
+ useIntegerLocalIds: e.useIntegerLocalIds ?? !1,
920
+ useDirectEas: e.useDirectEas ?? !1,
921
+ modularAccountModuleData: e.modularAccountModuleData ?? "0x",
922
+ useModularExecutor: a,
923
+ useArweaveBundler: t,
924
+ arweaveUploadVerificationBaseUrl: r,
925
+ arweaveGraphqlUrl: i,
926
+ autoDeployManagedAccount: e.autoDeployManagedAccount ?? !1,
927
+ autoDeployEip7702ModularAccount: st(e, a)
928
+ };
929
+ }
930
+ function st(e, t) {
931
+ return e.autoDeployEip7702ModularAccount === !0 ? !0 : e.autoDeployEip7702ModularAccount === !1 ? !1 : t;
932
+ }
933
+ //#endregion
934
+ export { pe as $, V as A, Fe as B, qe as C, Le as D, q as E, Ee as F, D as G, ve as H, Ie as I, fe as J, T as K, De as L, F as M, Ne as N, U as O, Te as P, me as Q, Oe as R, W as S, K as T, w as U, Ce as V, E as W, x as X, he as Y, ge as Z, J as _, Je as a, Z as b, $e as c, ze as d, He as f, Y as g, B as h, at as i, P as j, H as k, Ye as l, Be as m, it as n, Ze as o, Ve as p, b as q, $ as r, Qe as s, ot as t, Xe as u, Ue as v, G as w, R as x, X as y, ke as z };
935
+
936
+ //# sourceMappingURL=config-Q3y4Fab2.js.map