@seedprotocol/publish 0.7.0 → 0.7.2-next.593.gd5bd4ea

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 (91) hide show
  1. package/README.md +1 -1
  2. package/dist/{chainConfig-DWynbnb8.js → chainConfig-BDMRU4m8.js} +5 -5
  3. package/dist/chainConfig-BDMRU4m8.js.map +1 -0
  4. package/dist/collectBatchUids-CnIe9jUB.js.map +1 -1
  5. package/dist/{ensureAutomationSessionKey-BVmh030S.js → ensureAutomationSessionKey-bw6knEyC.js} +4 -4
  6. package/dist/ensureAutomationSessionKey-bw6knEyC.js.map +1 -0
  7. package/dist/{ensureModularPublishBootstrap-DRFhp-O2.js → ensureModularPublishBootstrap-Vc4Jz_B9.js} +5 -5
  8. package/dist/ensureModularPublishBootstrap-Vc4Jz_B9.js.map +1 -0
  9. package/dist/{ensureSmartWalletThenPublish-0nKg13WN.js → ensureSmartWalletThenPublish-42iEhiHG.js} +3 -3
  10. package/dist/ensureSmartWalletThenPublish-42iEhiHG.js.map +1 -0
  11. package/dist/index.js +6 -14
  12. package/dist/index.js.map +1 -1
  13. package/dist/{managedAccountAdmin-B4HkLWWE.js → managedAccountAdmin-B3DPMmhR.js} +4 -4
  14. package/dist/managedAccountAdmin-B3DPMmhR.js.map +1 -0
  15. package/dist/{publishAuthorization-C-XYb9Ef.js → publishAuthorization-CAFF5jQ2.js} +1033 -1044
  16. package/dist/publishAuthorization-CAFF5jQ2.js.map +1 -0
  17. package/dist/{publishThirdwebClient-BQ_KnMi5.js → publishThirdwebClient-CPzAjnmf.js} +2 -2
  18. package/dist/publishThirdwebClient-CPzAjnmf.js.map +1 -0
  19. package/dist/{resolveRevokeAccount-9-OzXVdp.js → resolveRevokeAccount-CkbTpC27.js} +4 -4
  20. package/dist/resolveRevokeAccount-CkbTpC27.js.map +1 -0
  21. package/dist/services/publish/actors/createAttestationsDirectToEas.d.ts.map +1 -1
  22. package/dist/services/publish/actors/rewritingHtmlEmbedded.d.ts.map +1 -1
  23. package/dist/services/publish/helpers/getPublishUploadData.d.ts +5 -0
  24. package/dist/services/publish/helpers/getPublishUploadData.d.ts.map +1 -1
  25. package/dist/thirdweb.js +7 -9
  26. package/dist/thirdweb.js.map +1 -1
  27. package/dist/{worker-FmHZbku5.js → worker-CCQ7KBMm.js} +2 -2
  28. package/dist/{worker-CJRUAOAn.js.map → worker-CCQ7KBMm.js.map} +1 -1
  29. package/package.json +13 -7
  30. package/dist/chainConfig-BJ8C_RRz.js +0 -1455
  31. package/dist/chainConfig-BJ8C_RRz.js.map +0 -1
  32. package/dist/chainConfig-DWynbnb8.js.map +0 -1
  33. package/dist/chainConfig-DWzoOtkS.js +0 -1453
  34. package/dist/chainConfig-DWzoOtkS.js.map +0 -1
  35. package/dist/chainConfig-DmuPBs3D.js +0 -1455
  36. package/dist/chainConfig-DmuPBs3D.js.map +0 -1
  37. package/dist/ensureAutomationSessionKey-BVmh030S.js.map +0 -1
  38. package/dist/ensureAutomationSessionKey-CxpJY_uH.js +0 -84
  39. package/dist/ensureAutomationSessionKey-CxpJY_uH.js.map +0 -1
  40. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js +0 -84
  41. package/dist/ensureAutomationSessionKey-DwRm4YMJ.js.map +0 -1
  42. package/dist/ensureAutomationSessionKey-h3zOmDr5.js +0 -84
  43. package/dist/ensureAutomationSessionKey-h3zOmDr5.js.map +0 -1
  44. package/dist/ensureModularPublishBootstrap-BImiIFJe.js +0 -23
  45. package/dist/ensureModularPublishBootstrap-BImiIFJe.js.map +0 -1
  46. package/dist/ensureModularPublishBootstrap-CmxyX_EN.js +0 -23
  47. package/dist/ensureModularPublishBootstrap-CmxyX_EN.js.map +0 -1
  48. package/dist/ensureModularPublishBootstrap-DRFhp-O2.js.map +0 -1
  49. package/dist/ensureModularPublishBootstrap-DegJnYKL.js +0 -23
  50. package/dist/ensureModularPublishBootstrap-DegJnYKL.js.map +0 -1
  51. package/dist/ensureSmartWalletThenPublish-0nKg13WN.js.map +0 -1
  52. package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js +0 -47
  53. package/dist/ensureSmartWalletThenPublish-BdqeUL6t.js.map +0 -1
  54. package/dist/ensureSmartWalletThenPublish-BfEndtFo.js +0 -47
  55. package/dist/ensureSmartWalletThenPublish-BfEndtFo.js.map +0 -1
  56. package/dist/ensureSmartWalletThenPublish-DuOYPJFd.js +0 -47
  57. package/dist/ensureSmartWalletThenPublish-DuOYPJFd.js.map +0 -1
  58. package/dist/managedAccountAdmin-B4HkLWWE.js.map +0 -1
  59. package/dist/managedAccountAdmin-ByEX_Eg2.js +0 -28
  60. package/dist/managedAccountAdmin-ByEX_Eg2.js.map +0 -1
  61. package/dist/managedAccountAdmin-DS6nniiu.js +0 -28
  62. package/dist/managedAccountAdmin-DS6nniiu.js.map +0 -1
  63. package/dist/managedAccountAdmin-DwFI-ZfE.js +0 -28
  64. package/dist/managedAccountAdmin-DwFI-ZfE.js.map +0 -1
  65. package/dist/publishAuthorization-C-XYb9Ef.js.map +0 -1
  66. package/dist/publishAuthorization-CG23g8w2.js +0 -3987
  67. package/dist/publishAuthorization-CG23g8w2.js.map +0 -1
  68. package/dist/publishAuthorization-CvK_coYp.js +0 -4011
  69. package/dist/publishAuthorization-CvK_coYp.js.map +0 -1
  70. package/dist/publishAuthorization-DgDI4zor.js +0 -4011
  71. package/dist/publishAuthorization-DgDI4zor.js.map +0 -1
  72. package/dist/publishThirdwebClient-BQ_KnMi5.js.map +0 -1
  73. package/dist/publishThirdwebClient-BmqsJCjp.js +0 -18
  74. package/dist/publishThirdwebClient-BmqsJCjp.js.map +0 -1
  75. package/dist/publishThirdwebClient-CO18ST7C.js +0 -18
  76. package/dist/publishThirdwebClient-CO18ST7C.js.map +0 -1
  77. package/dist/publishThirdwebClient-D-K2WEeM.js +0 -18
  78. package/dist/publishThirdwebClient-D-K2WEeM.js.map +0 -1
  79. package/dist/resolveRevokeAccount-9-OzXVdp.js.map +0 -1
  80. package/dist/resolveRevokeAccount-CXa5XlOv.js +0 -38
  81. package/dist/resolveRevokeAccount-CXa5XlOv.js.map +0 -1
  82. package/dist/resolveRevokeAccount-DsNod8ti.js +0 -38
  83. package/dist/resolveRevokeAccount-DsNod8ti.js.map +0 -1
  84. package/dist/resolveRevokeAccount-QgZ6YZuS.js +0 -38
  85. package/dist/resolveRevokeAccount-QgZ6YZuS.js.map +0 -1
  86. package/dist/worker-CJRUAOAn.js +0 -69
  87. package/dist/worker-CN7zg73B.js +0 -69
  88. package/dist/worker-CN7zg73B.js.map +0 -1
  89. package/dist/worker-FmHZbku5.js.map +0 -1
  90. package/dist/worker-qoGuo876.js +0 -69
  91. package/dist/worker-qoGuo876.js.map +0 -1
