@seedprotocol/publish 0.7.4 → 0.7.5-next.850.g9ab585b

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 (66) hide show
  1. package/CHANGELOG.md +223 -3
  2. package/README.md +31 -8
  3. package/dist/{chainConfig-DM9RSIMT.js → chainConfig-BWzE8DIF.js} +1347 -1356
  4. package/dist/chainConfig-BWzE8DIF.js.map +1 -0
  5. package/dist/config.d.ts +11 -5
  6. package/dist/config.d.ts.map +1 -1
  7. package/dist/{ensureAutomationSessionKey-DTO5lxXB.js → ensureAutomationSessionKey-BenLVZk4.js} +22 -22
  8. package/dist/{ensureAutomationSessionKey-DTO5lxXB.js.map → ensureAutomationSessionKey-BenLVZk4.js.map} +1 -1
  9. package/dist/{ensureModularPublishBootstrap-BYySx3sx.js → ensureModularPublishBootstrap-CngVyk4c.js} +9 -9
  10. package/dist/{ensureModularPublishBootstrap-BYySx3sx.js.map → ensureModularPublishBootstrap-CngVyk4c.js.map} +1 -1
  11. package/dist/{ensureSmartWalletThenPublish-DiH5CKLY.js → ensureSmartWalletThenPublish-3Q_vA8mD.js} +19 -25
  12. package/dist/ensureSmartWalletThenPublish-3Q_vA8mD.js.map +1 -0
  13. package/dist/helpers/adapters/thirdwebAccount.d.ts +3 -1
  14. package/dist/helpers/adapters/thirdwebAccount.d.ts.map +1 -1
  15. package/dist/helpers/ensureSmartWalletThenPublish.d.ts +3 -4
  16. package/dist/helpers/ensureSmartWalletThenPublish.d.ts.map +1 -1
  17. package/dist/helpers/ensureWalletThenPublish.d.ts +18 -4
  18. package/dist/helpers/ensureWalletThenPublish.d.ts.map +1 -1
  19. package/dist/helpers/publishItem.d.ts.map +1 -1
  20. package/dist/helpers/seedSigner.d.ts +8 -0
  21. package/dist/helpers/seedSigner.d.ts.map +1 -1
  22. package/dist/helpers/thirdweb.d.ts +4 -0
  23. package/dist/helpers/thirdweb.d.ts.map +1 -1
  24. package/dist/hooks/useCanPublishItem.d.ts +5 -0
  25. package/dist/hooks/useCanPublishItem.d.ts.map +1 -1
  26. package/dist/index.d.ts +1 -1
  27. package/dist/index.d.ts.map +1 -1
  28. package/dist/index.js +274 -260
  29. package/dist/index.js.map +1 -1
  30. package/dist/{managedAccountAdmin-rhHtJC4y.js → managedAccountAdmin-CW1P40qh.js} +9 -9
  31. package/dist/{managedAccountAdmin-rhHtJC4y.js.map → managedAccountAdmin-CW1P40qh.js.map} +1 -1
  32. package/dist/{publishAuthorization-Dx-4adsz.js → publishAuthorization-BOalFNvQ.js} +24 -24
  33. package/dist/{publishAuthorization-Dx-4adsz.js.map → publishAuthorization-BOalFNvQ.js.map} +1 -1
  34. package/dist/publishWalletRegistry-Bf_Nvf_3.js +45 -0
  35. package/dist/publishWalletRegistry-Bf_Nvf_3.js.map +1 -0
  36. package/dist/react/ConnectButton.d.ts.map +1 -1
  37. package/dist/react/PublishProvider.d.ts.map +1 -1
  38. package/dist/react/PublishProvider.initOrder.test.d.ts +2 -0
  39. package/dist/react/PublishProvider.initOrder.test.d.ts.map +1 -0
  40. package/dist/react/PublishProvider.thirdweb.d.ts.map +1 -1
  41. package/dist/{resolveRevokeAccount-CC9X1H9x.js → resolveRevokeAccount-BUK9i1T4.js} +9 -9
  42. package/dist/{resolveRevokeAccount-CC9X1H9x.js.map → resolveRevokeAccount-BUK9i1T4.js.map} +1 -1
  43. package/dist/services/publish/actors/checking.d.ts.map +1 -1
  44. package/dist/services/publish/actors/pollForConfirmation.d.ts +14 -0
  45. package/dist/services/publish/actors/pollForConfirmation.d.ts.map +1 -1
  46. package/dist/services/publish/helpers/undeployedSmartAccount.d.ts +11 -7
  47. package/dist/services/publish/helpers/undeployedSmartAccount.d.ts.map +1 -1
  48. package/dist/services/publishCost/estimatePublishCost.d.ts +14 -2
  49. package/dist/services/publishCost/estimatePublishCost.d.ts.map +1 -1
  50. package/dist/services/publishCost/types.d.ts +10 -0
  51. package/dist/services/publishCost/types.d.ts.map +1 -1
  52. package/dist/services/publishManager/index.d.ts +6 -10
  53. package/dist/services/publishManager/index.d.ts.map +1 -1
  54. package/dist/thirdweb.js +97 -95
  55. package/dist/thirdweb.js.map +1 -1
  56. package/dist/undeployedSmartAccount-B6KSTipF.js +15 -0
  57. package/dist/undeployedSmartAccount-B6KSTipF.js.map +1 -0
  58. package/dist/{worker-Bv_xadel.js → worker-DAciYSNY.js} +2 -2
  59. package/dist/{worker-Bv_xadel.js.map → worker-DAciYSNY.js.map} +1 -1
  60. package/package.json +25 -7
  61. package/dist/chainConfig-DM9RSIMT.js.map +0 -1
  62. package/dist/ensureSmartWalletThenPublish-DiH5CKLY.js.map +0 -1
  63. package/dist/services/publishManager/actions/query.d.ts +0 -2
  64. package/dist/services/publishManager/actions/query.d.ts.map +0 -1
  65. package/dist/undeployedSmartAccount-uDk6iZjl.js +0 -24
  66. package/dist/undeployedSmartAccount-uDk6iZjl.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,18 +1,19 @@
1
- import { $t as e, At as t, Bt as n, C as r, Ct as i, D as a, Dt as o, E as s, Et as c, Ft as l, It as u, Jt as d, Lt as f, Mt as p, N as m, Nt as h, O as g, Ot as _, P as v, Pt as y, Qt as ee, S as te, St as ne, T as re, Tt as b, Ut as ie, Vt as ae, Wt as oe, Xt as se, Yt as ce, Zt as le, _ as ue, _t as de, a as x, an as fe, at as pe, b as me, bt as he, c as ge, cn as _e, ct as ve, d as ye, dn as be, dt as xe, en as Se, f as Ce, ft as we, g as Te, h as Ee, i as De, in as Oe, it as ke, jt as Ae, kt as je, l as Me, ln as Ne, lt as Pe, m as Fe, n as Ie, nn as Le, o as S, on as Re, ot as ze, p as C, qt as w, r as Be, rn as Ve, rt as He, s as Ue, sn as We, st as Ge, t as Ke, tn as qe, u as Je, un as T, ut as Ye, v as Xe, vt as Ze, w as Qe, wt as $e, x as et, xt as tt, y as nt, yt as rt, zt as it } from "./chainConfig-DM9RSIMT.js";
2
- import { a as at, c as ot, g as st, h as ct, i as lt, l as ut, n as dt, o as ft, r as pt, s as mt, t as ht } from "./publishAuthorization-Dx-4adsz.js";
3
- import { n as gt, r as _t } from "./collectBatchUids-CnIe9jUB.js";
4
- import { BaseDb as E, arweaveL1FinalizeJobs as D, isItemOwned as vt, publishProcesses as O, uploadProcesses as yt } from "@seedprotocol/sdk";
5
- import { createWalletClient as bt, custom as xt, defineChain as St } from "viem";
6
- import { NO_EXPIRATION as Ct, SchemaEncoder as wt, SchemaRegistry as Tt, ZERO_BYTES32 as k } from "@ethereum-attestation-service/eas-sdk";
7
- import { useCallback as A, useEffect as j, useMemo as M, useRef as Et, useState as N } from "react";
1
+ import { $t as e, At as t, Bt as n, C as r, Ct as i, D as a, Dt as o, E as s, Et as c, F as l, Ft as u, Gt as d, It as f, Jt as p, Kt as m, Lt as h, Mt as g, Nt as _, O as v, Ot as y, P as ee, Pt as te, Qt as ne, Rt as re, S as ie, St as ae, T as oe, Tt as se, Vt as ce, Wt as b, Xt as le, Yt as ue, Zt as de, _ as fe, a as x, an as pe, at as me, b as he, bt as ge, c as _e, cn as ve, ct as ye, d as be, dt as xe, en as Se, ft as Ce, g as we, h as Te, i as Ee, in as De, it as Oe, jt as ke, k as Ae, kt as je, l as Me, lt as Ne, m as Pe, n as Fe, nn as Ie, o as Le, on as Re, ot as ze, p as Be, pt as Ve, qt as He, r as Ue, rn as We, s as Ge, sn as S, st as Ke, t as qe, tn as Je, u as Ye, ut as Xe, v as Ze, vt as Qe, w as $e, wt as C, x as et, xt as tt, y as nt, yt as rt } from "./chainConfig-BWzE8DIF.js";
2
+ import { n as w, r as it, t as at } from "./publishWalletRegistry-Bf_Nvf_3.js";
3
+ import { a as ot, c as st, g as ct, h as lt, i as ut, l as dt, n as ft, o as pt, r as mt, s as ht, t as gt } from "./publishAuthorization-BOalFNvQ.js";
4
+ import { n as _t, r as vt } from "./collectBatchUids-CnIe9jUB.js";
5
+ import { BaseDb as T, arweaveL1FinalizeJobs as E, isItemOwned as yt, publishProcesses as D, uploadProcesses as bt } from "@seedprotocol/sdk";
6
+ import { createWalletClient as xt, custom as St, defineChain as Ct } from "viem";
7
+ import { NO_EXPIRATION as wt, SchemaEncoder as Tt, SchemaRegistry as Et, ZERO_BYTES32 as O } from "@ethereum-attestation-service/eas-sdk";
8
+ import { useCallback as k, useEffect as A, useMemo as j, useRef as M, useState as N } from "react";
8
9
  import { and as Dt, desc as P, eq as F, inArray as Ot, notInArray as kt } from "drizzle-orm";
