@seedprotocol/publish 0.6.8 → 0.6.9

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