@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
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
- import { $ as e, A as t, B as n, C as r, D as i, E as a, G as o, H as s, I as c, J as l, K as u, O as d, P as f, Q as p, R as m, S as h, T as g, V as _, _t as v, a as y, at as b, b as ee, bt as te, c as ne, ct as x, d as re, f as ie, gt as ae, i as oe, j as se, k as S, l as ce, n as le, o as C, ot as ue, pt as de, r as fe, s as pe, t as me, w as he, x as ge, y as _e, yt as w } from "./chainConfig-BYm5OXpk.js";
2
- import { a as ve, i as ye, n as be, o as xe, r as Se, s as Ce, t as we } from "./errors-Du3LNbJN.js";
3
- import { $ as Te, G as Ee, J as De, K as Oe, Q as ke, X as Ae, Y as je, Z as Me, _ as Ne, a as Pe, b as Fe, c as Ie, et as Le, g as Re, h as T, i as ze, l as Be, n as Ve, o as He, q as Ue, r as We, s as Ge, t as Ke, v as qe, y as Je } from "./publishAuthorization-CxBkijU6.js";
4
- import { n as Ye, r as Xe } from "./collectBatchUids-CnIe9jUB.js";
5
- import { BaseDb as E, arweaveL1FinalizeJobs as D, isItemOwned as Ze, publishProcesses as O, uploadProcesses as Qe } from "@seedprotocol/sdk";
6
- import { createPublicClient as $e, createWalletClient as et, custom as tt, defineChain as nt, http as k } from "viem";
7
- import { ethers as rt } from "ethers";
8
- import { DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS as it, DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS as at, DOMAIN_OWNERSHIP_METHOD as ot, DOMAIN_OWNERSHIP_METHOD as st, DOMAIN_OWNERSHIP_SCHEMA_DEF as ct, DOMAIN_OWNERSHIP_SCHEMA_DEF as A, DOMAIN_OWNERSHIP_SCHEMA_NAME as lt, DOMAIN_OWNERSHIP_SCHEMA_NAME as ut, DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE as dt, EAS_CHAIN_DEPLOYMENTS as ft, PUBLISHED_BY_SCHEMA_DEF as pt, PUBLISHED_BY_SCHEMA_DEF as j, PUBLISHED_BY_SCHEMA_NAME as mt, PUBLISHED_BY_SCHEMA_NAME as ht, assessDomainOwnership as gt, buildDomainOwnershipTxtValue as _t, decodeDomainOwnershipData as vt, domainOwnershipTxtName as yt, getDomainOwnershipFromEas as bt, getEasChainDeployment as xt, hashDomainOwnershipChallenge as St, hashDomainRegistryFingerprint as Ct, hashPublishedByBatch as wt, hashPublishedByBatch as Tt, isValidEasAttestationUid as M, normalizeBytes32Hex as N, parseDomainOwnershipTxtValue as Et } from "@seedprotocol/eas";
9
- import { useCallback as P, useEffect as F, useMemo as I, useRef as Dt, useState as L } from "react";
10
- import { jsx as R, jsxs as Ot } from "react/jsx-runtime";
11
- import { SeedProvider as kt, SeedProvider as At, useLiveQuery as z } from "@seedprotocol/react";
12
- import { entryPoint08Address as B } from "viem/account-abstraction";
13
- import { createSmartAccountClient as jt } from "permissionless";
14
- import { to7702SimpleSmartAccount as Mt } from "permissionless/accounts";
15
- import { createPimlicoClient as Nt } from "permissionless/clients/pimlico";
16
- import { NO_EXPIRATION as Pt, SchemaEncoder as Ft, SchemaRegistry as It, ZERO_BYTES32 as V } from "@ethereum-attestation-service/eas-sdk";
17
- import { and as Lt, desc as H, eq as U, inArray as Rt, notInArray as zt } from "drizzle-orm";
18
- import { useSelector as Bt } from "@xstate/react";
19
- import { lookup as Vt, toRegistrableDomain as Ht } from "rdapper";
1
+ import { A as e, B as t, C as n, D as r, E as i, G as a, H as o, I as s, O as c, P as l, Q as u, R as d, S as f, T as p, V as m, Z as h, a as g, at as _, b as v, c as y, d as ee, f as te, ft as ne, gt as re, ht as ie, i as ae, it as oe, j as se, k as b, l as ce, n as le, o as x, q as ue, r as de, s as fe, st as pe, t as me, vt as S, w as he, x as ge, y as _e, yt as ve } from "./chainConfig-CYy0XJ0M.js";
2
+ import { a as ye, i as be, n as xe, o as Se, r as Ce, s as we, t as Te } from "./errors-Du3LNbJN.js";
3
+ import { $ as Ee, G as De, J as Oe, K as ke, Q as Ae, X as je, Y as Me, Z as Ne, _ as Pe, a as Fe, b as Ie, c as Le, et as Re, g as ze, h as C, i as Be, l as Ve, n as He, o as Ue, q as We, r as Ge, s as Ke, t as qe, v as Je, y as Ye } from "./publishAuthorization-DjVrnMC0.js";
4
+ import { n as Xe, r as Ze } from "./collectBatchUids-CnIe9jUB.js";
5
+ import { BaseDb as w, arweaveL1FinalizeJobs as T, isItemOwned as Qe, publishProcesses as E, uploadProcesses as $e } from "@seedprotocol/sdk";
6
+ import { createPublicClient as et, createWalletClient as tt, custom as nt, defineChain as rt, http as D } from "viem";
7
+ import { ethers as it } from "ethers";
8
+ import { DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS as at, DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS as ot, DOMAIN_OWNERSHIP_METHOD as st, DOMAIN_OWNERSHIP_METHOD as ct, DOMAIN_OWNERSHIP_SCHEMA_DEF as lt, DOMAIN_OWNERSHIP_SCHEMA_DEF as O, DOMAIN_OWNERSHIP_SCHEMA_NAME as ut, DOMAIN_OWNERSHIP_SCHEMA_NAME as dt, DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE as ft, EAS_CHAIN_DEPLOYMENTS as pt, PUBLISHED_BY_SCHEMA_DEF as mt, PUBLISHED_BY_SCHEMA_DEF as k, PUBLISHED_BY_SCHEMA_NAME as ht, PUBLISHED_BY_SCHEMA_NAME as gt, assessDomainOwnership as _t, buildDomainOwnershipTxtValue as vt, decodeDomainOwnershipData as yt, domainOwnershipTxtName as bt, getDomainOwnershipFromEas as xt, getEasChainDeployment as St, hashDomainOwnershipChallenge as Ct, hashDomainRegistryFingerprint as wt, hashPublishedByBatch as Tt, hashPublishedByBatch as Et, isValidEasAttestationUid as A, normalizeBytes32Hex as j, parseDomainOwnershipTxtValue as Dt } from "@seedprotocol/eas";
9
+ import { useCallback as M, useEffect as N, useMemo as P, useRef as Ot, useState as F } from "react";
10
+ import { jsx as I, jsxs as kt } from "react/jsx-runtime";
11
+ import { SeedProvider as At, SeedProvider as jt, useLiveQuery as L } from "@seedprotocol/react";
12
+ import { entryPoint08Address as R } from "viem/account-abstraction";
13
+ import { createSmartAccountClient as Mt } from "permissionless";
14
+ import { to7702SimpleSmartAccount as Nt } from "permissionless/accounts";
15
+ import { createPimlicoClient as Pt } from "permissionless/clients/pimlico";
16
+ import { NO_EXPIRATION as Ft, SchemaEncoder as It, SchemaRegistry as Lt, ZERO_BYTES32 as z } from "@ethereum-attestation-service/eas-sdk";
17
+ import { and as Rt, desc as B, eq as V, inArray as zt, notInArray as Bt } from "drizzle-orm";
18
+ import { useSelector as Vt } from "@xstate/react";
19
+ import { lookup as Ht, toRegistrableDomain as Ut } from "rdapper";
20
20
  //#region src/helpers/seedTwin.ts