9
10
  import { DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS as At, DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS as jt, DOMAIN_OWNERSHIP_METHOD as Mt, DOMAIN_OWNERSHIP_METHOD as Nt, DOMAIN_OWNERSHIP_SCHEMA_DEF as Pt, DOMAIN_OWNERSHIP_SCHEMA_DEF as I, DOMAIN_OWNERSHIP_SCHEMA_NAME as Ft, DOMAIN_OWNERSHIP_SCHEMA_NAME as It, DOMAIN_OWNERSHIP_SCOPE_HOSTNAME as Lt, DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE as L, EAS_CHAIN_DEPLOYMENTS as Rt, PUBLISHED_BY_SCHEMA_DEF as zt, PUBLISHED_BY_SCHEMA_DEF as R, PUBLISHED_BY_SCHEMA_NAME as Bt, PUBLISHED_BY_SCHEMA_NAME as Vt, assessDomainOwnership as Ht, buildDomainOwnershipTxtValue as Ut, decodeDomainOwnershipData as Wt, domainOwnershipTxtName as Gt, getDomainOwnershipFromEas as Kt, getEasChainDeployment as qt, hashDomainOwnershipChallenge as Jt, hashDomainRegistryFingerprint as Yt, hashPublishedByBatch as Xt, hashPublishedByBatch as Zt, isValidEasAttestationUid as z, normalizeBytes32Hex as B, parseDomainOwnershipTxtValue as Qt } from "@seedprotocol/eas";
10
11
  import { jsx as V, jsxs as $t } from "react/jsx-runtime";
11
- import { SeedProvider as en, SeedProvider as tn, useLiveQuery as H } from "@seedprotocol/react";
12
- import { useSelector as nn } from "@xstate/react";
13
- import { lookup as rn, toRegistrableDomain as an } from "rdapper";
12
+ import { SeedProvider as en, SeedProvider as tn, useLiveQuery as H, useSeedAddressRevision as nn } from "@seedprotocol/react";
13
+ import { useSelector as rn } from "@xstate/react";
14
+ import { lookup as an, toRegistrableDomain as on } from "rdapper";
14
15
  //#region src/helpers/seedTwin.ts
