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