21
- function Ut(e) {
21
+ function Wt(e) {
22
22
  let t = [
23
23
  ["chainId", e?.chainId],
24
24
  ["rpcUrl", e?.rpcUrl],
@@ -30,7 +30,7 @@ function Ut(e) {
30
30
  ["contracts.seedProtocolExecutor", e?.contracts?.seedProtocolExecutor]
31
31
  ].filter(([, e]) => e == null || e === "").map(([e]) => e);
32
32
  if (t.length > 0) throw Error(`seedTwinConfig: twin.json is missing ${t.join(", ")}. Re-run twin:up.`);
33
- let n = e.forkedFrom?.chain ? ` (${e.forkedFrom.chain} fork)` : "", r = nt({
33
+ let n = e.forkedFrom?.chain ? ` (${e.forkedFrom.chain} fork)` : "", r = rt({
34
34
  id: e.chainId,
35
35
  name: `Seed twin${n}`,
36
36
  nativeCurrency: {
@@ -64,7 +64,7 @@ function Ut(e) {
64
64
  }
65
65
  //#endregion
66
66
  //#region src/react/PublishModeButtons.tsx
67
- var Wt = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish mode" }) => {
67
+ var Gt = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish mode" }) => {
68
68
  let i = {
69
69
  display: "inline-flex",
70
70
  gap: 8,
@@ -79,17 +79,17 @@ var Wt = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish
79
79
  cursor: n ? "not-allowed" : "pointer",
80
80
  opacity: n ? .6 : 1
81
81
  });
82
- return /* @__PURE__ */ Ot("div", {
82
+ return /* @__PURE__ */ kt("div", {
83
83
  role: "group",
84
84
  "aria-label": r,
85
85
  style: i,
86
- children: [/* @__PURE__ */ R("button", {
86
+ children: [/* @__PURE__ */ I("button", {
87
87
  type: "button",
88
88
  disabled: n,
89
89
  style: a(e === "patch"),
90
90
  onClick: () => t("patch"),
91
91
  children: "Publish updates"
92
- }), /* @__PURE__ */ R("button", {
92
+ }), /* @__PURE__ */ I("button", {
93
93
  type: "button",
94
94
  disabled: n,
95
95
  style: a(e === "new_version"),
@@ -97,11 +97,11 @@ var Wt = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish
97
97
  children: "New version"
98
98
  })]
99
99
  });
100
- }, Gt = ({ children: e, config: t, queryClient: n, queryClientRef: r }) => (F(() => {
101
- t && pe(t);
102
- }, [t]), /* @__PURE__ */ R(Te.Provider, {
103
- value: t ?? y(),
104
- children: /* @__PURE__ */ R(At, {
100
+ }, Kt = ({ children: e, config: t, queryClient: n, queryClientRef: r }) => (N(() => {
101
+ t && fe(t);
102
+ }, [t]), /* @__PURE__ */ I(Ee.Provider, {
103
+ value: t ?? g(),
104
+ children: /* @__PURE__ */ I(jt, {
105
105
  queryClient: n,
106
106
  queryClientRef: r,
107
107
  children: e
@@ -109,31 +109,31 @@ var Wt = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish
109
109
  }));
110
110
  //#endregion
111
111
  //#region src/helpers/adapters/eip1193.ts
112
- async function Kt(e, t = {}) {
113
- let n = t.chain ?? fe(), i = t.address;
112
+ async function qt(e, t = {}) {
113
+ let r = t.chain ?? de(), i = t.address;
114
114
  if (!i) {
115
115
  let t = await e.request({ method: "eth_requestAccounts" });
116
116
  if (!t?.[0]) throw Error("@seedprotocol/publish: EIP-1193 provider returned no accounts");
117
117
  i = t[0];
118
118
  }
119
- let a = et({
119
+ let a = tt({
120
120
  account: i,
121
- chain: n,
122
- transport: tt(e)
121
+ chain: r,
122
+ transport: nt(e)
123
123
  });
124
124
  return {
125
- signer: h({
125
+ signer: f({
126
126
  address: i,
127
127
  signMessage: async ({ message: e }) => a.signMessage({
128
128
  account: i,
129
129
  message: typeof e == "string" ? e : { raw: e.raw }
130
130
  })
131
131
  }),
132
- txSender: r({
132
+ txSender: n({
133
133
  address: i,
134
134
  sendTransaction: async (e) => ({ transactionHash: await a.sendTransaction({
135
135
  account: i,
136
- chain: n,
136
+ chain: r,
137
137
  to: e.to,
138
138
  data: e.data,
139
139
  value: e.value,
@@ -142,14 +142,14 @@ async function Kt(e, t = {}) {
142
142
  })
143
143
  };
144
144
  }
145
- async function qt(e = {}) {
145
+ async function Jt(e = {}) {
146
146
  let t = globalThis.ethereum;
147
147
  if (!t) throw Error("@seedprotocol/publish: window.ethereum is not available");
148
- return Kt(t, e);
148
+ return qt(t, e);
149
149
  }
150
150
  //#endregion
151
151
  //#region src/helpers/adapters/permissionlessTxSender.ts
152
- function Jt(e) {
152
+ function Yt(e) {
153
153
  return {
154
154
  address: e.address,
155
155
  type: "local",
@@ -164,7 +164,7 @@ function Jt(e) {
164
164
  }
165
165
  };
166
166
  }
167
- async function Yt(e) {
167
+ async function Xt(e) {
168
168
  let t;
169
169
  try {
170
170
  t = (await (await fetch(e, {
@@ -182,35 +182,35 @@ async function Yt(e) {
182
182
  }
183
183
  if (!Array.isArray(t)) return;
184
184
  let n = t.map((e) => String(e).toLowerCase());
185
- if (!n.includes(B.toLowerCase())) throw Error(`@seedprotocol/publish: PublishConfig.bundlerUrl (${e}) does not support EntryPoint v0.8 (it lists ${n.join(", ") || "none"}). The top-level bundlerUrl is only for the permissionless EIP-7702 sender. For Thirdweb in-app wallets (e.g. a local twin's bundler), set PublishConfig.thirdweb.bundlerUrl instead.`);
185
+ if (!n.includes(R.toLowerCase())) throw Error(`@seedprotocol/publish: PublishConfig.bundlerUrl (${e}) does not support EntryPoint v0.8 (it lists ${n.join(", ") || "none"}). The top-level bundlerUrl is only for the permissionless EIP-7702 sender. For Thirdweb in-app wallets (e.g. a local twin's bundler), set PublishConfig.thirdweb.bundlerUrl instead.`);
186
186
  }
187
- async function Xt(e) {
188
- let { signer: t, bundlerUrl: n, paymasterUrl: i } = e;
189
- await Yt(n);
190
- let a = fe(), o = le(), s = t.address, c = $e({
187
+ async function Zt(e) {
188
+ let { signer: t, bundlerUrl: r, paymasterUrl: i } = e;
189
+ await Xt(r);
190
+ let a = de(), o = le(), s = t.address, c = et({
191
191
  chain: a,
192
- transport: k(o)
193
- }), l = Jt(t), u = await Mt({
192
+ transport: D(o)
193
+ }), l = Yt(t), u = await Nt({
194
194
  client: c,
195
195
  owner: l,
196
196
  entryPoint: {
197
- address: B,
197
+ address: R,
198
198
  version: "0.8"
199
199
  }
200
- }), d = Nt({
201
- transport: k(i ?? n),
200
+ }), d = Pt({
201
+ transport: D(i ?? r),
202
202
  entryPoint: {
203
- address: B,
203
+ address: R,
204
204
  version: "0.8"
205
205
  }
206
- }), f = jt({
206
+ }), f = Mt({
207
207
  account: u,
208
208
  chain: a,
209
- bundlerTransport: k(n),
209
+ bundlerTransport: D(r),
210
210
  paymaster: d,
211
211
  userOperation: { estimateFeesPerGas: async () => (await d.getUserOperationGasPrice()).fast }
212
212
  });
213
- return r({
213
+ return n({
214
214
  address: u.address ?? s,
215
215
  sendTransaction: async (e) => {
216
216
  let t;
@@ -225,15 +225,15 @@ async function Xt(e) {
225
225
  let t = e instanceof Error ? e.message : String(e);
226
226
  throw Error(`@seedprotocol/publish: permissionless/EIP-7702 send failed (${t}). Ensure bundlerUrl/paymasterUrl support EntryPoint v0.8, or use accountMode: 'eoa' / Thirdweb adapter.`, { cause: e });
227
227
  }
228
- return { transactionHash: Zt(t, u.address) };
228
+ return { transactionHash: Qt(t, u.address) };
229
229
  }
230
230
  });
231
231
  }
232
- function Zt(e, t) {
232
+ function Qt(e, t) {
233
233
  let n = e.receipt.transactionHash;
234
234
  if (e.success) return n;
235
235
  let r = e.reason;
236
- throw r && !/^0x[0-9a-f]*$/i.test(r) ? new Se(`The publish UserOp in transaction ${n} failed: ${r}`, "USEROP_REVERTED", t) : ke({
236
+ throw r && !/^0x[0-9a-f]*$/i.test(r) ? new Ce(`The publish UserOp in transaction ${n} failed: ${r}`, "USEROP_REVERTED", t) : Ae({
237
237
  txHash: n,
238
238
  revertData: r,
239
239
  sender: t
@@ -241,18 +241,18 @@ function Zt(e, t) {
241
241
  }
242
242
  //#endregion
243
243
  //#region src/react/useSeedWallet.ts
244
- function Qt() {
245
- let [e, n] = L(() => S()), [r, i] = L(() => S() ? "connected" : "disconnected");
246
- F(() => {
247
- n(S());
244
+ function $t() {
245
+ let [t, n] = F(() => b()), [r, i] = F(() => b() ? "connected" : "disconnected");
246
+ N(() => {
247
+ n(b());
248
248
  }, []);
249
- let a = P(async (e) => {
249
+ let a = M(async (t) => {
250
250
  i("connecting");
251
251
  try {
252
252
  let r;
253
- r = g(e) ? e : await Kt(e);
254
- let a = C(), o = r.txSender;
255
- a.accountMode === "eip7702" && a.bundlerUrl && (o = await Xt({
253
+ r = p(t) ? t : await qt(t);
254
+ let a = x(), o = r.txSender;
255
+ a.accountMode === "eip7702" && a.bundlerUrl && (o = await Zt({
256
256
  signer: r.signer,
257
257
  bundlerUrl: a.bundlerUrl,
258
258
  paymasterUrl: a.paymasterUrl
@@ -263,17 +263,17 @@ function Qt() {
263
263
  ownedAddresses: [r.signer.address, o.address],
264
264
  publisherAddress: r.signer.address
265
265
  };
266
- return await t(s), n(s), i("connected"), s;
266
+ return await e(s), n(s), i("connected"), s;
267
267
  } catch (e) {
268
268
  throw i("disconnected"), e;
269
269
  }
270
- }, []), o = P(() => {
271
- d(), n(null), i("disconnected");
270
+ }, []), o = M(() => {
271
+ c(), n(null), i("disconnected");
272
272
  }, []);
273
273
  return {
274
- address: e?.signer.address,
275
- signer: e?.signer,
276
- txSender: e?.txSender,
274
+ address: t?.signer.address,
275
+ signer: t?.signer,
276
+ txSender: t?.txSender,
277
277
  status: r,
278
278
  connect: a,
279
279
  disconnect: o
@@ -281,102 +281,102 @@ function Qt() {
281
281
  }
282
282
  //#endregion
283
283
  //#region src/services/publishCost/gasHeuristics.ts
284
- var W = {
284
+ var H = {
285
285
  BASE: 80000n,
286
286
  NEW_SEED: 120000n,
287
287
  NEW_VERSION: 80000n,
288
288
  ATTESTATION: 55000n
289
289
  };
290
- function $t(e) {
291
- return W.BASE + W.NEW_SEED * BigInt(e.newSeedCount) + W.NEW_VERSION * BigInt(e.newVersionCount) + W.ATTESTATION * BigInt(e.attestationCount);
290
+ function en(e) {
291
+ return H.BASE + H.NEW_SEED * BigInt(e.newSeedCount) + H.NEW_VERSION * BigInt(e.newVersionCount) + H.ATTESTATION * BigInt(e.attestationCount);
292
292
  }
293
293
  //#endregion
294
294
  //#region src/services/publishCost/tokenPrices.ts
295
- var en = 6e4, G = null, K = null;
296
- function tn() {
295
+ var tn = 6e4, U = null, W = null;
296
+ function nn() {
297
297
  try {
298
- return C().getTokenPrices;
298
+ return x().getTokenPrices;
299
299
  } catch {
300
300
  return;
301
301
  }
302
302
  }
303
- async function nn(e) {
303
+ async function rn(e) {
304
304
  let t = await fetch(`https://api.coinbase.com/v2/prices/${e}-USD/spot`);
305
305
  if (!t.ok) throw Error(`Coinbase ${e}-USD spot failed: ${t.status}`);
306
306
  let n = await t.json(), r = Number(n.data?.amount);
307
307
  if (!Number.isFinite(r) || r <= 0) throw Error(`Invalid ${e} USD price`);
308
308
  return r;
309
309
  }
310
- async function rn() {
311
- let [e, t] = await Promise.all([nn("ETH"), nn("AR")]);
310
+ async function an() {
311
+ let [e, t] = await Promise.all([rn("ETH"), rn("AR")]);
312
312
  return {
313
313
  ethUsd: e,
314
314
  arUsd: t
315
315
  };
316
316
  }
317
- async function an(e) {
317
+ async function on(e) {
318
318
  let t = Date.now();
319
- return !e?.forceRefresh && G && t - G.fetchedAt < en ? G : (K && !e?.forceRefresh || (K = (async () => {
319
+ return !e?.forceRefresh && U && t - U.fetchedAt < tn ? U : (W && !e?.forceRefresh || (W = (async () => {
320
320
  try {
321
- let e = tn(), t = e ? await e() : await rn(), n = {
321
+ let e = nn(), t = e ? await e() : await an(), n = {
322
322
  ethUsd: t.ethUsd,
323
323
  arUsd: t.arUsd,
324
324
  fetchedAt: Date.now()
325
325
  };
326
- return G = n, n;
326
+ return U = n, n;
327
327
  } catch (e) {
328
- if (G) return G;
328
+ if (U) return U;
329
329
  throw e;
330
330
  } finally {
331
- K = null;
331
+ W = null;
332
332
  }
333
- })()), K);
333
+ })()), W);
334
334
  }
335
- function on() {
336
- G = null, K = null;
335
+ function sn() {
336
+ U = null, W = null;
337
337
  }
338
338
  //#endregion
339
339
  //#region src/services/publishCost/marketRates.ts
340
- var sn = 6e4, cn = 1e6, q = null, J = null;
341
- async function ln() {
342
- return b().getGasPrice();
343
- }
340
+ var cn = 6e4, ln = 1e6, G = null, K = null;
344
341
  async function un() {
345
- let e = BigInt(await Me().transactions.getPrice(cn));
346
- return Number(e) / cn;
342
+ return oe().getGasPrice();
347
343
  }
348
- async function dn(e) {
344
+ async function dn() {
345
+ let e = BigInt(await Ne().transactions.getPrice(ln));
346
+ return Number(e) / ln;
347
+ }
348
+ async function fn(e) {
349
349
  let t = Date.now();
350
- return !e?.forceRefresh && q && t - q.fetchedAt < sn ? q : (J && !e?.forceRefresh || (J = (async () => {
350
+ return !e?.forceRefresh && G && t - G.fetchedAt < cn ? G : (K && !e?.forceRefresh || (K = (async () => {
351
351
  try {
352
352
  let [t, n, r] = await Promise.all([
353
- an({ forceRefresh: e?.forceRefresh }),
354
- ln(),
355
- un()
353
+ on({ forceRefresh: e?.forceRefresh }),
354
+ un(),
355
+ dn()
356
356
  ]), i = {
357
357
  ...t,
358
358
  gasPriceWei: n,
359
359
  winstonPerByte: r,
360
360
  fetchedAt: Date.now()
361
361
  };
362
- return q = i, i;
362
+ return G = i, i;
363
363
  } catch (e) {
364
- if (q) return q;
364
+ if (G) return G;
365
365
  throw e;
366
366
  } finally {
367
- J = null;
367
+ K = null;
368
368
  }
369
- })()), J);
369
+ })()), K);
370
370
  }
371
- function fn() {
372
- q = null, J = null, on();
371
+ function pn() {
372
+ G = null, K = null, sn();
373
373
  }
374
374
  //#endregion
375
375
  //#region src/services/publishCost/estimatePublishCost.ts
376
- var pn = 0xe8d4a51000, mn = 0xde0b6b3a7640000;
377
- function hn() {
376
+ var mn = 0xe8d4a51000, hn = 0xde0b6b3a7640000;
377
+ function gn() {
378
378
  try {
379
- let e = C();
379
+ let e = x();
380
380
  return {
381
381
  evmUserPays: !e.paymasterUrl,
382
382
  arweavePath: e.useArweaveBundler ? "bundler" : "l1"
@@ -388,22 +388,22 @@ function hn() {
388
388
  };
389
389
  }
390
390
  }
391
- function gn(e) {
391
+ function _n(e) {
392
392
  return Math.round(e * 100) / 100;
393
393
  }
394
- function _n(e, t, n) {
395
- let r = n?.evmUserPays ?? !0, i = n?.arweavePath ?? "l1", a = $t(e), o = a * t.gasPriceWei, s = Number(o) / mn, c = s * t.ethUsd, l = Math.max(0, Math.round(e.uploadBytes * t.winstonPerByte)) / pn, u = l * t.arUsd;
394
+ function vn(e, t, n) {
395
+ let r = n?.evmUserPays ?? !0, i = n?.arweavePath ?? "l1", a = en(e), o = a * t.gasPriceWei, s = Number(o) / hn, c = s * t.ethUsd, l = Math.max(0, Math.round(e.uploadBytes * t.winstonPerByte)) / mn, u = l * t.arUsd;
396
396
  return {
397
- totalUsd: gn(c + u),
397
+ totalUsd: _n(c + u),
398
398
  evm: {
399
399
  eth: s.toPrecision(6),
400
- usd: gn(c),
400
+ usd: _n(c),
401
401
  gas: a,
402
402
  userPays: r
403
403
  },
404
404
  arweave: {
405
405
  ar: l.toPrecision(6),
406
- usd: gn(u),
406
+ usd: _n(u),
407
407
  bytes: e.uploadBytes,
408
408
  uploadCount: e.uploadCount,
409
409
  path: i,
@@ -418,42 +418,42 @@ function _n(e, t, n) {
418
418
  estimatedAt: Date.now()
419
419
  };
420
420
  }
421
- async function vn(e, t) {
422
- let n = hn(), r = t?.work;
421
+ async function yn(e, t) {
422
+ let n = gn(), r = t?.work;
423
423
  if (!r) {
424
424
  let { summarizePublishWork: n } = await import("@seedprotocol/sdk");
425
425
  r = await n(e, { publishMode: t?.publishMode });
426
426
  }
427
- let i = t?.rates ?? await dn();
428
- return _n(r, i, n);
427
+ let i = t?.rates ?? await fn();
428
+ return vn(r, i, n);
429
429
  }
430
430
  //#endregion
431
431
  //#region src/services/publishCost/watchPublishCost.ts
432
- var yn = 6e4, bn = 15e3;
433
- function xn(e) {
432
+ var bn = 6e4, xn = 15e3;
433
+ function Sn(e) {
434
434
  let t = e.getService().getSnapshot(), n = (t && typeof t == "object" && "context" in t ? t.context : void 0)?.propertyValue ?? e.value;
435
435
  return `${e.propertyName}:${e.uid ?? ""}:${String(n ?? "")}`;
436
436
  }
437
- function Sn(e) {
437
+ function Cn(e) {
438
438
  let t = e.properties ?? [];
439
439
  return [
440
440
  e.seedLocalId,
441
441
  e.seedUid ?? "",
442
442
  e.latestVersionLocalId ?? "",
443
- ...t.map(xn)
443
+ ...t.map(Sn)
444
444
  ].join("|");
445
445
  }
446
- function Cn(e) {
446
+ function wn(e) {
447
447
  return e instanceof Error ? e : Error(String(e));
448
448
  }
449
- function wn(e, t, n) {
450
- let r = n?.priceRefreshMs ?? yn, i = n?.itemIdleMs ?? bn, a = n?.estimate ?? ((e) => vn(e, n)), o = n?.reprice ?? (async (e) => {
451
- let t = await dn({ forceRefresh: !0 });
452
- return _n(e.work, t, {
449
+ function Tn(e, t, n) {
450
+ let r = n?.priceRefreshMs ?? bn, i = n?.itemIdleMs ?? xn, a = n?.estimate ?? ((e) => yn(e, n)), o = n?.reprice ?? (async (e) => {
451
+ let t = await fn({ forceRefresh: !0 });
452
+ return vn(e.work, t, {
453
453
  evmUserPays: e.evm.userPays,
454
454
  arweavePath: e.arweave.path
455
455
  });
456
- }), s = !1, c = Sn(e), l = null, u = !1, d = !1, f = null, p = 0, m = null, h = null, g = () => {
456
+ }), s = !1, c = Cn(e), l = null, u = !1, d = !1, f = null, p = 0, m = null, h = null, g = () => {
457
457
  s || t({
458
458
  estimate: l,
459
459
  isEstimating: u,
@@ -467,10 +467,10 @@ function wn(e, t, n) {
467
467
  try {
468
468
  let n = await a(e);
469
469
  if (s || t !== p) return;
470
- l = n, c = Sn(e), d = !1, u = !1, f = null, g();
470
+ l = n, c = Cn(e), d = !1, u = !1, f = null, g();
471
471
  } catch (e) {
472
472
  if (s || t !== p) return;
473
- u = !1, f = Cn(e), g();
473
+ u = !1, f = wn(e), g();
474
474
  }
475
475
  }, v = () => {
476
476
  if (l && (d = !0), i <= 0) {
@@ -484,9 +484,9 @@ function wn(e, t, n) {
484
484
  m &&= (clearTimeout(m), null), _();
485
485
  };
486
486
  _();
487
- let b = e.subscribe(() => {
487
+ let ee = e.subscribe(() => {
488
488
  if (s) return;
489
- let t = Sn(e);
489
+ let t = Cn(e);
490
490
  t !== c && (c = t, v());
491
491
  });
492
492
  return r > 0 && (h = setInterval(() => {
@@ -497,44 +497,44 @@ function wn(e, t, n) {
497
497
  l = e, g();
498
498
  } catch (e) {
499
499
  if (s) return;
500
- f = Cn(e), g();
500
+ f = wn(e), g();
501
501
  }
502
502
  })();
503
503
  }, r)), {
504
504
  refresh: y,
505
505
  dispose: () => {
506
- s = !0, b.unsubscribe(), m && clearTimeout(m), h && clearInterval(h);
506
+ s = !0, ee.unsubscribe(), m && clearTimeout(m), h && clearInterval(h);
507
507
  }
508
508
  };
509
509
  }
510
510
  //#endregion
511
511
  //#region src/helpers/publishDisplayHelpers.ts
512
- function Tn(e) {
512
+ function En(e) {
513
513
  return e === "creatingAttestationsDirectToEas" ? "creatingAttestations" : e;
514
514
  }
515
- function En(e, t, n) {
515
+ function Dn(e, t, n) {
516
516
  if (e != null) return n;
517
- if (t?.status === "completed") return w.SUCCESS;
518
- if (t?.status === "failed") return w.FAILURE;
517
+ if (t?.status === "completed") return S.SUCCESS;
518
+ if (t?.status === "failed") return S.FAILURE;
519
519
  if (t?.status !== "interrupted") return n;
520
520
  }
521
- function Dn(e) {
521
+ function On(e) {
522
522
  if (e) {
523
- if (e.status === "failed") return w.FAILURE;
524
- if (e.status === "completed") return w.SUCCESS;
523
+ if (e.status === "failed") return S.FAILURE;
524
+ if (e.status === "completed") return S.SUCCESS;
525
525
  if (e.status !== "interrupted") {
526
526
  if (e.completedAt != null) {
527
527
  try {
528
528
  let t = JSON.parse(e.persistedSnapshot);
529
- if (t.status === "done" && t.value === w.FAILURE) return w.FAILURE;
529
+ if (t.status === "done" && t.value === S.FAILURE) return S.FAILURE;
530
530
  } catch {}
531
- return w.SUCCESS;
531
+ return S.SUCCESS;
532
532
  }
533
533
  try {
534
534
  let t = JSON.parse(e.persistedSnapshot);
535
535
  if (t.status === "done") {
536
- if (t.value === w.SUCCESS) return w.SUCCESS;
537
- if (t.value === w.FAILURE) return w.FAILURE;
536
+ if (t.value === S.SUCCESS) return S.SUCCESS;
537
+ if (t.value === S.FAILURE) return S.FAILURE;
538
538
  }
539
539
  if (typeof t.value == "string") return t.value;
540
540
  } catch {
@@ -545,19 +545,19 @@ function Dn(e) {
545
545
  }
546
546
  //#endregion
547
547
  //#region src/hooks/usePublishProcess.ts
548
- function On(e) {
549
- return !e || e.status !== "done" ? !1 : e.value === w.SUCCESS || e.value === w.FAILURE;
550
- }
551
548
  function kn(e) {
552
- let t = T.getService(), n = Bt(t, (t) => t?.context?.publishProcesses?.get(e) ?? null), r = Dt(null);
553
- F(() => {
549
+ return !e || e.status !== "done" ? !1 : e.value === S.SUCCESS || e.value === S.FAILURE;
550
+ }
551
+ function An(e) {
552
+ let t = C.getService(), n = Vt(t, (t) => t?.context?.publishProcesses?.get(e) ?? null), r = Ot(null);
553
+ N(() => {
554
554
  r.current = null;
555
555
  }, [e]);
556
- let [i, a] = L(void 0), [o, s] = L(null), c = E.getAppDb(), l = I(() => e && c ? c.select().from(O).where(U(O.seedLocalId, e)).orderBy(H(O.startedAt)).limit(1) : null, [c, e]), u = z(l)?.[0], d = u?.status, f = I(() => {
556
+ let [i, a] = F(void 0), [o, s] = F(null), c = w.getAppDb(), l = P(() => e && c ? c.select().from(E).where(V(E.seedLocalId, e)).orderBy(B(E.startedAt)).limit(1) : null, [c, e]), u = L(l)?.[0], d = u?.status, f = P(() => {
557
557
  if (n != null) return i;
558
558
  if (o === "success" || o === "failure") return o;
559
- let e = Dn(u);
560
- return e === w.SUCCESS || e === w.FAILURE ? e : En(n, d == null ? void 0 : { status: d }, i);
559
+ let e = On(u);
560
+ return e === S.SUCCESS || e === S.FAILURE ? e : Dn(n, d == null ? void 0 : { status: d }, i);
561
561
  }, [
562
562
  n,
563
563
  d,
@@ -565,16 +565,16 @@ function kn(e) {
565
565
  o,
566
566
  u
567
567
  ]);
568
- return F(() => {
568
+ return N(() => {
569
569
  s(null);
570
- }, [e]), F(() => {
570
+ }, [e]), N(() => {
571
571
  n ?? (d === "completed" ? s("success") : d === "failed" && s("failure"));
572
- }, [d, n]), F(() => {
572
+ }, [d, n]), N(() => {
573
573
  n != null && s(null);
574
- }, [n]), F(() => {
574
+ }, [n]), N(() => {
575
575
  if (!n) {
576
576
  let e = r.current;
577
- On(e) ? (a(e.value), e.value === w.SUCCESS ? s("success") : e.value === w.FAILURE && s("failure")) : a(void 0);
577
+ kn(e) ? (a(e.value), e.value === S.SUCCESS ? s("success") : e.value === S.FAILURE && s("failure")) : a(void 0);
578
578
  return;
579
579
  }
580
580
  let e = n.getSnapshot();
@@ -598,21 +598,21 @@ function kn(e) {
598
598
  }
599
599
  //#endregion
600
600
  //#region src/hooks/useCanPublishItem.ts
601
- function An(e) {
602
- let [t, n] = L(!0);
603
- return F(() => {
601
+ function jn(e) {
602
+ let [t, n] = F(!0);
603
+ return N(() => {
604
604
  if (!e) {
605
605
  n(!1);
606
606
  return;
607
607
  }
608
- Ze(e).then(n).catch(() => n(!1));
608
+ Qe(e).then(n).catch(() => n(!1));
609
609
  }, [e?.seedLocalId]), t;
610
610
  }
611
611
  //#endregion
612
612
  //#region src/hooks/useArweaveL1Finalize.ts
613
- function jn(e) {
614
- let t = E.getAppDb(), n = I(() => e && t ? t.select().from(D).where(U(D.seedLocalId, e)).orderBy(H(D.updatedAt)) : null, [t, e]), r = z(n) ?? [];
615
- return I(() => {
613
+ function Mn(e) {
614
+ let t = w.getAppDb(), n = P(() => e && t ? t.select().from(T).where(V(T.seedLocalId, e)).orderBy(B(T.updatedAt)) : null, [t, e]), r = L(n) ?? [];
615
+ return P(() => {
616
616
  let e = r.filter((e) => e.phase === "pending_l1").length, t = r.filter((e) => e.phase === "confirmed").length;
617
617
  return {
618
618
  hasPendingL1: e > 0,
@@ -624,8 +624,8 @@ function jn(e) {
624
624
  }
625
625
  //#endregion
626
626
  //#region src/hooks/useItemPublishStatus.ts
627
- function Mn(e) {
628
- let { publishProcess: t, value: n } = kn(e ?? ""), r = jn(e), i = E.getAppDb(), a = I(() => e && i ? i.select().from(O).where(U(O.seedLocalId, e)).orderBy(H(O.startedAt)).limit(1) : null, [i, e]), o = z(a)?.[0];
627
+ function Nn(e) {
628
+ let { publishProcess: t, value: n } = An(e ?? ""), r = Mn(e), i = w.getAppDb(), a = P(() => e && i ? i.select().from(E).where(V(E.seedLocalId, e)).orderBy(B(E.startedAt)).limit(1) : null, [i, e]), o = L(a)?.[0];
629
629
  return {
630
630
  latestRecord: o,
631
631
  publishProcess: t,
@@ -638,44 +638,44 @@ function Mn(e) {
638
638
  }
639
639
  //#endregion
640
640
  //#region src/hooks/usePublishProcesses.ts
641
- function Nn() {
642
- let e = E.getAppDb();
643
- return I(() => e ? e.select().from(O).orderBy(H(O.startedAt)) : null, [e]);
641
+ function Pn() {
642
+ let e = w.getAppDb();
643
+ return P(() => e ? e.select().from(E).orderBy(B(E.startedAt)) : null, [e]);
644
644
  }
645
- function Pn(e) {
646
- let t = E.getAppDb();
647
- return I(() => t && e ? t.select().from(O).where(U(O.seedLocalId, e)).orderBy(H(O.startedAt)) : null, [t, e]);
645
+ function Fn(e) {
646
+ let t = w.getAppDb();
647
+ return P(() => t && e ? t.select().from(E).where(V(E.seedLocalId, e)).orderBy(B(E.startedAt)) : null, [t, e]);
648
648
  }
649
- function Fn() {
650
- let e = Nn(), t = z(e);
649
+ function In() {
650
+ let e = Pn(), t = L(e);
651
651
  return {
652
652
  records: t,
653
- nonActiveCount: I(() => t === void 0 ? void 0 : t.filter((e) => e.status !== "in_progress").length, [t])
653
+ nonActiveCount: P(() => t === void 0 ? void 0 : t.filter((e) => e.status !== "in_progress").length, [t])
654
654
  };
655
655
  }
656
- function In() {
657
- let e = Nn();
658
- return z(e);
659
- }
660
656
  function Ln() {
661
- return Fn().nonActiveCount;
657
+ let e = Pn();
658
+ return L(e);
662
659
  }
663
- function Rn(e) {
664
- let t = Pn(e);
665
- return z(t);
660
+ function Rn() {
661
+ return In().nonActiveCount;
666
662
  }
667
663
  function zn(e) {
668
- let t = Pn(e), n = z(t);
664
+ let t = Fn(e);
665
+ return L(t);
666
+ }
667
+ function Bn(e) {
668
+ let t = Fn(e), n = L(t);
669
669
  return {
670
670
  records: n,
671
- nonActiveCount: I(() => n === void 0 ? void 0 : n.filter((e) => e.status !== "in_progress").length, [n])
671
+ nonActiveCount: P(() => n === void 0 ? void 0 : n.filter((e) => e.status !== "in_progress").length, [n])
672
672
  };
673
673
  }
674
- function Bn(e) {
675
- return zn(e).nonActiveCount;
676
- }
677
674
  function Vn(e) {
678
- let t = E.getAppDb(), n = I(() => e != null && t ? t.select().from(O).where(U(O.id, e)).limit(1) : null, [t, e]), r = z(n), i = r === void 0;
675
+ return Bn(e).nonActiveCount;
676
+ }
677
+ function Hn(e) {
678
+ let t = w.getAppDb(), n = P(() => e != null && t ? t.select().from(E).where(V(E.id, e)).limit(1) : null, [t, e]), r = L(n), i = r === void 0;
679
679
  return {
680
680
  record: r && r.length > 0 ? r[0] : null,
681
681
  isLoading: i
@@ -683,45 +683,45 @@ function Vn(e) {
683
683
  }
684
684
  //#endregion
685
685
  //#region src/hooks/clearCompletedPublishProcesses.ts
686
- async function Hn() {
687
- let e = E.getAppDb();
688
- e && await e.delete(O).where(zt(O.status, ["in_progress"]));
686
+ async function Un() {
687
+ let e = w.getAppDb();
688
+ e && await e.delete(E).where(Bt(E.status, ["in_progress"]));
689
689
  }
690
- async function Un(e) {
691
- let t = E.getAppDb();
692
- t && await t.delete(O).where(Lt(U(O.seedLocalId, e), zt(O.status, ["in_progress"])));
693
- }
694
- async function Wn() {
695
- let e = E.getAppDb();
696
- e && await e.delete(O);
690
+ async function Wn(e) {
691
+ let t = w.getAppDb();
692
+ t && await t.delete(E).where(Rt(V(E.seedLocalId, e), Bt(E.status, ["in_progress"])));
697
693
  }
698
694
  async function Gn() {
699
- let e = E.getAppDb();
700
- e && await e.delete(Qe);
695
+ let e = w.getAppDb();
696
+ e && await e.delete(E);
701
697
  }
702
- async function Kn(e) {
703
- let t = E.getAppDb();
704
- t && await t.delete(O).where(U(O.seedLocalId, e));
698
+ async function Kn() {
699
+ let e = w.getAppDb();
700
+ e && await e.delete($e);
705
701
  }
706
702
  async function qn(e) {
707
- let t = E.getAppDb();
708
- t && await t.delete(O).where(U(O.id, e));
703
+ let t = w.getAppDb();
704
+ t && await t.delete(E).where(V(E.seedLocalId, e));
709
705
  }
710
706
  async function Jn(e) {
707
+ let t = w.getAppDb();
708
+ t && await t.delete(E).where(V(E.id, e));
709
+ }
710
+ async function Yn(e) {
711
711
  if (e.length === 0) return;
712
- let t = E.getAppDb();
713
- t && await t.delete(O).where(Rt(O.id, e));
712
+ let t = w.getAppDb();
713
+ t && await t.delete(E).where(zt(E.id, e));
714
714
  }
715
715
  //#endregion
716
716
  //#region src/hooks/publishProcessHelpers.ts
717
- function Yn(e) {
717
+ function Xn(e) {
718
718
  try {
719
719
  return (JSON.parse(e.persistedSnapshot).context?.arweaveTransactions ?? []).map((e) => e.transaction?.id).filter((e) => typeof e == "string");
720
720
  } catch {
721
721
  return [];
722
722
  }
723
723
  }
724
- function Xn(e) {
724
+ function Zn(e) {
725
725
  try {
726
726
  return JSON.parse(e.persistedSnapshot).context?.easPayload ?? void 0;
727
727
  } catch {
@@ -730,14 +730,14 @@ function Xn(e) {
730
730
  }
731
731
  //#endregion
732
732
  //#region src/hooks/usePublishCostEstimate.ts
733
- function Zn(e, t) {
734
- let [n, r] = L(null), [i, a] = L(!1), [o, s] = L(!1), [c, l] = L(null), u = Dt(() => {}), d = t?.publishMode, f = t?.priceRefreshMs, p = t?.itemIdleMs;
735
- return F(() => {
733
+ function Qn(e, t) {
734
+ let [n, r] = F(null), [i, a] = F(!1), [o, s] = F(!1), [c, l] = F(null), u = Ot(() => {}), d = t?.publishMode, f = t?.priceRefreshMs, p = t?.itemIdleMs;
735
+ return N(() => {
736
736
  if (!e) {
737
737
  r(null), a(!1), s(!1), l(null), u.current = () => {};
738
738
  return;
739
739
  }
740
- let n = wn(e, (e) => {
740
+ let n = Tn(e, (e) => {
741
741
  r(e.estimate), a(e.isEstimating), s(e.isStale), l(e.error), u.current = e.refresh;
742
742
  }, t);
743
743
  return () => {
@@ -754,58 +754,33 @@ function Zn(e, t) {
754
754
  isEstimating: i,
755
755
  isStale: o,
756
756
  error: c,
757
- refresh: P(() => {
757
+ refresh: M(() => {
758
758
  u.current();
759
759
  }, [])
760
760
  };
761
761
  }
762
762
  //#endregion
763
- //#region src/helpers/transformPayloadToIntegerIds.ts
764
- function Qn(e) {
765
- let t = /* @__PURE__ */ new Map();
766
- for (let n = 0; n < e.length; n++) {
767
- let r = e[n]?.localId;
768
- r != null && t.set(r, BigInt(n));
769
- }
770
- return e.map((e, n) => {
771
- let r = (e.propertiesToUpdate ?? []).map((e) => {
772
- let n = e.publishLocalId, r = n == null ? void 0 : t.get(n);
773
- if (n != null && n !== "" && r === void 0) throw Error(`publishLocalId "${n}" not found in payload (valid localIds: ${Array.from(t.keys()).join(", ")})`);
774
- let { publishLocalId: i, ...a } = e;
775
- return {
776
- ...a,
777
- publishLocalIdIndex: r ?? BigInt(0)
778
- };
779
- }), { localId: i, ...a } = e;
780
- return {
781
- ...a,
782
- localIdIndex: BigInt(n),
783
- propertiesToUpdate: r
784
- };
785
- });
786
- }
787
- //#endregion
788
763
  //#region src/helpers/ensureWalletThenPublish.ts
789
764
  function $n(e) {
790
765
  if (e) {
791
- if (e instanceof rt.Wallet) return e;
792
- if (g(e)) return e.signer;
793
- if (a(e)) return e;
766
+ if (e instanceof it.Wallet) return e;
767
+ if (p(e)) return e.signer;
768
+ if (i(e)) return e;
794
769
  }
795
770
  }
796
771
  async function er(e, t) {
797
- let n = C();
772
+ let n = x();
798
773
  if (n.useModularExecutor) {
799
- let { ensureSmartWalletThenPublish: n } = await import("./ensureSmartWalletThenPublish-DAomriGc.js").then((e) => e.n);
774
+ let { ensureSmartWalletThenPublish: n } = await import("./ensureSmartWalletThenPublish-Dta2AOyJ.js").then((e) => e.n);
800
775
  return n(e, null, async () => {
801
- let e = S();
776
+ let e = b();
802
777
  return e?.publisherAddress ?? e?.signer.address ?? null;
803
778
  }, t);
804
779
  }
805
- let r = S();
780
+ let r = b();
806
781
  if (!r) return { outcome: "no_wallet" };
807
782
  if (n.accountMode === "eip7702" && n.bundlerUrl) {
808
- let e = await Xt({
783
+ let e = await Zt({
809
784
  signer: r.signer,
810
785
  bundlerUrl: n.bundlerUrl,
811
786
  paymasterUrl: n.paymasterUrl
@@ -817,20 +792,20 @@ async function er(e, t) {
817
792
  };
818
793
  }
819
794
  let i = r.publisherAddress ?? r.txSender.address ?? r.signer.address;
820
- return i?.trim() ? (T.createPublish(e, i, r, {
795
+ return i?.trim() ? (C.createPublish(e, i, r, {
821
796
  ...t,
822
797
  dataItemSigner: $n(t?.dataItemSigner) ?? r.signer
823
798
  }), { outcome: "started" }) : { outcome: "no_address" };
824
799
  }
825
800
  //#endregion
826
801
  //#region src/services/domainOwnership/registry.ts
827
- function Y(e) {
828
- let t = Ht(e);
802
+ function q(e) {
803
+ let t = Ut(e);
829
804
  if (!t) throw Error(`@seedprotocol/publish: unable to resolve registrable domain for "${e}"`);
830
805
  return t.toLowerCase();
831
806
  }
832
- async function tr(e) {
833
- let t = Y(e), n = await Vt(t);
807
+ async function J(e) {
808
+ let t = q(e), n = await Ht(t);
834
809
  if (!n.ok || !n.record) return null;
835
810
  let r = n.record;
836
811
  return {
@@ -844,8 +819,8 @@ async function tr(e) {
844
819
  isRegistered: r.isRegistered
845
820
  };
846
821
  }
847
- function nr(e) {
848
- return Ct({
822
+ function tr(e) {
823
+ return wt({
849
824
  domain: e.domain,
850
825
  creationDate: e.creationDate ?? "",
851
826
  registrarIanaId: e.registrarIanaId ?? ""
@@ -853,36 +828,36 @@ function nr(e) {
853
828
  }
854
829
  //#endregion
855
830
  //#region src/services/domainOwnership/challenge.ts
856
- function rr(e) {
831
+ function nr(e) {
857
832
  let t = new Uint8Array(e);
858
833
  return crypto.getRandomValues(t), t;
859
834
  }
860
- function ir(e) {
835
+ function rr(e) {
861
836
  let t = "";
862
837
  for (let n of e) t += String.fromCharCode(n);
863
838
  return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
864
839
  }
865
- function ar(e) {
866
- let t = e.normalizeRegistrable === !1 ? e.domain.trim().toLowerCase().replace(/\.$/, "") : Y(e.domain);
840
+ function ir(e) {
841
+ let t = e.normalizeRegistrable === !1 ? e.domain.trim().toLowerCase().replace(/\.$/, "") : q(e.domain);
867
842
  if (!t || t.includes(" ")) throw Error("@seedprotocol/publish: createDomainOwnershipChallenge requires a valid domain");
868
843
  let n = e.claimer.trim();
869
844
  if (!/^0x[0-9a-fA-F]{40}$/.test(n)) throw Error("@seedprotocol/publish: createDomainOwnershipChallenge requires a 20-byte hex claimer address");
870
- let r = e.scope ?? dt, i = e.ttlMs ?? it, a = e.now ?? Date.now(), o = new Date(a + i).toISOString(), s = ir(rr(32)), c = St({
845
+ let r = e.scope ?? ft, i = e.ttlMs ?? at, a = e.now ?? Date.now(), o = new Date(a + i).toISOString(), s = rr(nr(32)), c = Ct({
871
846
  domain: t,
872
847
  claimer: n,
873
848
  token: s,
874
849
  scope: r
875
- }), l = yt(t), u = _t({
850
+ }), l = bt(t), u = vt({
876
851
  token: s,
877
852
  claimer: n,
878
853
  expiry: o
879
854
  });
880
855
  return {
881
- challengeId: ir(rr(16)),
856
+ challengeId: rr(nr(16)),
882
857
  domain: t,
883
858
  claimer: n,
884
859
  scope: r,
885
- method: st,
860
+ method: ct,
886
861
  token: s,
887
862
  txtName: l,
888
863
  txtValue: u,
@@ -893,14 +868,14 @@ function ar(e) {
893
868
  }
894
869
  //#endregion
895
870
  //#region src/services/domainOwnership/dnsVerify.ts
896
- async function or(e) {
871
+ async function ar(e) {
897
872
  let { promises: t } = await import("node:dns");
898
873
  return {
899
874
  source: "node:dns",
900
875
  values: (await t.resolveTxt(e)).map((e) => e.join(""))
901
876
  };
902
877
  }
903
- async function sr(e, t, n) {
878
+ async function or(e, t, n) {
904
879
  let r = `${n}?name=${encodeURIComponent(e)}&type=TXT`, i = await fetch(r, { headers: { accept: "application/dns-json" } });
905
880
  if (!i.ok) throw Error(`DoH ${t} HTTP ${i.status}`);
906
881
  let a = await i.json();
@@ -910,20 +885,20 @@ async function sr(e, t, n) {
910
885
  dnssecAuthenticated: !!a.AD
911
886
  };
912
887
  }
913
- function cr() {
914
- let e = [(e) => sr(e, "cloudflare-doh", "https://cloudflare-dns.com/dns-query"), (e) => sr(e, "google-doh", "https://dns.google/resolve")];
915
- return typeof document > "u" && e.unshift((e) => or(e)), e;
888
+ function sr() {
889
+ let e = [(e) => or(e, "cloudflare-doh", "https://cloudflare-dns.com/dns-query"), (e) => or(e, "google-doh", "https://dns.google/resolve")];
890
+ return typeof document > "u" && e.unshift((e) => ar(e)), e;
916
891
  }
917
- function lr(e, t) {
918
- let n = Et(t);
892
+ function cr(e, t) {
893
+ let n = Dt(t);
919
894
  for (let r of e) {
920
895
  if (r === t || r.replace(/^"|"$/g, "") === t) return !0;
921
- let e = Et(r);
896
+ let e = Dt(r);
922
897
  if (n && e && e.token === n.token && e.claimer === n.claimer) return !0;
923
898
  }
924
899
  return !1;
925
900
  }
926
- async function ur(e, t) {
901
+ async function lr(e, t) {
927
902
  let n = t?.now ?? Date.now();
928
903
  if (Date.parse(e.expiresAt) <= n) return {
929
904
  ok: !1,
@@ -931,7 +906,7 @@ async function ur(e, t) {
931
906
  lookups: [],
932
907
  error: "Challenge expired"
933
908
  };
934
- let r = _t({
909
+ let r = vt({
935
910
  token: e.token,
936
911
  claimer: e.claimer,
937
912
  expiry: e.expiresAt
@@ -942,11 +917,11 @@ async function ur(e, t) {
942
917
  lookups: [],
943
918
  error: "Challenge txtValue does not match token/claimer/expiry"
944
919
  };
945
- let i = t?.lookups ?? cr(), a = t?.quorum ?? 2, o = [], s = [], c = !1;
920
+ let i = t?.lookups ?? sr(), a = t?.quorum ?? 2, o = [], s = [], c = !1;
946
921
  await Promise.all(i.map(async (t) => {
947
922
  try {
948
923
  let n = await t(e.txtName);
949
- o.push(n), lr(n.values, r) && (s.push(n.source), n.dnssecAuthenticated && (c = !0));
924
+ o.push(n), cr(n.values, r) && (s.push(n.source), n.dnssecAuthenticated && (c = !0));
950
925
  } catch {
951
926
  o.push({
952
927
  source: "error",
@@ -964,32 +939,32 @@ async function ur(e, t) {
964
939
  }
965
940
  //#endregion
966
941
  //#region src/services/domainOwnership/index.ts
967
- var dr = "0x0000000000000000000000000000000000000000", fr = !0;
968
- function pr(e) {
969
- if (g(e)) return e.txSender;
970
- if (i(e)) return e;
942
+ var ur = "0x0000000000000000000000000000000000000000", dr = !0;
943
+ function fr(e) {
944
+ if (p(e)) return e.txSender;
945
+ if (r(e)) return e;
971
946
  throw Error("@seedprotocol/publish: domain ownership write APIs require a PublishWallet or SeedTxSender");
972
947
  }
973
- async function X(e, t) {
948
+ async function Y(e, t) {
974
949
  let n = await e.sendTransaction(t);
975
- return x(n.transactionHash);
976
- }
977
- function Z() {
978
- return It.getSchemaUID(A, dr, fr);
979
- }
980
- async function mr(e) {
981
- let t = pr(e), n = Z();
982
- return await je(n) || (await X(t, Ae({
983
- schema: A,
984
- resolverAddress: dr,
985
- revocable: fr
986
- })), await X(t, De({
950
+ return pe(n.transactionHash);
951
+ }
952
+ function X() {
953
+ return Lt.getSchemaUID(O, ur, dr);
954
+ }
955
+ async function pr(e) {
956
+ let t = fr(e), n = X();
957
+ return await Me(n) || (await Y(t, je({
958
+ schema: O,
959
+ resolverAddress: ur,
960
+ revocable: dr
961
+ })), await Y(t, Oe({
987
962
  schemaUid: n,
988
- schemaName: ut
963
+ schemaName: dt
989
964
  }))), n;
990
965
  }
991
- function hr(e) {
992
- return new Ft(A).encodeData([
966
+ function mr(e) {
967
+ return new It(O).encodeData([
993
968
  {
994
969
  name: "domain",
995
970
  value: e.domain,
@@ -1007,7 +982,7 @@ function hr(e) {
1007
982
  },
1008
983
  {
1009
984
  name: "challengeHash",
1010
- value: N(e.challengeHash),
985
+ value: j(e.challengeHash),
1011
986
  type: "bytes32"
1012
987
  },
1013
988
  {
@@ -1027,7 +1002,7 @@ function hr(e) {
1027
1002
  },
1028
1003
  {
1029
1004
  name: "registryFingerprint",
1030
- value: N(e.registryFingerprint),
1005
+ value: j(e.registryFingerprint),
1031
1006
  type: "bytes32"
1032
1007
  },
1033
1008
  {
@@ -1037,76 +1012,76 @@ function hr(e) {
1037
1012
  }
1038
1013
  ]);
1039
1014
  }
1040
- function gr(e) {
1015
+ function hr(e) {
1041
1016
  if (typeof e.override == "number" && e.override > 0) return e.override;
1042
1017
  if (e.registryExpirationDate) {
1043
1018
  let t = Date.parse(e.registryExpirationDate);
1044
1019
  if (Number.isFinite(t) && t > 0) return Math.floor(t / 1e3);
1045
1020
  }
1046
- return e.verifiedAt + at;
1021
+ return e.verifiedAt + ot;
1047
1022
  }
1048
- async function _r(e) {
1049
- let t = pr(e.wallet), n = e.ensureSchema === !1 ? Z() : await mr(e.wallet), r = Y(e.domain), i = e.claimer.trim();
1023
+ async function gr(e) {
1024
+ let t = fr(e.wallet), n = e.ensureSchema === !1 ? X() : await pr(e.wallet), r = q(e.domain), i = e.claimer.trim();
1050
1025
  if (!/^0x[0-9a-fA-F]{40}$/.test(i)) throw Error("@seedprotocol/publish: attestDomainOwnership requires a valid claimer address");
1051
- let a = N(e.challengeHash);
1052
- if (a === V) throw Error("@seedprotocol/publish: attestDomainOwnership requires a non-zero challengeHash");
1053
- let o = e.verifiedAt ?? Math.floor(Date.now() / 1e3), s = nr({
1026
+ let a = j(e.challengeHash);
1027
+ if (a === z) throw Error("@seedprotocol/publish: attestDomainOwnership requires a non-zero challengeHash");
1028
+ let o = e.verifiedAt ?? Math.floor(Date.now() / 1e3), c = tr({
1054
1029
  domain: r,
1055
1030
  creationDate: e.registrySnapshot.creationDate ?? "",
1056
1031
  registrarIanaId: e.registrySnapshot.registrarIanaId ?? ""
1057
- }), l = e.registrySnapshot.creationDate ?? "", u = e.registrySnapshot.expirationDate ?? "", d = e.scope ?? dt, p = e.method ?? st, m = gr({
1032
+ }), u = e.registrySnapshot.creationDate ?? "", d = e.registrySnapshot.expirationDate ?? "", f = e.scope ?? ft, p = e.method ?? ct, m = hr({
1058
1033
  verifiedAt: o,
1059
- registryExpirationDate: u,
1034
+ registryExpirationDate: d,
1060
1035
  override: e.expirationTime
1061
- }), h = hr({
1036
+ }), h = mr({
1062
1037
  domain: r,
1063
1038
  claimer: i,
1064
1039
  method: p,
1065
1040
  challengeHash: a,
1066
1041
  verifiedAt: o,
1067
- registryCreationDate: l,
1068
- registryExpirationDate: u,
1069
- registryFingerprint: s,
1070
- scope: d
1071
- }), g = await X(t, c({
1042
+ registryCreationDate: u,
1043
+ registryExpirationDate: d,
1044
+ registryFingerprint: c,
1045
+ scope: f
1046
+ }), g = await Y(t, s({
1072
1047
  schema: n,
1073
1048
  data: {
1074
1049
  recipient: i,
1075
1050
  expirationTime: BigInt(m),
1076
1051
  revocable: !0,
1077
- refUID: V,
1052
+ refUID: z,
1078
1053
  data: h,
1079
1054
  value: 0n
1080
1055
  }
1081
1056
  }));
1082
1057
  if (!g) throw Error("@seedprotocol/publish: attestDomainOwnership failed — no receipt");
1083
- let { easContractAddress: _ } = C(), v = f(g, _);
1084
- if (!v || !M(v)) throw Error("@seedprotocol/publish: attestDomainOwnership failed — could not parse attestation UID");
1058
+ let { easContractAddress: _ } = x(), v = l(g, _);
1059
+ if (!v || !A(v)) throw Error("@seedprotocol/publish: attestDomainOwnership failed — could not parse attestation UID");
1085
1060
  return {
1086
1061
  uid: v,
1087
1062
  schemaUid: n,
1088
1063
  challengeHash: a,
1089
- registryFingerprint: s,
1064
+ registryFingerprint: c,
1090
1065
  verifiedAt: o,
1091
1066
  expirationTime: m
1092
1067
  };
1093
1068
  }
1094
- async function vr(e) {
1095
- let t = pr(e.wallet), n = e.schemaUid ?? Z(), r = N(e.uid);
1096
- if (!M(r)) throw Error("@seedprotocol/publish: revokeDomainOwnership requires a valid attestation uid");
1097
- if (!await X(t, m([{
1069
+ async function _r(e) {
1070
+ let t = fr(e.wallet), n = e.schemaUid ?? X(), r = j(e.uid);
1071
+ if (!A(r)) throw Error("@seedprotocol/publish: revokeDomainOwnership requires a valid attestation uid");
1072
+ if (!await Y(t, d([{
1098
1073
  schema: n,
1099
1074
  data: [{ uid: r }]
1100
1075
  }]))) throw Error("@seedprotocol/publish: revokeDomainOwnership failed — no receipt");
1101
1076
  }
1102
- async function yr(e) {
1103
- let { challenge: t } = e, n = St({
1077
+ async function vr(e) {
1078
+ let { challenge: t } = e, n = Ct({
1104
1079
  domain: t.domain,
1105
1080
  claimer: t.claimer,
1106
1081
  token: t.token,
1107
1082
  scope: t.scope
1108
1083
  });
1109
- if (N(n) !== N(t.challengeHash)) return {
1084
+ if (j(n) !== j(t.challengeHash)) return {
1110
1085
  ok: !1,
1111
1086
  dns: {
1112
1087
  ok: !1,
@@ -1118,7 +1093,7 @@ async function yr(e) {
1118
1093
  challengeHash: n,
1119
1094
  error: "Challenge hash does not match domain/claimer/token/scope"
1120
1095
  };
1121
- let r = await ur(t, {
1096
+ let r = await lr(t, {
1122
1097
  lookups: e.dnsLookups,
1123
1098
  now: e.now
1124
1099
  });
@@ -1129,7 +1104,7 @@ async function yr(e) {
1129
1104
  challengeHash: n,
1130
1105
  error: r.error ?? "DNS verification failed"
1131
1106
  };
1132
- let i = e.registryLookup ?? tr, a;
1107
+ let i = e.registryLookup ?? J, a;
1133
1108
  try {
1134
1109
  a = await i(t.domain);
1135
1110
  } catch {
@@ -1148,8 +1123,8 @@ async function yr(e) {
1148
1123
  error: "Registry lookup failed"
1149
1124
  };
1150
1125
  }
1151
- async function br(e) {
1152
- let t = await yr({
1126
+ async function yr(e) {
1127
+ let t = await vr({
1153
1128
  challenge: e.challenge,
1154
1129
  dnsLookups: e.dnsLookups,
1155
1130
  registryLookup: e.registryLookup,
@@ -1157,7 +1132,7 @@ async function br(e) {
1157
1132
  });
1158
1133
  if (!t.ok || !t.registrySnapshot) throw Error(`@seedprotocol/publish: verifyAndAttestDomainOwnership failed — ${t.error ?? "verification failed"}`);
1159
1134
  return {
1160
- ...await _r({
1135
+ ...await gr({
1161
1136
  wallet: e.wallet,
1162
1137
  domain: e.challenge.domain,
1163
1138
  claimer: e.challenge.claimer,
@@ -1171,21 +1146,21 @@ async function br(e) {
1171
1146
  dns: t.dns
1172
1147
  };
1173
1148
  }
1174
- async function xr(e) {
1175
- let t = (await bt({
1149
+ async function br(e) {
1150
+ let t = (await xt({
1176
1151
  toolAddresses: e.toolAddresses,
1177
1152
  schemaUid: e.schemaUid,
1178
1153
  excludeRevoked: !0
1179
- })).find((t) => N(t.id) === N(e.uid));
1154
+ })).find((t) => j(t.id) === j(e.uid));
1180
1155
  if (!t) throw Error("@seedprotocol/publish: assessDomainOwnershipLive could not find attestation for uid/toolAddresses");
1181
- let n = vt(t.decodedDataJson ?? "[]"), r = e.registryLookup ?? tr, i;
1156
+ let n = yt(t.decodedDataJson ?? "[]"), r = e.registryLookup ?? J, i;
1182
1157
  try {
1183
1158
  i = await r(n.domain);
1184
1159
  } catch {
1185
1160
  i = null;
1186
1161
  }
1187
1162
  return {
1188
- ...gt({
1163
+ ..._t({
1189
1164
  decoded: n,
1190
1165
  registrySnapshot: i,
1191
1166
  now: e.now
@@ -1197,50 +1172,50 @@ async function xr(e) {
1197
1172
  }
1198
1173
  //#endregion
1199
1174
  //#region src/services/publishedBy/index.ts
1200
- var Sr = "0x0000000000000000000000000000000000000000", Cr = !0;
1201
- function wr(e) {
1202
- if (g(e)) return e.txSender;
1203
- if (i(e)) return e;
1175
+ var xr = "0x0000000000000000000000000000000000000000", Sr = !0;
1176
+ function Z(e) {
1177
+ if (p(e)) return e.txSender;
1178
+ if (r(e)) return e;
1204
1179
  throw Error("@seedprotocol/publish: attestPublishedBy / revokePublishedBy require a PublishWallet or SeedTxSender");
1205
1180
  }
1206
1181
  async function Q(e, t) {
1207
1182
  let n = await e.sendTransaction(t);
1208
- return x(n.transactionHash);
1183
+ return pe(n.transactionHash);
1209
1184
  }
1210
1185
  function $() {
1211
- return It.getSchemaUID(j, Sr, Cr);
1212
- }
1213
- async function Tr(e) {
1214
- let t = wr(e), n = $();
1215
- return await je(n) || (await Q(t, Ae({
1216
- schema: j,
1217
- resolverAddress: Sr,
1218
- revocable: Cr
1219
- })), await Q(t, De({
1186
+ return Lt.getSchemaUID(k, xr, Sr);
1187
+ }
1188
+ async function Cr(e) {
1189
+ let t = Z(e), n = $();
1190
+ return await Me(n) || (await Q(t, je({
1191
+ schema: k,
1192
+ resolverAddress: xr,
1193
+ revocable: Sr
1194
+ })), await Q(t, Oe({
1220
1195
  schemaUid: n,
1221
- schemaName: ht
1196
+ schemaName: gt
1222
1197
  }))), n;
1223
1198
  }
1224
- function Er(e) {
1225
- return new Ft(j).encodeData([
1199
+ function wr(e) {
1200
+ return new It(k).encodeData([
1226
1201
  {
1227
1202
  name: "seedUid",
1228
- value: N(e.seedUid),
1203
+ value: j(e.seedUid),
1229
1204
  type: "bytes32"
1230
1205
  },
1231
1206
  {
1232
1207
  name: "versionUid",
1233
- value: N(e.versionUid || V),
1208
+ value: j(e.versionUid || z),
1234
1209
  type: "bytes32"
1235
1210
  },
1236
1211
  {
1237
1212
  name: "attestationUids",
1238
- value: e.attestationUids.map((e) => N(e)),
1213
+ value: e.attestationUids.map((e) => j(e)),
1239
1214
  type: "bytes32[]"
1240
1215
  },
1241
1216
  {
1242
1217
  name: "batchHash",
1243
- value: N(e.batchHash),
1218
+ value: j(e.batchHash),
1244
1219
  type: "bytes32"
1245
1220
  },
1246
1221
  {
@@ -1255,52 +1230,52 @@ function Er(e) {
1255
1230
  }
1256
1231
  ]);
1257
1232
  }
1258
- async function Dr(e) {
1259
- let t = wr(e.wallet), n = e.ensureSchema === !1 ? $() : await Tr(e.wallet), r = [], i;
1260
- if (e.mode === "uids") r = e.attestationUids.map((e) => N(e)).filter((e) => M(e)), i = e.batchHash ? N(e.batchHash) : Tt(r);
1233
+ async function Tr(e) {
1234
+ let t = Z(e.wallet), n = e.ensureSchema === !1 ? $() : await Cr(e.wallet), r = [], i;
1235
+ if (e.mode === "uids") r = e.attestationUids.map((e) => j(e)).filter((e) => A(e)), i = e.batchHash ? j(e.batchHash) : Et(r);
1261
1236
  else {
1262
1237
  if (!e.batchHash) throw Error("@seedprotocol/publish: attestPublishedBy hash mode requires batchHash");
1263
- if (i = N(e.batchHash), i === V) throw Error("@seedprotocol/publish: attestPublishedBy hash mode requires a non-zero batchHash");
1238
+ if (i = j(e.batchHash), i === z) throw Error("@seedprotocol/publish: attestPublishedBy hash mode requires a non-zero batchHash");
1264
1239
  }
1265
- let a = N(e.seedUid);
1266
- if (!M(a)) throw Error("@seedprotocol/publish: attestPublishedBy requires a valid seedUid");
1267
- let o = Er({
1240
+ let a = j(e.seedUid);
1241
+ if (!A(a)) throw Error("@seedprotocol/publish: attestPublishedBy requires a valid seedUid");
1242
+ let o = wr({
1268
1243
  seedUid: a,
1269
- versionUid: N(e.versionUid ?? V),
1244
+ versionUid: j(e.versionUid ?? z),
1270
1245
  attestationUids: r,
1271
1246
  batchHash: i,
1272
1247
  toolName: e.toolName,
1273
1248
  toolVersion: e.toolVersion
1274
- }), s = await Q(t, c({
1249
+ }), c = await Q(t, s({
1275
1250
  schema: n,
1276
1251
  data: {
1277
1252
  recipient: se,
1278
- expirationTime: BigInt(Pt),
1253
+ expirationTime: BigInt(Ft),
1279
1254
  revocable: !0,
1280
1255
  refUID: a,
1281
1256
  data: o,
1282
1257
  value: 0n
1283
1258
  }
1284
1259
  }));
1285
- if (!s) throw Error("@seedprotocol/publish: attestPublishedBy failed — no receipt");
1286
- let { easContractAddress: l } = C(), u = f(s, l);
1287
- if (!u || !M(u)) throw Error("@seedprotocol/publish: attestPublishedBy failed — could not parse attestation UID");
1260
+ if (!c) throw Error("@seedprotocol/publish: attestPublishedBy failed — no receipt");
1261
+ let { easContractAddress: u } = x(), d = l(c, u);
1262
+ if (!d || !A(d)) throw Error("@seedprotocol/publish: attestPublishedBy failed — could not parse attestation UID");
1288
1263
  return {
1289
- uid: u,
1264
+ uid: d,
1290
1265
  schemaUid: n,
1291
1266
  batchHash: i,
1292
1267
  attestationUids: r
1293
1268
  };
1294
1269
  }
1295
- async function Or(e) {
1296
- let t = wr(e.wallet), n = e.schemaUid ?? $(), r = N(e.uid);
1297
- if (!M(r)) throw Error("@seedprotocol/publish: revokePublishedBy requires a valid attestation uid");
1298
- if (!await Q(t, m([{
1270
+ async function Er(e) {
1271
+ let t = Z(e.wallet), n = e.schemaUid ?? $(), r = j(e.uid);
1272
+ if (!A(r)) throw Error("@seedprotocol/publish: revokePublishedBy requires a valid attestation uid");
1273
+ if (!await Q(t, d([{
1299
1274
  schema: n,
1300
1275
  data: [{ uid: r }]
1301
1276
  }]))) throw Error("@seedprotocol/publish: revokePublishedBy failed — no receipt");
1302
1277
  }
1303
1278
  //#endregion
1304
- export { we as AttestationVerificationError, de as DEFAULT_PUBLISH_CHAIN, ot as DOMAIN_OWNERSHIP_METHOD, ct as DOMAIN_OWNERSHIP_SCHEMA_DEF, lt as DOMAIN_OWNERSHIP_SCHEMA_NAME, ft as EAS_CHAIN_DEPLOYMENTS, be as Eip7702ModularAccountPublishError, ae as MANAGED_ACCOUNT_FACTORY_ADDRESSES, v as MULTI_PUBLISH_ABI_REFERENCE_ADDRESS_OP_SEPOLIA, Se as ManagedAccountPublishError, pt as PUBLISHED_BY_SCHEMA_DEF, mt as PUBLISHED_BY_SCHEMA_NAME, Ke as PUBLISH_AUTHORIZATION_SCHEMA_DEF, Ve as PUBLISH_AUTHORIZATION_SCHEMA_NAME, We as PUBLISH_AUTHORIZATION_SCOPES, W as PUBLISH_GAS_HEURISTICS, re as PublishChainConfigError, T as PublishManager, Wt as PublishModeButtons, Gt as PublishProvider, te as SEED_PROTOCOL_CONTRACT_ADDRESS_OP_SEPOLIA, kt as SeedProvider, _e as asPublishWallet, ee as asSeedSigner, ge as asSeedTxSender, Je as assertExecutorModuleReadyForAccount, Ne as assertManagedAccountEasMatchesConfig, xr as assessDomainOwnershipLive, ze as assessPublishAuthorizationLive, _r as attestDomainOwnership, Pe as attestPublishAuthorization, Dr as attestPublishedBy, Ee as buildPublishAnchorBytes, Wn as clearAllPublishProcesses, Gn as clearAllUploadProcesses, Hn as clearCompletedPublishProcesses, Un as clearCompletedPublishProcessesForSeed, d as clearPublishWallet, Ye as collectPublishedBatch, _n as combinePublishCostEstimate, oe as configurePublish, ar as createDomainOwnershipChallenge, Xt as createPermissionlessTxSender, qn as deletePublishProcessById, Jn as deletePublishProcessesByIds, Kn as deletePublishProcessesForSeed, hr as encodeDomainOwnershipAttestationData, n as encodeEasAttest, _ as encodeEasMultiAttest, s as encodeEasMultiRevoke, o as encodeMultiPublish, u as encodeMultiPublishInteger, He as encodePublishAuthorizationAttestationData, Er as encodePublishedByAttestationData, l as encodeSetEas, mr as ensureDomainOwnershipSchema, Ue as ensureEasSchemasForItem, qe as ensureManagedAccountEasConfigured, Ge as ensurePublishAuthorizationSchema, Tr as ensurePublishedBySchema, er as ensureWalletThenPublish, vn as estimatePublishCost, nr as fingerprintFromRegistrySnapshot, Kt as fromEip1193Provider, he as fromEthersWallet, qt as fromWindowEthereum, Me as getArweave, Yn as getArweaveTransactionIds, dn as getCachedMarketRates, an as getCachedTokenPrices, Tn as getDisplayStepId, Z as getDomainOwnershipSchemaUid, xt as getEasChainDeployment, Xn as getEasPayload, Ie as getPublishAuthorizationSchemaUid, me as getPublishChainName, C as getPublishConfig, Dn as getPublishMachineValueForUi, b as getPublishPublicClient, S as getPublishWallet, $ as getPublishedBySchemaUid, wt as hashPublishedByBatch, $t as heuristicPublishGas, pe as initPublish, ue as isContractDeployed, ye as isEip7702ModularAccountPublishError, ve as isManagedAccountPublishError, g as isPublishWallet, xe as isRouterNonModularCoreAccountError, a as isSeedSigner, i as isSeedTxSender, tr as lookupDomainRegistry, Y as normalizeRegistrableDomain, Re as publishMachine, p as readGetEas, e as readIsActiveSigner, ne as requireManagedAccountFactoryAddress, fn as resetMarketRateCache, on as resetTokenPriceCache, En as resolvePublishDisplayValue, ce as resolvePublishEasChain, vr as revokeDomainOwnership, Be as revokePublishAuthorization, Or as revokePublishedBy, Ut as seedTwinConfig, t as setPublishWallet, Fe as simulateCallFromAccount, Ce as stringifyUnderlyingCause, Qn as transformPayloadToIntegerIds, Xe as uidsFromAttestationPairs, jn as useArweaveL1Finalize, An as useCanPublishItem, Mn as useItemPublishStatus, Le as usePublishConfig, Zn as usePublishCostEstimate, kn as usePublishProcess, Vn as usePublishProcessById, In as usePublishProcesses, Rn as usePublishProcessesForSeed, Ln as usePublishProcessesNonActiveCount, Bn as usePublishProcessesNonActiveCountForSeed, Fn as usePublishProcessesState, zn as usePublishProcessesStateForSeed, Qt as useSeedWallet, br as verifyAndAttestDomainOwnership, Oe as verifyDataItem, yr as verifyDomainOwnershipChallenge, ur as verifyDomainOwnershipDns, ie as verifyPublishChain, x as waitForPublishReceipt, wn as watchPublishCost };
1279
+ export { Te as AttestationVerificationError, ne as DEFAULT_PUBLISH_CHAIN, st as DOMAIN_OWNERSHIP_METHOD, lt as DOMAIN_OWNERSHIP_SCHEMA_DEF, ut as DOMAIN_OWNERSHIP_SCHEMA_NAME, pt as EAS_CHAIN_DEPLOYMENTS, xe as Eip7702ModularAccountPublishError, ie as MANAGED_ACCOUNT_FACTORY_ADDRESSES, re as MULTI_PUBLISH_ABI_REFERENCE_ADDRESS_OP_SEPOLIA, Ce as ManagedAccountPublishError, mt as PUBLISHED_BY_SCHEMA_DEF, ht as PUBLISHED_BY_SCHEMA_NAME, qe as PUBLISH_AUTHORIZATION_SCHEMA_DEF, He as PUBLISH_AUTHORIZATION_SCHEMA_NAME, Ge as PUBLISH_AUTHORIZATION_SCOPES, H as PUBLISH_GAS_HEURISTICS, ee as PublishChainConfigError, C as PublishManager, Gt as PublishModeButtons, Kt as PublishProvider, ve as SEED_PROTOCOL_CONTRACT_ADDRESS_OP_SEPOLIA, At as SeedProvider, _e as asPublishWallet, v as asSeedSigner, ge as asSeedTxSender, Ye as assertExecutorModuleReadyForAccount, Pe as assertManagedAccountEasMatchesConfig, br as assessDomainOwnershipLive, Be as assessPublishAuthorizationLive, gr as attestDomainOwnership, Fe as attestPublishAuthorization, Tr as attestPublishedBy, De as buildPublishAnchorBytes, Gn as clearAllPublishProcesses, Kn as clearAllUploadProcesses, Un as clearCompletedPublishProcesses, Wn as clearCompletedPublishProcessesForSeed, c as clearPublishWallet, Xe as collectPublishedBatch, vn as combinePublishCostEstimate, ae as configurePublish, ir as createDomainOwnershipChallenge, Zt as createPermissionlessTxSender, Jn as deletePublishProcessById, Yn as deletePublishProcessesByIds, qn as deletePublishProcessesForSeed, mr as encodeDomainOwnershipAttestationData, t as encodeEasAttest, m as encodeEasMultiAttest, o as encodeEasMultiRevoke, a as encodeMultiPublish, Ue as encodePublishAuthorizationAttestationData, wr as encodePublishedByAttestationData, ue as encodeSetEas, pr as ensureDomainOwnershipSchema, We as ensureEasSchemasForItem, Je as ensureManagedAccountEasConfigured, Ke as ensurePublishAuthorizationSchema, Cr as ensurePublishedBySchema, er as ensureWalletThenPublish, yn as estimatePublishCost, tr as fingerprintFromRegistrySnapshot, qt as fromEip1193Provider, he as fromEthersWallet, Jt as fromWindowEthereum, Ne as getArweave, Xn as getArweaveTransactionIds, fn as getCachedMarketRates, on as getCachedTokenPrices, En as getDisplayStepId, X as getDomainOwnershipSchemaUid, St as getEasChainDeployment, Zn as getEasPayload, Le as getPublishAuthorizationSchemaUid, me as getPublishChainName, x as getPublishConfig, On as getPublishMachineValueForUi, oe as getPublishPublicClient, b as getPublishWallet, $ as getPublishedBySchemaUid, Tt as hashPublishedByBatch, en as heuristicPublishGas, fe as initPublish, _ as isContractDeployed, be as isEip7702ModularAccountPublishError, ye as isManagedAccountPublishError, p as isPublishWallet, Se as isRouterNonModularCoreAccountError, i as isSeedSigner, r as isSeedTxSender, J as lookupDomainRegistry, q as normalizeRegistrableDomain, ze as publishMachine, h as readGetEas, u as readIsActiveSigner, y as requireManagedAccountFactoryAddress, pn as resetMarketRateCache, sn as resetTokenPriceCache, Dn as resolvePublishDisplayValue, ce as resolvePublishEasChain, _r as revokeDomainOwnership, Ve as revokePublishAuthorization, Er as revokePublishedBy, Wt as seedTwinConfig, e as setPublishWallet, Ie as simulateCallFromAccount, we as stringifyUnderlyingCause, Ze as uidsFromAttestationPairs, Mn as useArweaveL1Finalize, jn as useCanPublishItem, Nn as useItemPublishStatus, Re as usePublishConfig, Qn as usePublishCostEstimate, An as usePublishProcess, Hn as usePublishProcessById, Ln as usePublishProcesses, zn as usePublishProcessesForSeed, Rn as usePublishProcessesNonActiveCount, Vn as usePublishProcessesNonActiveCountForSeed, In as usePublishProcessesState, Bn as usePublishProcessesStateForSeed, $t as useSeedWallet, yr as verifyAndAttestDomainOwnership, ke as verifyDataItem, vr as verifyDomainOwnershipChallenge, lr as verifyDomainOwnershipDns, te as verifyPublishChain, pe as waitForPublishReceipt, Tn as watchPublishCost };
1305
1280
 
1306
1281
  //# sourceMappingURL=index.js.map