15
- function on(e) {
16
+ function sn(e) {
16
17
  let t = [
17
18
  ["chainId", e?.chainId],
18
19
  ["rpcUrl", e?.rpcUrl],
@@ -24,7 +25,7 @@ function on(e) {
24
25
  ["contracts.seedProtocolExecutor", e?.contracts?.seedProtocolExecutor]
25
26
  ].filter(([, e]) => e == null || e === "").map(([e]) => e);
26
27
  if (t.length > 0) throw Error(`seedTwinConfig: twin.json is missing ${t.join(", ")}. Re-run twin:up.`);
27
- let n = e.forkedFrom?.chain ? ` (${e.forkedFrom.chain} fork)` : "", r = St({
28
+ let n = e.forkedFrom?.chain ? ` (${e.forkedFrom.chain} fork)` : "", r = Ct({
28
29
  id: e.chainId,
29
30
  name: `Seed twin${n}`,
30
31
  nativeCurrency: {
@@ -58,7 +59,7 @@ function on(e) {
58
59
  }
59
60
  //#endregion
60
61
  //#region src/react/PublishModeButtons.tsx
61
- var sn = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish mode" }) => {
62
+ var cn = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish mode" }) => {
62
63
  let i = {
63
64
  display: "inline-flex",
64
65
  gap: 8,
@@ -91,39 +92,40 @@ var sn = ({ value: e, onChange: t, disabled: n = !1, "aria-label": r = "Publish
91
92
  children: "New version"
92
93
  })]
93
94
  });
94
- }, cn = ({ children: e, config: t, queryClient: n, queryClientRef: r }) => (j(() => {
95
- t && S(t);
96
- }, [t]), /* @__PURE__ */ V(ct.Provider, {
97
- value: t ?? De(),
98
- children: /* @__PURE__ */ V(tn, {
99
- queryClient: n,
100
- queryClientRef: r,
101
- children: e
102
- })
103
- }));
95
+ }, ln = ({ children: e, config: t, queryClient: n, queryClientRef: r }) => {
96
+ let i = M(void 0);
97
+ return t && i.current !== t && (Le(t), i.current = t), /* @__PURE__ */ V(lt.Provider, {
98
+ value: t ?? Ee(),
99
+ children: /* @__PURE__ */ V(tn, {
100
+ queryClient: n,
101
+ queryClientRef: r,
102
+ children: e
103
+ })
104
+ });
105
+ };
104
106
  //#endregion
105
107
  //#region src/helpers/adapters/eip1193.ts
106
108
  async function U(e, t = {}) {
107
- let n = t.chain ?? Ie(), r = t.address;
109
+ let n = t.chain ?? Fe(), r = t.address;
108
110
  if (!r) {
109
111
  let t = await e.request({ method: "eth_requestAccounts" });
110
112
  if (!t?.[0]) throw Error("@seedprotocol/publish: EIP-1193 provider returned no accounts");
111
113
  r = t[0];
112
114
  }
113
- let i = bt({
115
+ let i = xt({
114
116
  account: r,
115
117
  chain: n,
116
- transport: xt(e)
118
+ transport: St(e)
117
119
  });
118
120
  return {
119
- signer: he({
121
+ signer: tt({
120
122
  address: r,
121
123
  signMessage: async ({ message: e }) => i.signMessage({
122
124
  account: r,
123
125
  message: typeof e == "string" ? e : { raw: e.raw }
124
126
  })
125
127
  }),
126
- txSender: tt({
128
+ txSender: ae({
127
129
  address: r,
128
130
  sendTransaction: async (e) => ({ transactionHash: await i.sendTransaction({
129
131
  account: r,
@@ -133,59 +135,60 @@ async function U(e, t = {}) {
133
135
  value: e.value,
134
136
  gas: e.gas
135
137
  }) })
136
- })
138
+ }),
139
+ kind: "eoa"
137
140
  };
138
141
  }
139
- async function ln(e = {}) {
142
+ async function un(e = {}) {
140
143
  let t = globalThis.ethereum;
141
144
  if (!t) throw Error("@seedprotocol/publish: window.ethereum is not available");
142
145
  return U(t, e);
143
146
  }
144
147
  //#endregion
145
148
  //#region src/react/useSeedWallet.ts
146
- function un() {
147
- let [e, t] = N(() => o()), [n, r] = N(() => o() ? "connected" : "disconnected");
148
- j(() => {
149
- t(o());
149
+ function dn() {
150
+ let [e, t] = N(() => w()), [n, r] = N(() => w() ? "connected" : "disconnected");
151
+ A(() => {
152
+ t(w());
150
153
  }, []);
151
- let a = A(async (e) => {
154
+ let i = k(async (e) => {
152
155
  r("connecting");
153
156
  try {
154
157
  let n;
155
- n = i(e) ? e : await U(e);
156
- let a = x(), o = fe(a), s = n.txSender;
157
- o.sender === "eip7702" && (s = await Ce({
158
+ n = C(e) ? e : await U(e);
159
+ let i = x(), a = Ie(i), o = n.txSender;
160
+ a.sender === "eip7702" && (o = await Be({
158
161
  signer: n.signer,
159
- bundlerUrl: a.bundlerUrl,
160
- paymasterUrl: a.paymasterUrl,
161
- sponsored: o.gas.payer === "sponsored"
162
+ bundlerUrl: i.bundlerUrl,
163
+ paymasterUrl: i.paymasterUrl,
164
+ sponsored: a.gas.payer === "sponsored"
162
165
  }));
163
- let c = {
166
+ let s = {
164
167
  signer: n.signer,
165
- txSender: s,
166
- ownedAddresses: [n.signer.address, s.address],
168
+ txSender: o,
169
+ ownedAddresses: [n.signer.address, o.address],
167
170
  publisherAddress: n.signer.address
168
171
  };
169
- return await _(c), t(c), r("connected"), c;
172
+ return await it(s), t(s), r("connected"), s;
170
173
  } catch (e) {
171
174
  throw r("disconnected"), e;
172
175
  }
173
- }, []), s = A(() => {
174
- c(), t(null), r("disconnected");
176
+ }, []), a = k(() => {
177
+ at(), t(null), r("disconnected");
175
178
  }, []);
176
179
  return {
177
180
  address: e?.signer.address,
178
181
  signer: e?.signer,
179
182
  txSender: e?.txSender,
180
183
  status: n,
181
- connect: a,
182
- disconnect: s
184
+ connect: i,
185
+ disconnect: a
183
186
  };
184
187
  }
185
188
  //#endregion
186
189
  //#region src/services/publishCost/watchPublishCost.ts
187
- var dn = 6e4, fn = 15e3;
188
- function pn(e) {
190
+ var fn = 6e4, pn = 15e3;
191
+ function mn(e) {
189
192
  let t = e.getService().getSnapshot(), n = (t && typeof t == "object" && "context" in t ? t.context : void 0)?.propertyValue ?? e.value;
190
193
  return `${e.propertyName}:${e.uid ?? ""}:${String(n ?? "")}`;
191
194
  }
@@ -195,16 +198,16 @@ function W(e) {
195
198
  e.seedLocalId,
196
199
  e.seedUid ?? "",
197
200
  e.latestVersionLocalId ?? "",
198
- ...t.map(pn)
201
+ ...t.map(mn)
199
202
  ].join("|");
200
203
  }
201
- function mn(e) {
204
+ function hn(e) {
202
205
  return e instanceof Error ? e : Error(String(e));
203
206
  }
204
- function hn(e, t, n) {
205
- let r = n?.priceRefreshMs ?? dn, i = n?.itemIdleMs ?? fn, a = n?.estimate ?? ((e) => Te(e, n)), o = n?.reprice ?? (async (e) => {
206
- let t = await ue({ forceRefresh: !0 });
207
- return Ee(e.work, t, {
207
+ function gn(e, t, n) {
208
+ let r = n?.priceRefreshMs ?? fn, i = n?.itemIdleMs ?? pn, a = n?.estimate ?? ((e) => fe(e, n)), o = n?.reprice ?? (async (e) => {
209
+ let t = await Ze({ forceRefresh: !0 });
210
+ return we(e.work, t, {
208
211
  evmUserPays: e.evm.userPays,
209
212
  arweavePath: e.arweave.path
210
213
  });
@@ -225,7 +228,7 @@ function hn(e, t, n) {
225
228
  l = n, c = W(e), d = !1, u = !1, f = null, g();
226
229
  } catch (e) {
227
230
  if (s || t !== p) return;
228
- u = !1, f = mn(e), g();
231
+ u = !1, f = hn(e), g();
229
232
  }
230
233
  }, v = () => {
231
234
  l && (d = !0), i <= 0 ? _() : (m && clearTimeout(m), m = setTimeout(() => {
@@ -248,7 +251,7 @@ function hn(e, t, n) {
248
251
  l = e, g();
249
252
  } catch (e) {
250
253
  if (s) return;
251
- f = mn(e), g();
254
+ f = hn(e), g();
252
255
  }
253
256
  })();
254
257
  }, r)), {
@@ -260,32 +263,32 @@ function hn(e, t, n) {
260
263
  }
261
264
  //#endregion
262
265
  //#region src/helpers/publishDisplayHelpers.ts
263
- function gn(e) {
266
+ function _n(e) {
264
267
  return e === "creatingAttestationsDirectToEas" ? "creatingAttestations" : e;
265
268
  }
266
- function _n(e, t, n) {
269
+ function vn(e, t, n) {
267
270
  if (e != null) return n;
268
- if (t?.status === "completed") return T.SUCCESS;
269
- if (t?.status === "failed") return T.FAILURE;
271
+ if (t?.status === "completed") return S.SUCCESS;
272
+ if (t?.status === "failed") return S.FAILURE;
270
273
  if (t?.status !== "interrupted") return n;
271
274
  }
272
- function vn(e) {
275
+ function yn(e) {
273
276
  if (e) {
274
- if (e.status === "failed") return T.FAILURE;
275
- if (e.status === "completed") return T.SUCCESS;
277
+ if (e.status === "failed") return S.FAILURE;
278
+ if (e.status === "completed") return S.SUCCESS;
276
279
  if (e.status !== "interrupted") {
277
280
  if (e.completedAt != null) {
278
281
  try {
279
282
  let t = JSON.parse(e.persistedSnapshot);
280
- if (t.status === "done" && t.value === T.FAILURE) return T.FAILURE;
283
+ if (t.status === "done" && t.value === S.FAILURE) return S.FAILURE;
281
284
  } catch {}
282
- return T.SUCCESS;
285
+ return S.SUCCESS;
283
286
  }
284
287
  try {
285
288
  let t = JSON.parse(e.persistedSnapshot);
286
289
  if (t.status === "done") {
287
- if (t.value === T.SUCCESS) return T.SUCCESS;
288
- if (t.value === T.FAILURE) return T.FAILURE;
290
+ if (t.value === S.SUCCESS) return S.SUCCESS;
291
+ if (t.value === S.FAILURE) return S.FAILURE;
289
292
  }
290
293
  if (typeof t.value == "string") return t.value;
291
294
  } catch {
@@ -296,19 +299,19 @@ function vn(e) {
296
299
  }
297
300
  //#endregion
298
301
  //#region src/hooks/usePublishProcess.ts
299
- function yn(e) {
300
- return !e || e.status !== "done" ? !1 : e.value === T.SUCCESS || e.value === T.FAILURE;
301
- }
302
302
  function bn(e) {
303
- let t = C.getService(), n = nn(t, (t) => t?.context?.publishProcesses?.get(e) ?? null), r = Et(null);
304
- j(() => {
303
+ return !e || e.status !== "done" ? !1 : e.value === S.SUCCESS || e.value === S.FAILURE;
304
+ }
305
+ function xn(e) {
306
+ let t = Pe.getService(), n = rn(t, (t) => t?.context?.publishProcesses?.get(e) ?? null), r = M(null);
307
+ A(() => {
305
308
  r.current = null;
306
309
  }, [e]);
307
- let [i, a] = N(void 0), [o, s] = N(null), c = E.getAppDb(), l = M(() => e && c ? c.select().from(O).where(F(O.seedLocalId, e)).orderBy(P(O.startedAt)).limit(1) : null, [c, e]), u = H(l)?.[0], d = u?.status, f = M(() => {
310
+ let [i, a] = N(void 0), [o, s] = N(null), c = T.getAppDb(), l = j(() => e && c ? c.select().from(D).where(F(D.seedLocalId, e)).orderBy(P(D.startedAt)).limit(1) : null, [c, e]), u = H(l)?.[0], d = u?.status, f = j(() => {
308
311
  if (n != null) return i;
309
312
  if (o === "success" || o === "failure") return o;
310
- let e = vn(u);
311
- return e === T.SUCCESS || e === T.FAILURE ? e : _n(n, d == null ? void 0 : { status: d }, i);
313
+ let e = yn(u);
314
+ return e === S.SUCCESS || e === S.FAILURE ? e : vn(n, d == null ? void 0 : { status: d }, i);
312
315
  }, [
313
316
  n,
314
317
  d,
@@ -316,16 +319,16 @@ function bn(e) {
316
319
  o,
317
320
  u
318
321
  ]);
319
- return j(() => {
322
+ return A(() => {
320
323
  s(null);
321
- }, [e]), j(() => {
324
+ }, [e]), A(() => {
322
325
  n ?? (d === "completed" ? s("success") : d === "failed" && s("failure"));
323
- }, [d, n]), j(() => {
326
+ }, [d, n]), A(() => {
324
327
  n != null && s(null);
325
- }, [n]), j(() => {
328
+ }, [n]), A(() => {
326
329
  if (!n) {
327
330
  let e = r.current;
328
- yn(e) ? (a(e.value), e.value === T.SUCCESS ? s("success") : e.value === T.FAILURE && s("failure")) : a(void 0);
331
+ bn(e) ? (a(e.value), e.value === S.SUCCESS ? s("success") : e.value === S.FAILURE && s("failure")) : a(void 0);
329
332
  return;
330
333
  }
331
334
  let e = n.getSnapshot();
@@ -349,17 +352,28 @@ function bn(e) {
349
352
  }
350
353
  //#endregion
351
354
  //#region src/hooks/useCanPublishItem.ts
352
- function xn(e) {
353
- let [t, n] = N(!0);
354
- return j(() => {
355
- e ? vt(e).then(n).catch(() => n(!1)) : n(!1);
356
- }, [e?.seedLocalId]), t;
355
+ function Sn(e) {
356
+ let [t, n] = N(!1), r = nn(), i = e?.seedLocalId;
357
+ return A(() => {
358
+ if (!e) {
359
+ n(!1);
360
+ return;
361
+ }
362
+ let t = !0;
363
+ return n(!1), yt(e).then((e) => {
364
+ t && n(e);
365
+ }).catch(() => {
366
+ t && n(!1);
367
+ }), () => {
368
+ t = !1;
369
+ };
370
+ }, [i, r]), t;
357
371
  }
358
372
  //#endregion
359
373
  //#region src/hooks/useArweaveL1Finalize.ts
360
- function Sn(e) {
361
- let t = E.getAppDb(), n = M(() => e && t ? t.select().from(D).where(F(D.seedLocalId, e)).orderBy(P(D.updatedAt)) : null, [t, e]), r = H(n) ?? [];
362
- return M(() => {
374
+ function Cn(e) {
375
+ let t = T.getAppDb(), n = j(() => e && t ? t.select().from(E).where(F(E.seedLocalId, e)).orderBy(P(E.updatedAt)) : null, [t, e]), r = H(n) ?? [];
376
+ return j(() => {
363
377
  let e = r.filter((e) => e.phase === "pending_l1").length, t = r.filter((e) => e.phase === "confirmed").length;
364
378
  return {
365
379
  hasPendingL1: e > 0,
@@ -371,8 +385,8 @@ function Sn(e) {
371
385
  }
372
386
  //#endregion
373
387
  //#region src/hooks/useItemPublishStatus.ts
374
- function Cn(e) {
375
- let { publishProcess: t, value: n } = bn(e ?? ""), r = Sn(e), i = E.getAppDb(), a = M(() => e && i ? i.select().from(O).where(F(O.seedLocalId, e)).orderBy(P(O.startedAt)).limit(1) : null, [i, e]), o = H(a)?.[0];
388
+ function wn(e) {
389
+ let { publishProcess: t, value: n } = xn(e ?? ""), r = Cn(e), i = T.getAppDb(), a = j(() => e && i ? i.select().from(D).where(F(D.seedLocalId, e)).orderBy(P(D.startedAt)).limit(1) : null, [i, e]), o = H(a)?.[0];
376
390
  return {
377
391
  latestRecord: o,
378
392
  publishProcess: t,
@@ -385,44 +399,44 @@ function Cn(e) {
385
399
  }
386
400
  //#endregion
387
401
  //#region src/hooks/usePublishProcesses.ts
388
- function wn() {
389
- let e = E.getAppDb();
390
- return M(() => e ? e.select().from(O).orderBy(P(O.startedAt)) : null, [e]);
402
+ function Tn() {
403
+ let e = T.getAppDb();
404
+ return j(() => e ? e.select().from(D).orderBy(P(D.startedAt)) : null, [e]);
391
405
  }
392
- function Tn(e) {
393
- let t = E.getAppDb();
394
- return M(() => t && e ? t.select().from(O).where(F(O.seedLocalId, e)).orderBy(P(O.startedAt)) : null, [t, e]);
406
+ function En(e) {
407
+ let t = T.getAppDb();
408
+ return j(() => t && e ? t.select().from(D).where(F(D.seedLocalId, e)).orderBy(P(D.startedAt)) : null, [t, e]);
395
409
  }
396
- function En() {
397
- let e = wn(), t = H(e);
410
+ function Dn() {
411
+ let e = Tn(), t = H(e);
398
412
  return {
399
413
  records: t,
400
- nonActiveCount: M(() => t === void 0 ? void 0 : t.filter((e) => e.status !== "in_progress").length, [t])
414
+ nonActiveCount: j(() => t === void 0 ? void 0 : t.filter((e) => e.status !== "in_progress").length, [t])
401
415
  };
402
416
  }
403
- function Dn() {
404
- let e = wn();
417
+ function On() {
418
+ let e = Tn();
405
419
  return H(e);
406
420
  }
407
- function On() {
408
- return En().nonActiveCount;
421
+ function kn() {
422
+ return Dn().nonActiveCount;
409
423
  }
410
- function kn(e) {
411
- let t = Tn(e);
424
+ function An(e) {
425
+ let t = En(e);
412
426
  return H(t);
413
427
  }
414
- function An(e) {
415
- let t = Tn(e), n = H(t);
428
+ function jn(e) {
429
+ let t = En(e), n = H(t);
416
430
  return {
417
431
  records: n,
418
- nonActiveCount: M(() => n === void 0 ? void 0 : n.filter((e) => e.status !== "in_progress").length, [n])
432
+ nonActiveCount: j(() => n === void 0 ? void 0 : n.filter((e) => e.status !== "in_progress").length, [n])
419
433
  };
420
434
  }
421
- function jn(e) {
422
- return An(e).nonActiveCount;
423
- }
424
435
  function Mn(e) {
425
- let t = E.getAppDb(), n = M(() => e != null && t ? t.select().from(O).where(F(O.id, e)).limit(1) : null, [t, e]), r = H(n), i = r === void 0;
436
+ return jn(e).nonActiveCount;
437
+ }
438
+ function Nn(e) {
439
+ let t = T.getAppDb(), n = j(() => e != null && t ? t.select().from(D).where(F(D.id, e)).limit(1) : null, [t, e]), r = H(n), i = r === void 0;
426
440
  return {
427
441
  record: r && r.length > 0 ? r[0] : null,
428
442
  isLoading: i
@@ -430,45 +444,45 @@ function Mn(e) {
430
444
  }
431
445
  //#endregion
432
446
  //#region src/hooks/clearCompletedPublishProcesses.ts
433
- async function Nn() {
434
- let e = E.getAppDb();
435
- e && await e.delete(O).where(kt(O.status, ["in_progress"]));
436
- }
437
- async function Pn(e) {
438
- let t = E.getAppDb();
439
- t && await t.delete(O).where(Dt(F(O.seedLocalId, e), kt(O.status, ["in_progress"])));
447
+ async function Pn() {
448
+ let e = T.getAppDb();
449
+ e && await e.delete(D).where(kt(D.status, ["in_progress"]));
440
450
  }
441
- async function Fn() {
442
- let e = E.getAppDb();
443
- e && await e.delete(O);
451
+ async function Fn(e) {
452
+ let t = T.getAppDb();
453
+ t && await t.delete(D).where(Dt(F(D.seedLocalId, e), kt(D.status, ["in_progress"])));
444
454
  }
445
455
  async function In() {
446
- let e = E.getAppDb();
447
- e && await e.delete(yt);
456
+ let e = T.getAppDb();
457
+ e && await e.delete(D);
448
458
  }
449
- async function Ln(e) {
450
- let t = E.getAppDb();
451
- t && await t.delete(O).where(F(O.seedLocalId, e));
459
+ async function Ln() {
460
+ let e = T.getAppDb();
461
+ e && await e.delete(bt);
452
462
  }
453
463
  async function Rn(e) {
454
- let t = E.getAppDb();
455
- t && await t.delete(O).where(F(O.id, e));
464
+ let t = T.getAppDb();
465
+ t && await t.delete(D).where(F(D.seedLocalId, e));
456
466
  }
457
467
  async function zn(e) {
468
+ let t = T.getAppDb();
469
+ t && await t.delete(D).where(F(D.id, e));
470
+ }
471
+ async function Bn(e) {
458
472
  if (e.length === 0) return;
459
- let t = E.getAppDb();
460
- t && await t.delete(O).where(Ot(O.id, e));
473
+ let t = T.getAppDb();
474
+ t && await t.delete(D).where(Ot(D.id, e));
461
475
  }
462
476
  //#endregion
463
477
  //#region src/hooks/publishProcessHelpers.ts
464
- function Bn(e) {
478
+ function Vn(e) {
465
479
  try {
466
480
  return (JSON.parse(e.persistedSnapshot).context?.arweaveTransactions ?? []).map((e) => e.transaction?.id).filter((e) => typeof e == "string");
467
481
  } catch {
468
482
  return [];
469
483
  }
470
484
  }
471
- function Vn(e) {
485
+ function Hn(e) {
472
486
  try {
473
487
  return JSON.parse(e.persistedSnapshot).context?.easPayload ?? void 0;
474
488
  } catch {
@@ -477,14 +491,14 @@ function Vn(e) {
477
491
  }
478
492
  //#endregion
479
493
  //#region src/hooks/usePublishCostEstimate.ts
480
- function Hn(e, t) {
481
- let [n, r] = N(null), [i, a] = N(!1), [o, s] = N(!1), [c, l] = N(null), u = Et(() => {}), d = t?.publishMode, f = t?.priceRefreshMs, p = t?.itemIdleMs;
482
- return j(() => {
494
+ function Un(e, t) {
495
+ let [n, r] = N(null), [i, a] = N(!1), [o, s] = N(!1), [c, l] = N(null), u = M(() => {}), d = t?.publishMode, f = t?.priceRefreshMs, p = t?.itemIdleMs;
496
+ return A(() => {
483
497
  if (!e) {
484
498
  r(null), a(!1), s(!1), l(null), u.current = () => {};
485
499
  return;
486
500
  }
487
- let n = hn(e, (e) => {
501
+ let n = gn(e, (e) => {
488
502
  r(e.estimate), a(e.isEstimating), s(e.isStale), l(e.error), u.current = e.refresh;
489
503
  }, t);
490
504
  return () => {
@@ -501,7 +515,7 @@ function Hn(e, t) {
501
515
  isEstimating: i,
502
516
  isStale: o,
503
517
  error: c,
504
- refresh: A(() => {
518
+ refresh: k(() => {
505
519
  u.current();
506
520
  }, [])
507
521
  };
@@ -509,15 +523,15 @@ function Hn(e, t) {
509
523
  //#endregion
510
524
  //#region src/services/domainOwnership/registry.ts
511
525
  function G(e) {
512
- let t = an(e);
526
+ let t = on(e);
513
527
  if (!t) throw Error(`@seedprotocol/publish: unable to resolve registrable domain for "${e}"`);
514
528
  return t.toLowerCase();
515
529
  }
516
- function Un(e) {
530
+ function Wn(e) {
517
531
  return e.trim().toLowerCase().replace(/\.$/, "");
518
532
  }
519
533
  async function K(e) {
520
- let t = G(e), n = await rn(t);
534
+ let t = G(e), n = await an(t);
521
535
  if (!n.ok || !n.record) return null;
522
536
  let r = n.record;
523
537
  return {
@@ -531,7 +545,7 @@ async function K(e) {
531
545
  isRegistered: r.isRegistered
532
546
  };
533
547
  }
534
- function Wn(e) {
548
+ function Gn(e) {
535
549
  return Yt({
536
550
  domain: e.domain,
537
551
  creationDate: e.creationDate ?? "",
@@ -540,23 +554,23 @@ function Wn(e) {
540
554
  }
541
555
  //#endregion
542
556
  //#region src/services/domainOwnership/challenge.ts
543
- function Gn(e) {
557
+ function Kn(e) {
544
558
  let t = new Uint8Array(e);
545
559
  return crypto.getRandomValues(t), t;
546
560
  }
547
- function Kn(e) {
561
+ function qn(e) {
548
562
  let t = "";
549
563
  for (let n of e) t += String.fromCharCode(n);
550
564
  return btoa(t).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/g, "");
551
565
  }
552
- function qn(e) {
553
- let t = e.normalizeRegistrable === !1, n = t ? Un(e.domain) : G(e.domain);
566
+ function Jn(e) {
567
+ let t = e.normalizeRegistrable === !1, n = t ? Wn(e.domain) : G(e.domain);
554
568
  if (!n || n.includes(" ")) throw Error("@seedprotocol/publish: createDomainOwnershipChallenge requires a valid domain");
555
569
  let r = e.claimer.trim();
556
570
  if (!/^0x[0-9a-fA-F]{40}$/.test(r)) throw Error("@seedprotocol/publish: createDomainOwnershipChallenge requires a 20-byte hex claimer address");
557
571
  let i = e.scope ?? (t ? Lt : L);
558
572
  if (i === L && n !== G(n)) throw Error(`@seedprotocol/publish: createDomainOwnershipChallenge cannot use scope "registrable" for "${n}", which is not a registrable domain. Use the hostname scope or challenge ${G(n)}.`);
559
- let a = e.ttlMs ?? At, o = e.now ?? Date.now(), s = new Date(o + a).toISOString(), c = Kn(Gn(32)), l = Jt({
573
+ let a = e.ttlMs ?? At, o = e.now ?? Date.now(), s = new Date(o + a).toISOString(), c = qn(Kn(32)), l = Jt({
560
574
  domain: n,
561
575
  claimer: r,
562
576
  token: c,
@@ -567,7 +581,7 @@ function qn(e) {
567
581
  expiry: s
568
582
  });
569
583
  return {
570
- challengeId: Kn(Gn(16)),
584
+ challengeId: qn(Kn(16)),
571
585
  domain: n,
572
586
  claimer: r,
573
587
  scope: i,
@@ -582,14 +596,14 @@ function qn(e) {
582
596
  }
583
597
  //#endregion
584
598
  //#region src/services/domainOwnership/dnsVerify.ts
585
- async function Jn(e) {
599
+ async function Yn(e) {
586
600
  let { promises: t } = await import("node:dns");
587
601
  return {
588
602
  source: "node:dns",
589
603
  values: (await t.resolveTxt(e)).map((e) => e.join(""))
590
604
  };
591
605
  }
592
- async function Yn(e, t, n) {
606
+ async function Xn(e, t, n) {
593
607
  let r = `${n}?name=${encodeURIComponent(e)}&type=TXT`, i = await fetch(r, { headers: { accept: "application/dns-json" } });
594
608
  if (!i.ok) throw Error(`DoH ${t} HTTP ${i.status}`);
595
609
  let a = await i.json();
@@ -599,11 +613,11 @@ async function Yn(e, t, n) {
599
613
  dnssecAuthenticated: !!a.AD
600
614
  };
601
615
  }
602
- function Xn() {
603
- let e = [(e) => Yn(e, "cloudflare-doh", "https://cloudflare-dns.com/dns-query"), (e) => Yn(e, "google-doh", "https://dns.google/resolve")];
604
- return typeof document > "u" && e.unshift((e) => Jn(e)), e;
616
+ function Zn() {
617
+ let e = [(e) => Xn(e, "cloudflare-doh", "https://cloudflare-dns.com/dns-query"), (e) => Xn(e, "google-doh", "https://dns.google/resolve")];
618
+ return typeof document > "u" && e.unshift((e) => Yn(e)), e;
605
619
  }
606
- function Zn(e, t) {
620
+ function Qn(e, t) {
607
621
  let n = Qt(t);
608
622
  for (let r of e) {
609
623
  if (r === t || r.replace(/^"|"$/g, "") === t) return !0;
@@ -612,7 +626,7 @@ function Zn(e, t) {
612
626
  }
613
627
  return !1;
614
628
  }
615
- async function Qn(e, t) {
629
+ async function $n(e, t) {
616
630
  let n = t?.now ?? Date.now();
617
631
  if (Date.parse(e.expiresAt) <= n) return {
618
632
  ok: !1,
@@ -631,11 +645,11 @@ async function Qn(e, t) {
631
645
  lookups: [],
632
646
  error: "Challenge txtValue does not match token/claimer/expiry"
633
647
  };
634
- let i = t?.lookups ?? Xn(), a = t?.quorum ?? 2, o = [], s = [], c = !1;
648
+ let i = t?.lookups ?? Zn(), a = t?.quorum ?? 2, o = [], s = [], c = !1;
635
649
  await Promise.all(i.map(async (t) => {
636
650
  try {
637
651
  let n = await t(e.txtName);
638
- o.push(n), Zn(n.values, r) && (s.push(n.source), n.dnssecAuthenticated && (c = !0));
652
+ o.push(n), Qn(n.values, r) && (s.push(n.source), n.dnssecAuthenticated && (c = !0));
639
653
  } catch {
640
654
  o.push({
641
655
  source: "error",
@@ -653,32 +667,32 @@ async function Qn(e, t) {
653
667
  }
654
668
  //#endregion
655
669
  //#region src/services/domainOwnership/index.ts
656
- var $n = "0x0000000000000000000000000000000000000000", q = !0;
670
+ var q = "0x0000000000000000000000000000000000000000", er = !0;
657
671
  function J(e) {
658
- if (i(e)) return e.txSender;
659
- if (b(e)) return e;
672
+ if (C(e)) return e.txSender;
673
+ if (c(e)) return e;
660
674
  throw Error("@seedprotocol/publish: domain ownership write APIs require a PublishWallet or SeedTxSender");
661
675
  }
662
676
  async function Y(e, t) {
663
677
  let n = await e.sendTransaction(t);
664
- return w(n.transactionHash);
678
+ return b(n.transactionHash);
665
679
  }
666
680
  function X() {
667
- return Tt.getSchemaUID(I, $n, q);
681
+ return Et.getSchemaUID(I, q, er);
668
682
  }
669
- async function er(e) {
683
+ async function tr(e) {
670
684
  let t = J(e), n = X();
671
- return await a(n) || (await Y(t, g({
685
+ return await v(n) || (await Y(t, Ae({
672
686
  schema: I,
673
- resolverAddress: $n,
674
- revocable: q
675
- })), await Y(t, s({
687
+ resolverAddress: q,
688
+ revocable: er
689
+ })), await Y(t, a({
676
690
  schemaUid: n,
677
691
  schemaName: It
678
692
  }))), n;
679
693
  }
680
- function tr(e) {
681
- return new wt(I).encodeData([
694
+ function nr(e) {
695
+ return new Tt(I).encodeData([
682
696
  {
683
697
  name: "domain",
684
698
  value: e.domain,
@@ -726,7 +740,7 @@ function tr(e) {
726
740
  }
727
741
  ]);
728
742
  }
729
- function nr(e) {
743
+ function rr(e) {
730
744
  if (typeof e.override == "number" && e.override > 0) return e.override;
731
745
  if (e.registryExpirationDate) {
732
746
  let t = Date.parse(e.registryExpirationDate);
@@ -734,61 +748,61 @@ function nr(e) {
734
748
  }
735
749
  return e.verifiedAt + jt;
736
750
  }
737
- async function rr(e) {
738
- let n = J(e.wallet), r = e.ensureSchema === !1 ? X() : await er(e.wallet), i = e.scope ?? L, a = i === L ? G(e.domain) : Un(e.domain), o = e.claimer.trim();
739
- if (!/^0x[0-9a-fA-F]{40}$/.test(o)) throw Error("@seedprotocol/publish: attestDomainOwnership requires a valid claimer address");
740
- let s = B(e.challengeHash);
741
- if (s === k) throw Error("@seedprotocol/publish: attestDomainOwnership requires a non-zero challengeHash");
742
- let c = e.verifiedAt ?? Math.floor(Date.now() / 1e3), l = Wn({
743
- domain: a,
751
+ async function ir(e) {
752
+ let t = J(e.wallet), n = e.ensureSchema === !1 ? X() : await tr(e.wallet), r = e.scope ?? L, i = r === L ? G(e.domain) : Wn(e.domain), a = e.claimer.trim();
753
+ if (!/^0x[0-9a-fA-F]{40}$/.test(a)) throw Error("@seedprotocol/publish: attestDomainOwnership requires a valid claimer address");
754
+ let o = B(e.challengeHash);
755
+ if (o === O) throw Error("@seedprotocol/publish: attestDomainOwnership requires a non-zero challengeHash");
756
+ let s = e.verifiedAt ?? Math.floor(Date.now() / 1e3), c = Gn({
757
+ domain: i,
744
758
  creationDate: e.registrySnapshot.creationDate ?? "",
745
759
  registrarIanaId: e.registrySnapshot.registrarIanaId ?? ""
746
- }), u = e.registrySnapshot.creationDate ?? "", d = e.registrySnapshot.expirationDate ?? "", f = e.method ?? Nt, p = nr({
747
- verifiedAt: c,
748
- registryExpirationDate: d,
760
+ }), l = e.registrySnapshot.creationDate ?? "", u = e.registrySnapshot.expirationDate ?? "", d = e.method ?? Nt, f = rr({
761
+ verifiedAt: s,
762
+ registryExpirationDate: u,
749
763
  override: e.expirationTime
750
- }), m = tr({
751
- domain: a,
752
- claimer: o,
753
- method: f,
754
- challengeHash: s,
755
- verifiedAt: c,
756
- registryCreationDate: u,
757
- registryExpirationDate: d,
758
- registryFingerprint: l,
759
- scope: i
760
- }), h = await Y(n, Ae({
761
- schema: r,
764
+ }), p = nr({
765
+ domain: i,
766
+ claimer: a,
767
+ method: d,
768
+ challengeHash: o,
769
+ verifiedAt: s,
770
+ registryCreationDate: l,
771
+ registryExpirationDate: u,
772
+ registryFingerprint: c,
773
+ scope: r
774
+ }), m = await Y(t, je({
775
+ schema: n,
762
776
  data: {
763
- recipient: o,
764
- expirationTime: BigInt(p),
777
+ recipient: a,
778
+ expirationTime: BigInt(f),
765
779
  revocable: !0,
766
- refUID: k,
767
- data: m,
780
+ refUID: O,
781
+ data: p,
768
782
  value: 0n
769
783
  }
770
784
  }));
771
- if (!h) throw Error("@seedprotocol/publish: attestDomainOwnership failed — no receipt");
772
- let { easContractAddress: g } = x(), _ = t(h, g);
773
- if (!_ || !z(_)) throw Error("@seedprotocol/publish: attestDomainOwnership failed — could not parse attestation UID");
785
+ if (!m) throw Error("@seedprotocol/publish: attestDomainOwnership failed — no receipt");
786
+ let { easContractAddress: h } = x(), g = y(m, h);
787
+ if (!g || !z(g)) throw Error("@seedprotocol/publish: attestDomainOwnership failed — could not parse attestation UID");
774
788
  return {
775
- uid: _,
776
- schemaUid: r,
777
- challengeHash: s,
778
- registryFingerprint: l,
779
- verifiedAt: c,
780
- expirationTime: p
789
+ uid: g,
790
+ schemaUid: n,
791
+ challengeHash: o,
792
+ registryFingerprint: c,
793
+ verifiedAt: s,
794
+ expirationTime: f
781
795
  };
782
796
  }
783
- async function ir(e) {
784
- let t = J(e.wallet), n = e.schemaUid ?? X(), r = B(e.uid);
785
- if (!z(r)) throw Error("@seedprotocol/publish: revokeDomainOwnership requires a valid attestation uid");
786
- if (!await Y(t, p([{
787
- schema: n,
788
- data: [{ uid: r }]
797
+ async function ar(e) {
798
+ let n = J(e.wallet), r = e.schemaUid ?? X(), i = B(e.uid);
799
+ if (!z(i)) throw Error("@seedprotocol/publish: revokeDomainOwnership requires a valid attestation uid");
800
+ if (!await Y(n, t([{
801
+ schema: r,
802
+ data: [{ uid: i }]
789
803
  }]))) throw Error("@seedprotocol/publish: revokeDomainOwnership failed — no receipt");
790
804
  }
791
- async function ar(e) {
805
+ async function or(e) {
792
806
  let { challenge: t } = e, n = Jt({
793
807
  domain: t.domain,
794
808
  claimer: t.claimer,
@@ -807,7 +821,7 @@ async function ar(e) {
807
821
  challengeHash: n,
808
822
  error: "Challenge hash does not match domain/claimer/token/scope"
809
823
  };
810
- let r = await Qn(t, {
824
+ let r = await $n(t, {
811
825
  lookups: e.dnsLookups,
812
826
  now: e.now
813
827
  });
@@ -837,8 +851,8 @@ async function ar(e) {
837
851
  error: "Registry lookup failed"
838
852
  };
839
853
  }
840
- async function or(e) {
841
- let t = await ar({
854
+ async function sr(e) {
855
+ let t = await or({
842
856
  challenge: e.challenge,
843
857
  dnsLookups: e.dnsLookups,
844
858
  registryLookup: e.registryLookup,
@@ -846,7 +860,7 @@ async function or(e) {
846
860
  });
847
861
  if (!t.ok || !t.registrySnapshot) throw Error(`@seedprotocol/publish: verifyAndAttestDomainOwnership failed — ${t.error ?? "verification failed"}`);
848
862
  return {
849
- ...await rr({
863
+ ...await ir({
850
864
  wallet: e.wallet,
851
865
  domain: e.challenge.domain,
852
866
  claimer: e.challenge.claimer,
@@ -860,7 +874,7 @@ async function or(e) {
860
874
  dns: t.dns
861
875
  };
862
876
  }
863
- async function sr(e) {
877
+ async function cr(e) {
864
878
  let t = (await Kt({
865
879
  toolAddresses: e.toolAddresses,
866
880
  schemaUid: e.schemaUid,
@@ -887,32 +901,32 @@ async function sr(e) {
887
901
  }
888
902
  //#endregion
889
903
  //#region src/services/publishedBy/index.ts
890
- var cr = "0x0000000000000000000000000000000000000000", lr = !0;
904
+ var lr = "0x0000000000000000000000000000000000000000", ur = !0;
891
905
  function Z(e) {
892
- if (i(e)) return e.txSender;
893
- if (b(e)) return e;
906
+ if (C(e)) return e.txSender;
907
+ if (c(e)) return e;
894
908
  throw Error("@seedprotocol/publish: attestPublishedBy / revokePublishedBy require a PublishWallet or SeedTxSender");
895
909
  }
896
910
  async function Q(e, t) {
897
911
  let n = await e.sendTransaction(t);
898
- return w(n.transactionHash);
912
+ return b(n.transactionHash);
899
913
  }
900
914
  function $() {
901
- return Tt.getSchemaUID(R, cr, lr);
915
+ return Et.getSchemaUID(R, lr, ur);
902
916
  }
903
- async function ur(e) {
917
+ async function dr(e) {
904
918
  let t = Z(e), n = $();
905
- return await a(n) || (await Q(t, g({
919
+ return await v(n) || (await Q(t, Ae({
906
920
  schema: R,
907
- resolverAddress: cr,
908
- revocable: lr
909
- })), await Q(t, s({
921
+ resolverAddress: lr,
922
+ revocable: ur
923
+ })), await Q(t, a({
910
924
  schemaUid: n,
911
925
  schemaName: Vt
912
926
  }))), n;
913
927
  }
914
- function dr(e) {
915
- return new wt(R).encodeData([
928
+ function fr(e) {
929
+ return new Tt(R).encodeData([
916
930
  {
917
931
  name: "seedUid",
918
932
  value: B(e.seedUid),
@@ -920,7 +934,7 @@ function dr(e) {
920
934
  },
921
935
  {
922
936
  name: "versionUid",
923
- value: B(e.versionUid || k),
937
+ value: B(e.versionUid || O),
924
938
  type: "bytes32"
925
939
  },
926
940
  {
@@ -945,52 +959,52 @@ function dr(e) {
945
959
  }
946
960
  ]);
947
961
  }
948
- async function fr(e) {
949
- let n = Z(e.wallet), r = e.ensureSchema === !1 ? $() : await ur(e.wallet), i = [], a;
950
- if (e.mode === "uids") i = e.attestationUids.map((e) => B(e)).filter((e) => z(e)), a = e.batchHash ? B(e.batchHash) : Zt(i);
962
+ async function pr(e) {
963
+ let t = Z(e.wallet), n = e.ensureSchema === !1 ? $() : await dr(e.wallet), r = [], i;
964
+ if (e.mode === "uids") r = e.attestationUids.map((e) => B(e)).filter((e) => z(e)), i = e.batchHash ? B(e.batchHash) : Zt(r);
951
965
  else {
952
966
  if (!e.batchHash) throw Error("@seedprotocol/publish: attestPublishedBy hash mode requires batchHash");
953
- if (a = B(e.batchHash), a === k) throw Error("@seedprotocol/publish: attestPublishedBy hash mode requires a non-zero batchHash");
967
+ if (i = B(e.batchHash), i === O) throw Error("@seedprotocol/publish: attestPublishedBy hash mode requires a non-zero batchHash");
954
968
  }
955
- let o = B(e.seedUid);
956
- if (!z(o)) throw Error("@seedprotocol/publish: attestPublishedBy requires a valid seedUid");
957
- let s = dr({
958
- seedUid: o,
959
- versionUid: B(e.versionUid ?? k),
960
- attestationUids: i,
961
- batchHash: a,
969
+ let a = B(e.seedUid);
970
+ if (!z(a)) throw Error("@seedprotocol/publish: attestPublishedBy requires a valid seedUid");
971
+ let s = fr({
972
+ seedUid: a,
973
+ versionUid: B(e.versionUid ?? O),
974
+ attestationUids: r,
975
+ batchHash: i,
962
976
  toolName: e.toolName,
963
977
  toolVersion: e.toolVersion
964
- }), c = await Q(n, Ae({
965
- schema: r,
978
+ }), c = await Q(t, je({
979
+ schema: n,
966
980
  data: {
967
- recipient: je,
968
- expirationTime: BigInt(Ct),
981
+ recipient: o,
982
+ expirationTime: BigInt(wt),
969
983
  revocable: !0,
970
- refUID: o,
984
+ refUID: a,
971
985
  data: s,
972
986
  value: 0n
973
987
  }
974
988
  }));
975
989
  if (!c) throw Error("@seedprotocol/publish: attestPublishedBy failed — no receipt");
976
- let { easContractAddress: l } = x(), u = t(c, l);
990
+ let { easContractAddress: l } = x(), u = y(c, l);
977
991
  if (!u || !z(u)) throw Error("@seedprotocol/publish: attestPublishedBy failed — could not parse attestation UID");
978
992
  return {
979
993
  uid: u,
980
- schemaUid: r,
981
- batchHash: a,
982
- attestationUids: i
994
+ schemaUid: n,
995
+ batchHash: i,
996
+ attestationUids: r
983
997
  };
984
998
  }
985
- async function pr(e) {
986
- let t = Z(e.wallet), n = e.schemaUid ?? $(), r = B(e.uid);
987
- if (!z(r)) throw Error("@seedprotocol/publish: revokePublishedBy requires a valid attestation uid");
988
- if (!await Q(t, p([{
989
- schema: n,
990
- data: [{ uid: r }]
999
+ async function mr(e) {
1000
+ let n = Z(e.wallet), r = e.schemaUid ?? $(), i = B(e.uid);
1001
+ if (!z(i)) throw Error("@seedprotocol/publish: revokePublishedBy requires a valid attestation uid");
1002
+ if (!await Q(n, t([{
1003
+ schema: r,
1004
+ data: [{ uid: i }]
991
1005
  }]))) throw Error("@seedprotocol/publish: revokePublishedBy failed — no receipt");
992
1006
  }
993
1007
  //#endregion
994
- export { d as AttestationVerificationError, We as DEFAULT_PUBLISH_CHAIN, Le as DEFAULT_TURBO_PAYMENT_URL, Ve as DEFAULT_TURBO_UPLOAD_URL, Mt as DOMAIN_OWNERSHIP_METHOD, Pt as DOMAIN_OWNERSHIP_SCHEMA_DEF, Ft as DOMAIN_OWNERSHIP_SCHEMA_NAME, Rt as EAS_CHAIN_DEPLOYMENTS, ce as Eip7702ModularAccountPublishError, He as InsufficientStorageCreditsError, _e as MANAGED_ACCOUNT_FACTORY_ADDRESSES, Ne as MULTI_PUBLISH_ABI_REFERENCE_ADDRESS_OP_SEPOLIA, se as ManagedAccountPublishError, zt as PUBLISHED_BY_SCHEMA_DEF, Bt as PUBLISHED_BY_SCHEMA_NAME, ze as PUBLISH_AUTHORIZATION_HEADER, ht as PUBLISH_AUTHORIZATION_SCHEMA_DEF, dt as PUBLISH_AUTHORIZATION_SCHEMA_NAME, pt as PUBLISH_AUTHORIZATION_SCOPES, et as PUBLISH_GAS_HEURISTICS, xe as PublishChainConfigError, C as PublishManager, sn as PublishModeButtons, Ge as PublishNotAuthorizedError, Oe as PublishPaymentConfigError, cn as PublishProvider, le as PublishTransactionRevertedError, be as SEED_PROTOCOL_CONTRACT_ADDRESS_OP_SEPOLIA, en as SeedProvider, de as asPublishWallet, Ze as asSeedSigner, rt as asSeedTxSender, m as assertExecutorModuleReadyForAccount, r as assertManagedAccountEasMatchesConfig, sr as assessDomainOwnershipLive, lt as assessPublishAuthorizationLive, rr as attestDomainOwnership, at as attestPublishAuthorization, fr as attestPublishedBy, ve as buildPublishAnchorBytes, Fn as clearAllPublishProcesses, In as clearAllUploadProcesses, Nn as clearCompletedPublishProcesses, Pn as clearCompletedPublishProcessesForSeed, c as clearPublishWallet, gt as collectPublishedBatch, Ee as combinePublishCostEstimate, Be as configurePublish, qn as createDomainOwnershipChallenge, Ce as createPermissionlessTxSender, Rn as deletePublishProcessById, zn as deletePublishProcessesByIds, Ln as deletePublishProcessesForSeed, tr as encodeDomainOwnershipAttestationData, h as encodeEasAttest, y as encodeEasMultiAttest, l as encodeEasMultiRevoke, u as encodeMultiPublish, ft as encodePublishAuthorizationAttestationData, dr as encodePublishedByAttestationData, f as encodeSetEas, er as ensureDomainOwnershipSchema, re as ensureEasSchemasForItem, Qe as ensureManagedAccountEasConfigured, mt as ensurePublishAuthorizationSchema, ur as ensurePublishedBySchema, ye as ensureWalletThenPublish, Te as estimatePublishCost, Wn as fingerprintFromRegistrySnapshot, U as fromEip1193Provider, ne as fromEthersWallet, ln as fromWindowEthereum, Ye as getArweave, Bn as getArweaveTransactionIds, ue as getCachedMarketRates, nt as getCachedTokenPrices, gn as getDisplayStepId, X as getDomainOwnershipSchemaUid, qt as getEasChainDeployment, Vn as getEasPayload, ot as getPublishAuthorizationSchemaUid, Ke as getPublishChainName, x as getPublishConfig, vn as getPublishMachineValueForUi, ie as getPublishPublicClient, o as getPublishWallet, $ as getPublishedBySchemaUid, ke as getTurboBalanceWinc, pe as getTurboPriceWinc, Xt as hashPublishedByBatch, te as heuristicPublishGas, S as initPublish, oe as isContractDeployed, ee as isEip7702ModularAccountPublishError, e as isManagedAccountPublishError, i as isPublishWallet, Se as isRouterNonModularCoreAccountError, $e as isSeedSigner, b as isSeedTxSender, K as lookupDomainRegistry, G as normalizeRegistrableDomain, Me as publishItem, Fe as publishMachine, it as readFactorySeedExecutor, n as readGetEas, ae as readIsActiveSigner, Ue as requireManagedAccountFactoryAddress, Xe as resetMarketRateCache, me as resetTokenPriceCache, _n as resolvePublishDisplayValue, ge as resolvePublishEasChain, fe as resolvePublishPayment, Re as resolvePublishSender, ir as revokeDomainOwnership, ut as revokePublishAuthorization, pr as revokePublishedBy, on as seedTwinConfig, _ as setPublishWallet, v as simulateCallFromAccount, qe as stringifyUnderlyingCause, _t as uidsFromAttestationPairs, Sn as useArweaveL1Finalize, xn as useCanPublishItem, Cn as useItemPublishStatus, st as usePublishConfig, Hn as usePublishCostEstimate, bn as usePublishProcess, Mn as usePublishProcessById, Dn as usePublishProcesses, kn as usePublishProcessesForSeed, On as usePublishProcessesNonActiveCount, jn as usePublishProcessesNonActiveCountForSeed, En as usePublishProcessesState, An as usePublishProcessesStateForSeed, un as useSeedWallet, or as verifyAndAttestDomainOwnership, Pe as verifyDataItem, ar as verifyDomainOwnershipChallenge, Qn as verifyDomainOwnershipDns, we as verifyPublishChain, Je as waitForPublishActor, w as waitForPublishReceipt, hn as watchPublishCost };
1008
+ export { d as AttestationVerificationError, De as DEFAULT_PUBLISH_CHAIN, e as DEFAULT_TURBO_PAYMENT_URL, Se as DEFAULT_TURBO_UPLOAD_URL, Mt as DOMAIN_OWNERSHIP_METHOD, Pt as DOMAIN_OWNERSHIP_SCHEMA_DEF, Ft as DOMAIN_OWNERSHIP_SCHEMA_NAME, Rt as EAS_CHAIN_DEPLOYMENTS, m as Eip7702ModularAccountPublishError, Oe as InsufficientStorageCreditsError, pe as MANAGED_ACCOUNT_FACTORY_ADDRESSES, Re as MULTI_PUBLISH_ABI_REFERENCE_ADDRESS_OP_SEPOLIA, He as ManagedAccountPublishError, zt as PUBLISHED_BY_SCHEMA_DEF, Bt as PUBLISHED_BY_SCHEMA_NAME, Ke as PUBLISH_AUTHORIZATION_HEADER, gt as PUBLISH_AUTHORIZATION_SCHEMA_DEF, ft as PUBLISH_AUTHORIZATION_SCHEMA_NAME, mt as PUBLISH_AUTHORIZATION_SCOPES, ie as PUBLISH_GAS_HEURISTICS, Ce as PublishChainConfigError, Pe as PublishManager, cn as PublishModeButtons, ye as PublishNotAuthorizedError, Je as PublishPaymentConfigError, ln as PublishProvider, p as PublishTransactionRevertedError, ve as SEED_PROTOCOL_CONTRACT_ADDRESS_OP_SEPOLIA, en as SeedProvider, Qe as asPublishWallet, rt as asSeedSigner, ge as asSeedTxSender, ee as assertExecutorModuleReadyForAccount, $e as assertManagedAccountEasMatchesConfig, cr as assessDomainOwnershipLive, ut as assessPublishAuthorizationLive, ir as attestDomainOwnership, ot as attestPublishAuthorization, pr as attestPublishedBy, Ne as buildPublishAnchorBytes, In as clearAllPublishProcesses, Ln as clearAllUploadProcesses, Pn as clearCompletedPublishProcesses, Fn as clearCompletedPublishProcessesForSeed, at as clearPublishWallet, _t as collectPublishedBatch, we as combinePublishCostEstimate, Ue as configurePublish, Jn as createDomainOwnershipChallenge, Be as createPermissionlessTxSender, zn as deletePublishProcessById, Bn as deletePublishProcessesByIds, Rn as deletePublishProcessesForSeed, nr as encodeDomainOwnershipAttestationData, ke as encodeEasAttest, g as encodeEasMultiAttest, _ as encodeEasMultiRevoke, te as encodeMultiPublish, pt as encodePublishAuthorizationAttestationData, fr as encodePublishedByAttestationData, u as encodeSetEas, tr as ensureDomainOwnershipSchema, s as ensureEasSchemasForItem, oe as ensureManagedAccountEasConfigured, ht as ensurePublishAuthorizationSchema, dr as ensurePublishedBySchema, be as ensureWalletThenPublish, fe as estimatePublishCost, Gn as fingerprintFromRegistrySnapshot, U as fromEip1193Provider, i as fromEthersWallet, un as fromWindowEthereum, xe as getArweave, Vn as getArweaveTransactionIds, Ze as getCachedMarketRates, he as getCachedTokenPrices, _n as getDisplayStepId, X as getDomainOwnershipSchemaUid, qt as getEasChainDeployment, Hn as getEasPayload, st as getPublishAuthorizationSchemaUid, qe as getPublishChainName, x as getPublishConfig, yn as getPublishMachineValueForUi, n as getPublishPublicClient, w as getPublishWallet, $ as getPublishedBySchemaUid, me as getTurboBalanceWinc, ze as getTurboPriceWinc, Xt as hashPublishedByBatch, r as heuristicPublishGas, Le as initPublish, ce as isContractDeployed, ue as isEip7702ModularAccountPublishError, le as isManagedAccountPublishError, C as isPublishWallet, de as isRouterNonModularCoreAccountError, se as isSeedSigner, c as isSeedTxSender, K as lookupDomainRegistry, G as normalizeRegistrableDomain, Me as publishItem, Te as publishMachine, f as readFactorySeedExecutor, h as readGetEas, re as readIsActiveSigner, Ge as requireManagedAccountFactoryAddress, nt as resetMarketRateCache, et as resetTokenPriceCache, vn as resolvePublishDisplayValue, _e as resolvePublishEasChain, Ie as resolvePublishPayment, We as resolvePublishSender, ar as revokeDomainOwnership, dt as revokePublishAuthorization, mr as revokePublishedBy, sn as seedTwinConfig, it as setPublishWallet, l as simulateCallFromAccount, ne as stringifyUnderlyingCause, vt as uidsFromAttestationPairs, Cn as useArweaveL1Finalize, Sn as useCanPublishItem, wn as useItemPublishStatus, ct as usePublishConfig, Un as usePublishCostEstimate, xn as usePublishProcess, Nn as usePublishProcessById, On as usePublishProcesses, An as usePublishProcessesForSeed, kn as usePublishProcessesNonActiveCount, Mn as usePublishProcessesNonActiveCountForSeed, Dn as usePublishProcessesState, jn as usePublishProcessesStateForSeed, dn as useSeedWallet, sr as verifyAndAttestDomainOwnership, Xe as verifyDataItem, or as verifyDomainOwnershipChallenge, $n as verifyDomainOwnershipDns, Ve as verifyPublishChain, Ye as waitForPublishActor, b as waitForPublishReceipt, gn as watchPublishCost };
995
1009
 
996
1010
  //# sourceMappingURL=index.js.map