@@ -1,1453 +0,0 @@
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, getAbiItem as h, http as g, parseEventLogs as re, toFunctionSelector as ie, zeroAddress as ae } from "viem";
5
- import { prepareTransaction as oe, sendTransaction as se } from "thirdweb";
6
- import { ethers as ce } from "ethers";
7
- import { defineChain as le, optimismSepolia as ue } from "thirdweb/chains";
8
- import { configureEasReadChain as de, expectEasReadChain as fe, resolveEasChainDeployment as pe } from "@seedprotocol/eas";
9
- //#region src/helpers/constants.ts
10
- var me = "0x44d562ac1d7cd77e232978687fea027ace48f719cf1d58c7888e509663bb87fc", he = { 11155420: "0x76f47d88bfaf670f5208911181fcdc0e160cb16d" }, ge = "0xcd8c945872df8e664e55cf8885c85ea3ea8f2148", _e = ge, ve = {
11
- SUCCESS: "success",
12
- FAILURE: "failure"
13
- }, ye = [
14
- "pollingForConfirmation",
15
- "uploadingData",
16
- "uploadingViaBundler",
17
- "uploadingViaBundlerPhase2"
18
- ], be = 3e4, _ = t, xe = [
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
- ], Se = [
70
- {
71
- name: "recipient",
72
- type: "address"
73
- },
74
- {
75
- name: "expirationTime",
76
- type: "uint64"
77
- },
78
- {
79
- name: "revocable",
80
- type: "bool"
81
- },
82
- {
83
- name: "refUID",
84
- type: "bytes32"
85
- },
86
- {
87
- name: "data",
88
- type: "bytes"
89
- },
90
- {
91
- name: "value",
92
- type: "uint256"
93
- }
94
- ], v = [
95
- {
96
- type: "function",
97
- name: "attest",
98
- stateMutability: "payable",
99
- inputs: [{
100
- name: "request",
101
- type: "tuple",
102
- components: [{
103
- name: "schema",
104
- type: "bytes32"
105
- }, {
106
- name: "data",
107
- type: "tuple",
108
- components: Se
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: Se
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
- ...xe
182
- ], Ce = [{
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
- }], y = [
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
- ], we = [{
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
- }], b = [
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
- ], Te = [{
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
- }], x = [
391
- Ce[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
- ], S = [
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
- ], Ee = 2n, C = [{
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 w(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 T = class extends Error {
609
- code;
610
- managedAddress;
611
- underlyingCause;
612
- constructor(e, t, n, r) {
613
- let i = r != null && r !== "" ? ` (${w(r)})` : "";
614
- super(e + i), this.code = t, this.managedAddress = n, this.name = "ManagedAccountPublishError", this.underlyingCause = r;
615
- }
616
- }, E = 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 Oe(e) {
624
- if (e instanceof T) 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 D = class extends Error {
630
- code;
631
- modularAddress;
632
- underlyingCause;
633
- constructor(e, t, n, r) {
634
- let i = r != null && r !== "" ? ` (${w(r)})` : "";
635
- super(e + i), this.code = t, this.modularAddress = n, this.name = "Eip7702ModularAccountPublishError", this.underlyingCause = r;
636
- }
637
- }, ke = [
638
- "EIP7702_MODULAR_ACCOUNT_UNAVAILABLE",
639
- "EIP7702_MODULAR_NOT_UPGRADED",
640
- "EIP7702_MODULAR_DEPLOY_FAILED",
641
- "EIP7702_MODULAR_NOT_CONFIRMED"
642
- ];
643
- function Ae(e) {
644
- if (e instanceof D) return !0;
645
- if (typeof e != "object" || !e) return !1;
646
- let t = e;
647
- return t.name === "Eip7702ModularAccountPublishError" && typeof t.code == "string" && ke.includes(t.code);
648
- }
649
- function je(e) {
650
- let t = w(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 O = null, k = null;
656
- function Me() {
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 Ne() {
665
- let e = Q(), t = $(), n = Me();
666
- return f({
667
- chain: e,
668
- transport: g(t, n ? { fetchOptions: n } : void 0)
669
- });
670
- }
671
- function A() {
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 (!O || k !== r) && (k = r, O = Ne()), O;
680
- }
681
- async function j(e) {
682
- let t = await A().waitForTransactionReceipt({ hash: e });
683
- if (t.status === "reverted") throw new E(e, t);
684
- return t;
685
- }
686
- async function Pe(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 M(e) {
692
- let t = await A().getBytecode({ address: e });
693
- return !!t && t !== "0x";
694
- }
695
- async function Fe(e) {
696
- try {
697
- let t = await A().getBlock({ blockNumber: e });
698
- if (t?.timestamp != null) return Number(t.timestamp) * 1e3;
699
- } catch {}
700
- return null;
701
- }
702
- var Ie = 5, Le = 6e3;
703
- async function Re(e, t = Ie, n = Le) {
704
- for (let r = 0; r < t; r++) {
705
- if (await M(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 ze(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 N(e, t, n) {
732
- let r = ze(t);
733
- return {
734
- to: e,
735
- data: m({
736
- abi: Ce,
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 Be(e, t, n) {
753
- return N(e, t, n);
754
- }
755
- async function Ve(e, t) {
756
- return A().readContract({
757
- address: e,
758
- abi: x,
759
- functionName: "isInitialized",
760
- args: [t]
761
- });
762
- }
763
- async function He(e, t) {
764
- return A().readContract({
765
- address: e,
766
- abi: x,
767
- functionName: "getEAS",
768
- args: [t]
769
- });
770
- }
771
- async function Ue(e) {
772
- try {
773
- let [t, n] = await A().readContract({
774
- address: e,
775
- abi: S,
776
- functionName: "getSeedExecutor"
777
- });
778
- return {
779
- executor: t,
780
- eas: n
781
- };
782
- } catch {
783
- return null;
784
- }
785
- }
786
- async function We(e = Z()) {
787
- let t = A(), n = await t.readContract({
788
- address: e,
789
- abi: b,
790
- functionName: "getImplementationForFunction",
791
- args: [ie(h({
792
- abi: S,
793
- name: "getSeedExecutor"
794
- }))]
795
- });
796
- if (n === ae) return null;
797
- let [r, i] = await t.readContract({
798
- address: n,
799
- abi: S,
800
- functionName: "getSeedExecutor"
801
- });
802
- return {
803
- executor: r,
804
- eas: i
805
- };
806
- }
807
- async function Ge(e, t) {
808
- return A().readContract({
809
- address: e,
810
- abi: S,
811
- functionName: "isModuleInstalled",
812
- args: [
813
- Ee,
814
- t,
815
- "0x"
816
- ]
817
- });
818
- }
819
- function Ke(e) {
820
- return {
821
- to: e,
822
- data: m({
823
- abi: S,
824
- functionName: "installSeedExecutor"
825
- })
826
- };
827
- }
828
- function qe(e, t) {
829
- return {
830
- to: e,
831
- data: m({
832
- abi: y,
833
- functionName: "setEas",
834
- args: [t]
835
- })
836
- };
837
- }
838
- async function Je(e) {
839
- return A().readContract({
840
- address: e,
841
- abi: y,
842
- functionName: "getEas"
843
- });
844
- }
845
- async function Ye(e, t) {
846
- return A().readContract({
847
- address: e,
848
- abi: y,
849
- functionName: "isActiveSigner",
850
- args: [t]
851
- });
852
- }
853
- async function Xe(e, t) {
854
- return A().readContract({
855
- address: e,
856
- abi: y,
857
- functionName: "isAdmin",
858
- args: [t]
859
- });
860
- }
861
- async function Ze(e, t = "0x") {
862
- return A().readContract({
863
- address: Z(),
864
- abi: b,
865
- functionName: "getAddress",
866
- args: [e, t]
867
- });
868
- }
869
- function Qe(e, t = "0x") {
870
- return {
871
- to: Z(),
872
- data: m({
873
- abi: b,
874
- functionName: "createAccount",
875
- args: [e, t]
876
- })
877
- };
878
- }
879
- var $e = "0x0000000000000000000000000000000000000000";
880
- function P(e) {
881
- let { easContractAddress: t } = Y();
882
- return {
883
- to: t,
884
- data: m({
885
- abi: v,
886
- functionName: "attest",
887
- args: [{
888
- schema: e.schema,
889
- data: {
890
- recipient: e.data.recipient ?? $e,
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 F(e) {
902
- let { easContractAddress: t } = Y();
903
- return {
904
- to: t,
905
- data: m({
906
- abi: v,
907
- functionName: "multiAttest",
908
- args: [e]
909
- })
910
- };
911
- }
912
- function et(e) {
913
- let { easContractAddress: t } = Y();
914
- return {
915
- to: t,
916
- data: m({
917
- abi: v,
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 tt = "0x" + "0".repeat(64);
930
- async function nt(e) {
931
- let t = await A().readContract({
932
- address: Y().schemaRegistryAddress,
933
- abi: C,
934
- functionName: "getSchema",
935
- args: [e]
936
- });
937
- return !t || t.uid === tt ? null : {
938
- uid: t.uid,
939
- resolver: t.resolver,
940
- revocable: t.revocable,
941
- schema: t.schema
942
- };
943
- }
944
- function rt(e) {
945
- return {
946
- to: Y().schemaRegistryAddress,
947
- data: m({
948
- abi: C,
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 it = "0x0000000000000000000000000000000000000000", at = "0x" + "0".repeat(64);
961
- function ot(e) {
962
- return P(e);
963
- }
964
- function st(e) {
965
- return F(e);
966
- }
967
- function ct(e) {
968
- return p([{ type: "bytes32" }], [e]);
969
- }
970
- function lt(e, t) {
971
- return ut(e, t)[0]?.uid;
972
- }
973
- function ut(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 = re({
979
- abi: v,
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 !== at && r && t.push({
987
- schemaUid: r,
988
- uid: e
989
- });
990
- }
991
- return t;
992
- } catch {
993
- return [];
994
- }
995
- }
996
- function dt(e) {
997
- return et(e);
998
- }
999
- //#endregion
1000
- //#region src/helpers/publishWalletRegistry.ts
1001
- var I = null;
1002
- function ft() {
1003
- return a.isInitialized() ? Promise.resolve() : new Promise((e) => {
1004
- a.onReady(() => e());
1005
- });
1006
- }
1007
- async function pt(e) {
1008
- if (I = e, !e) return;
1009
- await ft();
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 L() {
1022
- return I;
1023
- }
1024
- function mt() {
1025
- I = null;
1026
- }
1027
- //#endregion
1028
- //#region src/helpers/retryNonceTooLow.ts
1029
- function ht(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 gt(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 || !ht(e)) throw e;
1042
- await new Promise((e) => setTimeout(e, n));
1043
- }
1044
- }
1045
- //#endregion
1046
- //#region src/helpers/seedSigner.ts
1047
- var _t = Symbol.for("seedprotocol.SeedSigner"), vt = Symbol.for("seedprotocol.SeedTxSender");
1048
- function R(e) {
1049
- return Object.assign(e, { [_t]: !0 });
1050
- }
1051
- function z(e) {
1052
- return Object.assign(e, { [vt]: !0 });
1053
- }
1054
- function B(e) {
1055
- return !!e && typeof e == "object" && _t in e;
1056
- }
1057
- function V(e) {
1058
- return !!e && typeof e == "object" && vt in e;
1059
- }
1060
- function H(e) {
1061
- return !!e && typeof e == "object" && "signer" in e && "txSender" in e && B(e.signer) && V(e.txSender);
1062
- }
1063
- function yt(e) {
1064
- let t = e.address;
1065
- return {
1066
- signer: R({
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" ? ce.getBytes(n) : n instanceof Uint8Array ? n : new Uint8Array(n);
1071
- return await e.signMessage(r);
1072
- }
1073
- }),
1074
- txSender: z({
1075
- address: t,
1076
- sendTransaction: async (t) => ({ transactionHash: (await gt(() => 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 bt(e) {
1086
- if (H(e)) return e.signer;
1087
- if (B(e)) return e;
1088
- throw Error("@seedprotocol/publish: expected a SeedSigner or PublishWallet. Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
1089
- }
1090
- function xt(e) {
1091
- if (H(e)) return e.txSender;
1092
- if (V(e)) return e;
1093
- throw Error("@seedprotocol/publish: expected a SeedTxSender or PublishWallet. Use fromEthersWallet, fromEip1193Provider, or fromThirdwebAccount.");
1094
- }
1095
- function St(e) {
1096
- if (H(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 U = null;
1102
- function Ct(e) {
1103
- let t = e ?? Rt() ?? {}, n = t.chain ?? _, r = t.rpcUrl?.trim() || void 0, i = `${n.id}|${r ?? ""}`;
1104
- if (U?.key === i) return U.chain;
1105
- let a;
1106
- return a = n.id === ue.id && !r ? ue : le({
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
- }), U = {
1118
- key: i,
1119
- chain: a
1120
- }, a;
1121
- }
1122
- var wt = /* @__PURE__ */ new Set([31337, 1337]);
1123
- function Tt(e) {
1124
- if (wt.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 W(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 Et(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 Dt = /* @__PURE__ */ e({
1150
- asSeedSignerFromThirdweb: () => kt,
1151
- asThirdwebPublishWallet: () => Ot,
1152
- fromThirdwebAccount: () => G
1153
- });
1154
- function G(e, t) {
1155
- let n = t?.client, r = e.address;
1156
- return {
1157
- signer: R({
1158
- address: r,
1159
- signMessage: async ({ message: t }) => await e.signMessage({ message: t })
1160
- }),
1161
- txSender: z({
1162
- address: r,
1163
- sendTransaction: async (t) => {
1164
- let i = n ?? (await import("./publishThirdwebClient-CO18ST7C.js").then((e) => e.n)).getClient(), a = Ct(), o = oe({
1165
- client: i,
1166
- chain: a,
1167
- to: t.to,
1168
- data: t.data,
1169
- value: t.value,
1170
- gas: t.gas
1171
- });
1172
- W("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 gt(() => se({
1182
- account: e,
1183
- transaction: o
1184
- }));
1185
- } catch (e) {
1186
- throw W("thirdweb sendTransaction failed", {
1187
- account: r,
1188
- error: e instanceof Error ? e.message : String(e)
1189
- }), e;
1190
- }
1191
- return W("thirdweb sendTransaction returned", {
1192
- account: r,
1193
- transactionHash: s.transactionHash
1194
- }), { transactionHash: s.transactionHash };
1195
- }
1196
- })
1197
- };
1198
- }
1199
- function Ot(e, t) {
1200
- if (H(e)) return e;
1201
- if (B(e)) throw Error("@seedprotocol/publish/thirdweb: SeedSigner alone cannot send sponsored txs. Pass fromThirdwebAccount(account) or a PublishWallet.");
1202
- return G(e, t);
1203
- }
1204
- function kt(e) {
1205
- return H(e) ? e.signer : B(e) ? e : G(e).signer;
1206
- }
1207
- //#endregion
1208
- //#region src/helpers/verifyPublishChain.ts
1209
- var K = 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
- }, q = null;
1217
- function At() {
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 jt() {
1229
- let e = Y(), { chain: t } = e, n = [], r;
1230
- try {
1231
- r = await A().getChainId();
1232
- } catch (e) {
1233
- throw new K(t.id, [`could not reach the RPC (${Mt($())}): ${e instanceof Error ? e.message : String(e)}`]);
1234
- }
1235
- 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}.`]);
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 M(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 K(t.id, n);
1260
- }
1261
- function Mt(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 Nt() {
1270
- let e = At();
1271
- if (q?.key === e) return q.result;
1272
- let t = jt();
1273
- return q = {
1274
- key: e,
1275
- result: t
1276
- }, t.catch(() => {
1277
- q?.result === t && (q = null);
1278
- }), t;
1279
- }
1280
- //#endregion
1281
- //#region src/services/revoke/revokeAttestations.ts
1282
- async function Pt(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 Ft(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-h3zOmDr5.js").then((e) => e.n);
1295
- return await e(t, n);
1296
- } catch {
1297
- return !1;
1298
- }
1299
- }
1300
- async function It(e) {
1301
- let { seedLocalId: t, seedUid: n, seedSchemaUid: a } = e;
1302
- await i(), await Nt();
1303
- let s = await o({
1304
- seedLocalId: t,
1305
- seedUid: n
1306
- });
1307
- if (await Pt(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 = L();
1309
- if (!u) try {
1310
- let { getConnectedAccount: e } = await import("./publishAuthorization-DgDI4zor.js").then((e) => e.V), { resolveRevokeAccount: t } = await import("./resolveRevokeAccount-DsNod8ti.js"), n = await e();
1311
- if (!n) throw Error("No wallet connected. Connect a wallet to revoke attestations.");
1312
- u = G(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 Ft(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 = dt([e]);
1342
- try {
1343
- await j((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
- });
1356
- }
1357
- //#endregion
1358
- //#region src/config.ts
1359
- fe("publish");
1360
- var J = null;
1361
- function Lt(e) {
1362
- J = e;
1363
- }
1364
- function Rt() {
1365
- return J;
1366
- }
1367
- function zt(e) {
1368
- let t = X(e);
1369
- de("publish", {
1370
- chainId: t.chainId,
1371
- indexerUrl: t.indexerUrl
1372
- }), Lt(e), d(async () => {
1373
- let e = L();
1374
- if (e?.publisherAddress) return e.publisherAddress;
1375
- if (e?.signer?.address) return e.signer.address;
1376
- }), te(It), import("./worker-CN7zg73B.js").then((e) => {
1377
- e.startArweaveL1FinalizeWorker();
1378
- }), u(async () => e.useModularExecutor && e.modularAccountModuleContract ? [e.modularAccountModuleContract] : []);
1379
- }
1380
- var Bt = zt;
1381
- function Vt(e) {
1382
- let t = e?.thirdweb ?? {};
1383
- return {
1384
- bundlerUrl: t.bundlerUrl?.trim() || void 0,
1385
- sponsorGas: t.sponsorGas ?? !0,
1386
- modularWalletMode: t.modularWalletMode ?? "EIP7702"
1387
- };
1388
- }
1389
- function Y() {
1390
- let e = J;
1391
- if (!e) throw Error("@seedprotocol/publish: Call initPublish() or ensure PublishProvider is mounted with config before using the publish package");
1392
- 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");
1393
- return {
1394
- ...e,
1395
- thirdwebAccountFactoryAddress: e.managedAccountFactoryAddress ?? he[o.id],
1396
- easContractAddress: s.easContractAddress,
1397
- schemaRegistryAddress: s.schemaRegistryAddress,
1398
- easChain: s,
1399
- useDirectEas: e.useDirectEas ?? !1,
1400
- modularAccountModuleData: e.modularAccountModuleData ?? "0x",
1401
- useModularExecutor: a,
1402
- useArweaveBundler: t,
1403
- arweaveUploadVerificationBaseUrl: r,
1404
- arweaveGraphqlUrl: i,
1405
- autoDeployManagedAccount: e.autoDeployManagedAccount ?? !1,
1406
- autoDeployEip7702ModularAccount: Ht(e, a),
1407
- chain: o,
1408
- accountMode: c,
1409
- thirdweb: Vt(e)
1410
- };
1411
- }
1412
- function X(e) {
1413
- let t = e.chain ?? _;
1414
- try {
1415
- return pe(t.id, {
1416
- name: t.name,
1417
- easContractAddress: e.easContractAddress,
1418
- schemaRegistryAddress: e.schemaRegistryAddress
1419
- });
1420
- } catch (e) {
1421
- throw Error(`@seedprotocol/publish: ${t.name} (chain ${t.id}) has no known EAS deployment. Pass easContractAddress and schemaRegistryAddress in initPublish / PublishProvider config.`, { cause: e });
1422
- }
1423
- }
1424
- function Z() {
1425
- let { thirdwebAccountFactoryAddress: e, chain: t } = Y();
1426
- 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.`);
1427
- return e;
1428
- }
1429
- function Ht(e, t) {
1430
- return e.autoDeployEip7702ModularAccount === !0 || e.autoDeployEip7702ModularAccount !== !1 && t;
1431
- }
1432
- //#endregion
1433
- //#region src/helpers/chainConfig.ts
1434
- function Q() {
1435
- try {
1436
- return Y().chain ?? _;
1437
- } catch {
1438
- return _;
1439
- }
1440
- }
1441
- function $() {
1442
- let e = Y();
1443
- if (e.rpcUrl) return e.rpcUrl;
1444
- if (e.thirdwebClientId) return `https://${(e.chain ?? _).id}.rpc.thirdweb.com/${e.thirdwebClientId}`;
1445
- 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.");
1446
- }
1447
- function Ut() {
1448
- return Q().name;
1449
- }
1450
- //#endregion
1451
- export { We as $, mt as A, be as At, dt as B, xt as C, we as Ct, H as D, ye as Dt, yt as E, me as Et, ct as F, Be as G, P as H, lt as I, rt as J, Ke as K, ut as L, pt as M, _e as Mt, it as N, B as O, he as Ot, at as P, Ze as Q, ot as R, bt as S, x as St, z as T, _ as Tt, F as U, Qe as V, et as W, He as X, qe as Y, Ve as Z, Et as _, Oe as _t, Rt as a, Ue as at, Tt as b, S as bt, Z as c, M as ct, K as d, j as dt, Je as et, Nt as f, De as ft, Dt as g, Ae as gt, G as h, E as ht, Bt as i, Ge as it, L as j, ve as jt, V as k, ge as kt, X as l, Re as lt, Ot as m, T as mt, $ as n, Xe as nt, Y as o, Fe as ot, kt as p, D as pt, N as q, Q as r, nt as rt, zt as s, A as st, Ut as t, Ye as tt, Vt as u, Pe as ut, W as v, je as vt, R as w, v as wt, St as x, Te as xt, Ct as y, w as yt, st as z };
1452
-
1453
- //# sourceMappingURL=chainConfig-DWzoOtkS.js.map