@seedprotocol/eas 0.7.7 → 0.7.8-next.1066.gac32194

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.
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
- import { S as e, _ as t, a as n, b as r, c as i, d as a, f as o, g as s, h as c, i as l, l as u, m as ee, n as te, o as ne, p as re, r as ie, s as ae, t as oe, u as se, v as d, x as ce, y as f } from "./QueryClient-BpCm3D1u.js";
2
- import { keccak_256 as le } from "@noble/hashes/sha3";
3
- import { bytesToHex as ue, utf8ToBytes as de } from "@noble/hashes/utils";
1
+ import { C as e, S as t, _ as n, a as r, b as i, c as a, d as o, f as s, g as c, h as l, i as u, l as d, m as ee, n as te, o as ne, p as re, r as ie, s as f, t as ae, u as oe, v as se, w as ce, x as p, y as le } from "./QueryClient-Ns40c8jS.js";
2
+ import { keccak_256 as ue } from "@noble/hashes/sha3";
3
+ import { bytesToHex as de, utf8ToBytes as fe } from "@noble/hashes/utils";
4
4
  //#region src/keccak.ts
5
- function p(e) {
6
- let t = typeof e == "string" ? de(e) : e;
7
- return ue(le(t));
5
+ function m(e) {
6
+ let t = typeof e == "string" ? fe(e) : e;
7
+ return de(ue(t));
8
8
  }
9
9
  //#endregion
10
10
  //#region src/utils.ts
11
- var m = (e) => e.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
12
- function h(e) {
11
+ var h = (e) => e.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
12
+ function g(e) {
13
13
  let t = e.toLowerCase().replace(/^0x/, "");
14
14
  if (t.length !== 40 || !/^[0-9a-f]+$/.test(t)) return e;
15
- let n = p(t), r = "0x";
15
+ let n = m(t), r = "0x";
16
16
  for (let e = 0; e < 40; e++) r += parseInt(n[e], 16) >= 8 ? t[e].toUpperCase() : t[e];
17
17
  return r;
18
18
  }
19
19
  //#endregion
20
20
  //#region src/easPropertyCanonical.ts
21
- var fe = (e) => {
21
+ var pe = (e) => {
22
22
  let t = /* @__PURE__ */ new Map();
23
23
  for (let n of e) {
24
24
  let e = n.schemaId;
@@ -28,16 +28,16 @@ var fe = (e) => {
28
28
  }
29
29
  return t;
30
30
  };
31
- function g(e, t) {
32
- let n = fe(e.filter((e) => !e.revoked));
31
+ function _(e, t) {
32
+ let n = pe(e.filter((e) => !e.revoked));
33
33
  if (t?.ifAllRevoked !== "newestRevoked") return [...n.values()];
34
- let r = fe(e.filter((e) => e.revoked));
34
+ let r = pe(e.filter((e) => e.revoked));
35
35
  for (let [e, t] of r) n.has(e) || n.set(e, t);
36
36
  return [...n.values()];
37
37
  }
38
38
  //#endregion
39
39
  //#region src/easRefAttester.ts
40
- function _(e, t) {
40
+ function me(e, t) {
41
41
  let n = /* @__PURE__ */ new Map();
42
42
  for (let e of t) e.attester && n.set(e.id, e.attester.toLowerCase());
43
43
  let r = [], i = [];
@@ -51,7 +51,7 @@ function _(e, t) {
51
51
  };
52
52
  }
53
53
  function v(e, t) {
54
- return _(e, t).kept;
54
+ return me(e, t).kept;
55
55
  }
56
56
  //#endregion
57
57
  //#region src/easRevokedFilter.ts
@@ -64,7 +64,7 @@ function y(e) {
64
64
  }
65
65
  //#endregion
66
66
  //#region src/graphql/gql/gql.ts
67
- var pe = {
67
+ var he = {
68
68
  "\n fragment attestationFields on Attestation {\n id\n decodedDataJson\n attester\n refUID\n revoked\n revocationTime\n schemaId\n txid\n timeCreated\n time\n isOffchain\n }\n": {
69
69
  kind: "Document",
70
70
  definitions: [{
@@ -2470,62 +2470,62 @@ var pe = {
2470
2470
  }
2471
2471
  };
2472
2472
  function b(e) {
2473
- return pe[e] ?? {};
2473
+ return he[e] ?? {};
2474
2474
  }
2475
2475
  //#endregion
2476
2476
  //#region src/queries.ts
2477
- var x = b("\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), me = b("\n query GetSchemaByName($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), S = b("\n query GetSeeds($where: AttestationWhereInput!, $take: Int, $skip: Int) {\n itemSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }], take: $take, skip: $skip) {\n id\n decodedDataJson\n attester\n schema {\n schemaNames {\n name\n }\n }\n refUID\n revoked\n revocationTime\n schemaId\n timeCreated\n isOffchain\n }\n }\n"), C = b("\n query GetSeedsLean($where: AttestationWhereInput!, $take: Int, $skip: Int) {\n itemSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }], take: $take, skip: $skip) {\n id\n decodedDataJson\n attester\n refUID\n revoked\n revocationTime\n schemaId\n timeCreated\n isOffchain\n }\n }\n"), he = b("\n query GetDomainOwnerships($where: AttestationWhereInput!) {\n domainOwnerships: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n decodedDataJson\n attester\n recipient\n refUID\n revoked\n revocationTime\n expirationTime\n schemaId\n timeCreated\n }\n }\n"), ge = b("\n query GetSeedIds($where: AttestationWhereInput!) {\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n }\n }\n"), _e = b("\n query GetStorageTransactionId($where: AttestationWhereInput!) {\n storageTransactionId: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n id\n decodedDataJson\n }\n }\n"), w = b("\n query GetVersions($where: AttestationWhereInput!) {\n itemVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), ve = b("\n query GetProperties($where: AttestationWhereInput!) {\n itemProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), ye = b("\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\n allProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), be = b("\n query GetFilesMetadata($where: AttestationWhereInput!) {\n filesMetadata: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), xe = b("\n query GetImageSeeds($where: AttestationWhereInput!) {\n imageSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n decodedDataJson\n attester\n schema {\n schemaNames {\n name\n }\n }\n refUID\n revoked\n schemaId\n txid\n timeCreated\n time\n isOffchain\n }\n }\n"), Se = b("\n query GetImageVersions($where: AttestationWhereInput!) {\n imageVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), Ce = b("\n query GetAttestationChanges($where: AttestationWhereInput!) {\n changes: attestations(where: $where) {\n id\n refUID\n timeCreated\n revocationTime\n }\n }\n"), we = async ({ seedUids: e, excludeRevoked: t = !0 }) => {
2478
- let n = d.getQueryClient(), r = f.getEasClient(), i = t ? y({ refUID: { in: e } }) : { refUID: { in: e } }, { itemVersions: a } = await n.fetchQuery({
2477
+ var x = b("\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), ge = b("\n query GetSchemaByName($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), S = b("\n query GetSeeds($where: AttestationWhereInput!, $take: Int, $skip: Int) {\n itemSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }], take: $take, skip: $skip) {\n id\n decodedDataJson\n attester\n schema {\n schemaNames {\n name\n }\n }\n refUID\n revoked\n revocationTime\n schemaId\n timeCreated\n isOffchain\n }\n }\n"), C = b("\n query GetSeedsLean($where: AttestationWhereInput!, $take: Int, $skip: Int) {\n itemSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }], take: $take, skip: $skip) {\n id\n decodedDataJson\n attester\n refUID\n revoked\n revocationTime\n schemaId\n timeCreated\n isOffchain\n }\n }\n"), _e = b("\n query GetDomainOwnerships($where: AttestationWhereInput!) {\n domainOwnerships: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n decodedDataJson\n attester\n recipient\n refUID\n revoked\n revocationTime\n expirationTime\n schemaId\n timeCreated\n }\n }\n"), ve = b("\n query GetSeedIds($where: AttestationWhereInput!) {\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n }\n }\n"), ye = b("\n query GetStorageTransactionId($where: AttestationWhereInput!) {\n storageTransactionId: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n id\n decodedDataJson\n }\n }\n"), w = b("\n query GetVersions($where: AttestationWhereInput!) {\n itemVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), be = b("\n query GetProperties($where: AttestationWhereInput!) {\n itemProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), xe = b("\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\n allProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), Se = b("\n query GetFilesMetadata($where: AttestationWhereInput!) {\n filesMetadata: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), Ce = b("\n query GetImageSeeds($where: AttestationWhereInput!) {\n imageSeeds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n decodedDataJson\n attester\n schema {\n schemaNames {\n name\n }\n }\n refUID\n revoked\n schemaId\n txid\n timeCreated\n time\n isOffchain\n }\n }\n"), we = b("\n query GetImageVersions($where: AttestationWhereInput!) {\n imageVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), Te = b("\n query GetAttestationChanges($where: AttestationWhereInput!) {\n changes: attestations(where: $where) {\n id\n refUID\n timeCreated\n revocationTime\n }\n }\n"), Ee = async ({ seedUids: e, excludeRevoked: t = !0 }) => {
2478
+ let n = i.getQueryClient(), r = p.getEasClient(), a = t ? y({ refUID: { in: e } }) : { refUID: { in: e } }, { itemVersions: o } = await n.fetchQuery({
2479
2479
  queryKey: [
2480
2480
  "getVersionsForAllModels",
2481
2481
  [...e].sort(),
2482
2482
  t
2483
2483
  ],
2484
- queryFn: async () => r.request(w, { where: i })
2484
+ queryFn: async () => r.request(w, { where: a })
2485
2485
  });
2486
- return a;
2486
+ return o;
2487
2487
  }, T = async ({ versionUids: e, excludeRevoked: t = !0 }) => {
2488
- let n = d.getQueryClient(), r = f.getEasClient(), i = t ? y({ refUID: { in: e } }) : { refUID: { in: e } }, { itemProperties: a } = await n.fetchQuery({
2488
+ let n = i.getQueryClient(), r = p.getEasClient(), a = t ? y({ refUID: { in: e } }) : { refUID: { in: e } }, { itemProperties: o } = await n.fetchQuery({
2489
2489
  queryKey: [
2490
2490
  "getPropertiesForAllModels",
2491
2491
  [...e].sort(),
2492
2492
  t
2493
2493
  ],
2494
- queryFn: async () => r.request(ve, { where: i })
2494
+ queryFn: async () => r.request(be, { where: a })
2495
2495
  });
2496
- return a;
2497
- }, Te = async ({ versionUids: e, excludeRevoked: t, checkAttesters: n = !0 }) => {
2496
+ return o;
2497
+ }, De = async ({ versionUids: e, excludeRevoked: t, checkAttesters: n = !0 }) => {
2498
2498
  let r = await T({
2499
2499
  versionUids: e,
2500
2500
  excludeRevoked: t
2501
2501
  });
2502
- if (!n || r.length === 0) return g(r);
2503
- let i = f.getEasClient(), { itemVersions: a } = await i.request(w, { where: { id: { in: [...new Set(r.map((e) => e.refUID))] } } }), o = [...new Set(a.map((e) => e.refUID))], { itemSeeds: s } = await i.request(C, {
2502
+ if (!n || r.length === 0) return _(r);
2503
+ let i = p.getEasClient(), { itemVersions: a } = await i.request(w, { where: { id: { in: [...new Set(r.map((e) => e.refUID))] } } }), o = [...new Set(a.map((e) => e.refUID))], { itemSeeds: s } = await i.request(C, {
2504
2504
  where: { id: { in: o } },
2505
2505
  take: o.length,
2506
2506
  skip: 0
2507
2507
  }), c = new Set(s.map((e) => e.id)), l = v(a.filter((e) => c.has(e.refUID)), s), u = new Set(l.map((e) => e.id));
2508
- return g(v(r.filter((e) => u.has(e.refUID)), l));
2508
+ return _(v(r.filter((e) => u.has(e.refUID)), l));
2509
2509
  }, E = async ({ schemaName: e }) => {
2510
- let t = d.getQueryClient(), n = f.getEasClient();
2510
+ let t = i.getQueryClient(), n = p.getEasClient();
2511
2511
  if (!t || !n) return;
2512
2512
  let { schemas: r } = await t.fetchQuery({
2513
2513
  queryKey: ["getEasSchemaUidBySchemaName", e],
2514
2514
  queryFn: async () => n.request(x, { where: { schema: { endsWith: e } } })
2515
2515
  });
2516
2516
  if (r && r.length !== 0) return r[0].id;
2517
- }, Ee = async ({ schemaName: e }) => {
2517
+ }, Oe = async ({ schemaName: e }) => {
2518
2518
  try {
2519
2519
  return await E({ schemaName: e });
2520
2520
  } catch (t) {
2521
2521
  process.env.NODE_ENV === "development" && console.warn(`Failed to fetch schema for schema name ${e}:`, t);
2522
2522
  return;
2523
2523
  }
2524
- }, De = async ({ schemaUids: e, addresses: t, excludeRevoked: n = !0 }) => {
2524
+ }, ke = async ({ schemaUids: e, addresses: t, excludeRevoked: n = !0 }) => {
2525
2525
  let r = {
2526
2526
  attester: { in: t.map((e) => {
2527
2527
  try {
2528
- return h(e);
2528
+ return g(e);
2529
2529
  } catch {
2530
2530
  return e;
2531
2531
  }
@@ -2533,94 +2533,94 @@ var x = b("\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schem
2533
2533
  schemaId: { in: e }
2534
2534
  };
2535
2535
  n && (r = y(r));
2536
- let i = d.getQueryClient(), a = f.getEasClient(), { itemSeeds: o } = await i.fetchQuery({
2536
+ let a = i.getQueryClient(), o = p.getEasClient(), { itemSeeds: s } = await a.fetchQuery({
2537
2537
  queryKey: [
2538
2538
  "getSeedsForAllModels",
2539
2539
  n,
2540
2540
  [...e].sort(),
2541
2541
  [...t].sort()
2542
2542
  ],
2543
- queryFn: async () => a.request(S, { where: r })
2543
+ queryFn: async () => o.request(S, { where: r })
2544
2544
  });
2545
- return o;
2546
- }, Oe = async (e, t = 10, n, r) => {
2547
- let i = n ?? 0, a = r?.uidPrefix, o = {
2545
+ return s;
2546
+ }, D = async (e, t = 10, n, r) => {
2547
+ let a = n ?? 0, o = r?.uidPrefix, s = {
2548
2548
  where: y({
2549
- ...a === void 0 ? {} : { id: { startsWith: a } },
2549
+ ...o === void 0 ? {} : { id: { startsWith: o } },
2550
2550
  schema: { is: { schemaNames: { some: { name: { equals: e } } } } }
2551
2551
  }),
2552
2552
  take: t,
2553
- skip: i
2554
- }, s = d.getQueryClient(), c = f.getEasClient(), { itemSeeds: l } = await s.fetchQuery({
2553
+ skip: a
2554
+ }, c = i.getQueryClient(), l = p.getEasClient(), { itemSeeds: u } = await c.fetchQuery({
2555
2555
  queryKey: [
2556
2556
  "getSeedsBySchemaName",
2557
2557
  e,
2558
2558
  t,
2559
- i,
2560
- a ?? null
2559
+ a,
2560
+ o ?? null
2561
2561
  ],
2562
- queryFn: async () => c.request(C, o)
2562
+ queryFn: async () => l.request(C, s)
2563
2563
  });
2564
- return l.map((t) => ke(t, [e]));
2565
- }, ke = (e, t) => ({
2564
+ return u.map((t) => O(t, [e]));
2565
+ }, O = (e, t) => ({
2566
2566
  ...e,
2567
2567
  schema: { schemaNames: t.map((e) => ({ name: e })) }
2568
- }), D = /* @__PURE__ */ new Map(), Ae = (e) => {
2568
+ }), k = /* @__PURE__ */ new Map(), Ae = (e) => {
2569
2569
  let t = "";
2570
2570
  try {
2571
- t = n();
2571
+ t = f();
2572
2572
  } catch {}
2573
2573
  return `${t}\n${e.toLowerCase()}`;
2574
2574
  }, je = () => {
2575
- D.clear();
2575
+ k.clear();
2576
2576
  }, Me = async (e) => {
2577
2577
  let t = /* @__PURE__ */ new Map(), n = [];
2578
2578
  for (let r of new Set(e)) {
2579
- let e = D.get(Ae(r));
2579
+ let e = k.get(Ae(r));
2580
2580
  e ? t.set(r, e) : n.push(r);
2581
2581
  }
2582
2582
  if (n.length === 0) return t;
2583
- let r = d.getQueryClient(), i = f.getEasClient(), { schemas: a } = await r.fetchQuery({
2583
+ let r = i.getQueryClient(), a = p.getEasClient(), { schemas: o } = await r.fetchQuery({
2584
2584
  queryKey: ["getSchemaNamesBySchemaUids", [...n].sort()],
2585
- queryFn: async () => i.request(x, { where: { id: { in: n } } })
2586
- }), o = new Map(n.map((e) => [e.toLowerCase(), e]));
2587
- for (let e of a ?? []) {
2588
- let n = (e.schemaNames ?? []).map((e) => e.name), r = o.get(e.id.toLowerCase());
2589
- r && n.length !== 0 && (D.set(Ae(r), n), t.set(r, n));
2585
+ queryFn: async () => a.request(x, { where: { id: { in: n } } })
2586
+ }), s = new Map(n.map((e) => [e.toLowerCase(), e]));
2587
+ for (let e of o ?? []) {
2588
+ let n = (e.schemaNames ?? []).map((e) => e.name), r = s.get(e.id.toLowerCase());
2589
+ r && n.length !== 0 && (k.set(Ae(r), n), t.set(r, n));
2590
2590
  }
2591
2591
  return t;
2592
2592
  }, Ne = async ({ uids: e, excludeRevoked: t = !0 }) => {
2593
2593
  if (e.length === 0) return [];
2594
- let n = t ? y({ id: { in: e } }) : { id: { in: e } }, r = d.getQueryClient(), i = f.getEasClient(), { itemSeeds: a } = await r.fetchQuery({
2594
+ let n = t ? y({ id: { in: e } }) : { id: { in: e } }, r = i.getQueryClient(), a = p.getEasClient(), { itemSeeds: o } = await r.fetchQuery({
2595
2595
  queryKey: [
2596
2596
  "getSeedsByUidsFromEas",
2597
2597
  [...e].sort(),
2598
2598
  t
2599
2599
  ],
2600
- queryFn: async () => i.request(C, {
2600
+ queryFn: async () => a.request(C, {
2601
2601
  where: n,
2602
2602
  take: e.length,
2603
2603
  skip: 0
2604
2604
  })
2605
- }), o = a ?? [], s = await Me(o.map((e) => e.schemaId));
2606
- return o.map((e) => ke(e, s.get(e.schemaId) ?? []));
2605
+ }), s = o ?? [], c = await Me(s.map((e) => e.schemaId));
2606
+ return s.map((e) => O(e, c.get(e.schemaId) ?? []));
2607
2607
  }, Pe = 400, Fe = async ({ refUIDs: e, ids: t, since: n }) => {
2608
- let r = { OR: [{ timeCreated: { gt: n } }, { revocationTime: { gt: n } }] }, i = [], a = (e, t) => {
2608
+ let r = { OR: [{ timeCreated: { gt: n } }, { revocationTime: { gt: n } }] }, a = [], o = (e, t) => {
2609
2609
  let n = [...new Set(t)].sort();
2610
- for (let t = 0; t < n.length; t += Pe) i.push({ [e]: { in: n.slice(t, t + Pe) } });
2610
+ for (let t = 0; t < n.length; t += Pe) a.push({ [e]: { in: n.slice(t, t + Pe) } });
2611
2611
  };
2612
- if (a("refUID", e), a("id", t), i.length === 0) return [];
2613
- let o = d.getQueryClient(), s = f.getEasClient(), c = await Promise.all(i.map((e) => o.fetchQuery({
2612
+ if (o("refUID", e), o("id", t), a.length === 0) return [];
2613
+ let s = i.getQueryClient(), c = p.getEasClient(), l = await Promise.all(a.map((e) => s.fetchQuery({
2614
2614
  queryKey: [
2615
2615
  "getAttestationChangesSince",
2616
2616
  e,
2617
2617
  n
2618
2618
  ],
2619
- queryFn: async () => s.request(Ce, { where: { AND: [e, r] } })
2620
- }))), l = /* @__PURE__ */ new Map();
2621
- for (let { changes: e } of c) for (let t of e ?? []) l.set(t.id, t);
2622
- return [...l.values()];
2623
- }, Ie = async (e, t = 10) => (await Oe(e, t)).map((e) => e.id), Le = "0x0000000000000000000000000000000000000000", Re = "0x", ze = "0x0000000000000000000000000000000000000000000000000000000000000000", Be = typeof process < "u" && process.env?.NEXT_PUBLIC_EAS_ENDPOINT || typeof process < "u" && process.env?.EAS_ENDPOINT || "https://optimism-sepolia.easscan.org/graphql";
2619
+ queryFn: async () => c.request(Te, { where: { AND: [e, r] } })
2620
+ }))), u = /* @__PURE__ */ new Map();
2621
+ for (let { changes: e } of l) for (let t of e ?? []) u.set(t.id, t);
2622
+ return [...u.values()];
2623
+ }, Ie = async (e, t = 10) => (await D(e, t)).map((e) => e.id), Le = "0x0000000000000000000000000000000000000000", Re = "0x", ze = "0x0000000000000000000000000000000000000000000000000000000000000000", Be = typeof process < "u" && process.env?.NEXT_PUBLIC_EAS_ENDPOINT || typeof process < "u" && process.env?.EAS_ENDPOINT || "https://optimism-sepolia.easscan.org/graphql";
2624
2624
  //#endregion
2625
2625
  //#region src/easUid.ts
2626
2626
  function Ve(e) {
@@ -2635,7 +2635,7 @@ function He(e) {
2635
2635
  let n = t.slice(2);
2636
2636
  return n.length === 64 && /^[0-9a-fA-F]{64}$/.test(n);
2637
2637
  }
2638
- function O(e) {
2638
+ function A(e) {
2639
2639
  if (e == null || e === "") return "";
2640
2640
  let t = String(e).trim();
2641
2641
  return ("0x" + (t.startsWith("0x") || t.startsWith("0X") ? t.slice(2) : t).replace(/[^0-9a-fA-F]/g, "0").padStart(64, "0").slice(-64)).toLowerCase();
@@ -2646,22 +2646,22 @@ var Ue = "string domain,address claimer,string method,bytes32 challengeHash,uint
2646
2646
  function Qe(e) {
2647
2647
  return new TextEncoder().encode(e);
2648
2648
  }
2649
- function k(e) {
2649
+ function j(e) {
2650
2650
  return e.trim().toLowerCase().replace(/\.$/, "");
2651
2651
  }
2652
- function A(e) {
2652
+ function M(e) {
2653
2653
  let t = e.trim();
2654
2654
  try {
2655
- return h(t).toLowerCase();
2655
+ return g(t).toLowerCase();
2656
2656
  } catch {
2657
2657
  return t.toLowerCase();
2658
2658
  }
2659
2659
  }
2660
2660
  function $e(e) {
2661
- return `${Je}.${k(e)}`;
2661
+ return `${Je}.${j(e)}`;
2662
2662
  }
2663
2663
  function et(e) {
2664
- let t = A(e.claimer);
2664
+ let t = M(e.claimer);
2665
2665
  return `token=${e.token},addr=${t},expiry=${e.expiry}`;
2666
2666
  }
2667
2667
  function tt(e) {
@@ -2675,59 +2675,59 @@ function tt(e) {
2675
2675
  let r = n.get("token"), i = n.get("addr") ?? n.get("claimer"), a = n.get("expiry");
2676
2676
  return !r || !i || !a ? null : {
2677
2677
  token: r,
2678
- claimer: A(i),
2678
+ claimer: M(i),
2679
2679
  expiry: a
2680
2680
  };
2681
2681
  }
2682
2682
  function nt(e) {
2683
- let t = k(e.domain), n = A(e.claimer), r = (e.scope ?? "registrable").trim();
2684
- return "0x" + p(Qe(`${t}|${n}|${e.token}|${r}`));
2683
+ let t = j(e.domain), n = M(e.claimer), r = (e.scope ?? "registrable").trim();
2684
+ return "0x" + m(Qe(`${t}|${n}|${e.token}|${r}`));
2685
2685
  }
2686
- function j(e) {
2686
+ function rt(e) {
2687
2687
  let t = {
2688
- domain: k(e.domain),
2688
+ domain: j(e.domain),
2689
2689
  creationDate: (e.creationDate ?? "").trim(),
2690
2690
  registrarIanaId: (e.registrarIanaId ?? "").trim()
2691
2691
  };
2692
- return "0x" + p(Qe(JSON.stringify(t)));
2693
- }
2694
- function M(e) {
2695
- return typeof e == "string" ? O(e) : e && typeof e == "object" && "hex" in e ? O(String(e.hex)) : e && typeof e == "object" && "value" in e ? M(e.value) : O(String(e ?? ""));
2692
+ return "0x" + m(Qe(JSON.stringify(t)));
2696
2693
  }
2697
2694
  function N(e) {
2695
+ return typeof e == "string" ? A(e) : e && typeof e == "object" && "hex" in e ? A(String(e.hex)) : e && typeof e == "object" && "value" in e ? N(e.value) : A(String(e ?? ""));
2696
+ }
2697
+ function P(e) {
2698
2698
  return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
2699
2699
  }
2700
- function rt(e) {
2700
+ function it(e) {
2701
2701
  if (typeof e == "number" && Number.isFinite(e)) return Math.trunc(e);
2702
2702
  if (typeof e == "bigint") return Number(e);
2703
2703
  if (typeof e == "string" && e.trim() !== "") {
2704
2704
  let t = Number(e);
2705
2705
  return Number.isFinite(t) ? Math.trunc(t) : 0;
2706
2706
  }
2707
- return e && typeof e == "object" && "value" in e ? rt(e.value) : 0;
2707
+ return e && typeof e == "object" && "value" in e ? it(e.value) : 0;
2708
2708
  }
2709
- function it(e) {
2709
+ function at(e) {
2710
2710
  let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
2711
2711
  for (let e of t) e?.name && n.set(e.name, e);
2712
2712
  return {
2713
- domain: k(N(n.get("domain")?.value)),
2714
- claimer: A(N(n.get("claimer")?.value)),
2715
- method: N(n.get("method")?.value),
2716
- challengeHash: M(n.get("challengeHash")?.value),
2717
- verifiedAt: rt(n.get("verifiedAt")?.value),
2718
- registryCreationDate: N(n.get("registryCreationDate")?.value),
2719
- registryExpirationDate: N(n.get("registryExpirationDate")?.value),
2720
- registryFingerprint: M(n.get("registryFingerprint")?.value),
2721
- scope: N(n.get("scope")?.value)
2713
+ domain: j(P(n.get("domain")?.value)),
2714
+ claimer: M(P(n.get("claimer")?.value)),
2715
+ method: P(n.get("method")?.value),
2716
+ challengeHash: N(n.get("challengeHash")?.value),
2717
+ verifiedAt: it(n.get("verifiedAt")?.value),
2718
+ registryCreationDate: P(n.get("registryCreationDate")?.value),
2719
+ registryExpirationDate: P(n.get("registryExpirationDate")?.value),
2720
+ registryFingerprint: N(n.get("registryFingerprint")?.value),
2721
+ scope: P(n.get("scope")?.value)
2722
2722
  };
2723
2723
  }
2724
- function at(e) {
2724
+ function ot(e) {
2725
2725
  if (!e?.trim()) return null;
2726
2726
  let t = Date.parse(e);
2727
2727
  return Number.isFinite(t) ? Math.floor(t / 1e3) : null;
2728
2728
  }
2729
- function ot(e) {
2730
- let t = Math.floor((e.now ?? Date.now()) / 1e3), n = [], r = e.softStaleMs ?? 31536e6, i = e.expirationTime, a = at(e.decoded.registryExpirationDate);
2729
+ function st(e) {
2730
+ let t = Math.floor((e.now ?? Date.now()) / 1e3), n = [], r = e.softStaleMs ?? 31536e6, i = e.expirationTime, a = ot(e.decoded.registryExpirationDate);
2731
2731
  if (typeof i == "number" && i > 0 && t >= i || a != null && t >= a) return {
2732
2732
  status: "expired",
2733
2733
  warnings: n
@@ -2736,11 +2736,11 @@ function ot(e) {
2736
2736
  status: "unknown",
2737
2737
  warnings: n
2738
2738
  };
2739
- if (e.registrySnapshot !== void 0) return O(j({
2739
+ if (e.registrySnapshot !== void 0) return A(rt({
2740
2740
  domain: e.decoded.domain,
2741
2741
  creationDate: e.registrySnapshot.creationDate,
2742
2742
  registrarIanaId: e.registrySnapshot.registrarIanaId
2743
- })) === O(e.decoded.registryFingerprint) ? {
2743
+ })) === A(e.decoded.registryFingerprint) ? {
2744
2744
  status: "valid",
2745
2745
  warnings: n
2746
2746
  } : (n.push("Registry creation date or registrar IANA id no longer matches attestation fingerprint"), {
@@ -2758,42 +2758,42 @@ function ot(e) {
2758
2758
  }
2759
2759
  //#endregion
2760
2760
  //#region src/domainOwnership.ts
2761
- function P(e) {
2761
+ function ct(e) {
2762
2762
  return e.trim().toLowerCase().replace(/\.$/, "");
2763
2763
  }
2764
- async function st(e) {
2765
- let { toolAddresses: t, domains: n, claimers: r, schemaUid: i, excludeRevoked: a = !0 } = e;
2764
+ async function lt(e) {
2765
+ let { toolAddresses: t, domains: n, claimers: r, schemaUid: a, excludeRevoked: o = !0 } = e;
2766
2766
  if (!t.length) return [];
2767
- let o = t.map((e) => {
2767
+ let s = t.map((e) => {
2768
2768
  try {
2769
- return h(e);
2769
+ return g(e);
2770
2770
  } catch {
2771
2771
  return e;
2772
2772
  }
2773
- }), s = { attester: { in: o } };
2774
- i ? s.schemaId = { equals: i } : s.schema = { is: { schemaNames: { some: { name: { equals: We } } } } }, r?.length && (s.recipient = { in: r.map((e) => {
2773
+ }), c = { attester: { in: s } };
2774
+ a ? c.schemaId = { equals: a } : c.schema = { is: { schemaNames: { some: { name: { equals: We } } } } }, r?.length && (c.recipient = { in: r.map((e) => {
2775
2775
  try {
2776
- return h(e);
2776
+ return g(e);
2777
2777
  } catch {
2778
2778
  return e;
2779
2779
  }
2780
- }) }), a && (s = y(s));
2781
- let c = d.getQueryClient(), l = f.getEasClient(), { domainOwnerships: u } = await c.fetchQuery({
2780
+ }) }), o && (c = y(c));
2781
+ let l = i.getQueryClient(), u = p.getEasClient(), { domainOwnerships: d } = await l.fetchQuery({
2782
2782
  queryKey: [
2783
2783
  "getDomainOwnershipFromEas",
2784
- a,
2785
- i ?? "seedprotocol.domainOwnership",
2786
- [...o].sort(),
2787
- [...(n ?? []).map(P)].sort(),
2784
+ o,
2785
+ a ?? "seedprotocol.domainOwnership",
2786
+ [...s].sort(),
2787
+ [...(n ?? []).map(ct)].sort(),
2788
2788
  [...r ?? []].map((e) => e.toLowerCase()).sort()
2789
2789
  ],
2790
- queryFn: async () => l.request(he, { where: s })
2790
+ queryFn: async () => u.request(_e, { where: c })
2791
2791
  });
2792
- if (!n?.length) return u;
2793
- let ee = new Set(n.map(P));
2794
- return u.filter((e) => {
2792
+ if (!n?.length) return d;
2793
+ let ee = new Set(n.map(ct));
2794
+ return d.filter((e) => {
2795
2795
  try {
2796
- let t = it(e.decodedDataJson ?? "[]");
2796
+ let t = at(e.decodedDataJson ?? "[]");
2797
2797
  return ee.has(t.domain);
2798
2798
  } catch {
2799
2799
  return !1;
@@ -2802,17 +2802,17 @@ async function st(e) {
2802
2802
  }
2803
2803
  //#endregion
2804
2804
  //#region src/publishAuthorizationHelpers.ts
2805
- var ct = "address identity,address sessionKey,address app,string scopes,uint64 grantedAt,uint64 expiresAt,bytes32 permissionsHash", lt = "seedprotocol.publishAuthorization", ut = "publish,revoke", dt = 31536e3;
2805
+ var ut = "address identity,address sessionKey,address app,string scopes,uint64 grantedAt,uint64 expiresAt,bytes32 permissionsHash", dt = "seedprotocol.publishAuthorization", ft = "publish,revoke", pt = 31536e3;
2806
2806
  function F(e) {
2807
2807
  let t = e.trim();
2808
2808
  try {
2809
- return h(t).toLowerCase();
2809
+ return g(t).toLowerCase();
2810
2810
  } catch {
2811
2811
  return t.toLowerCase();
2812
2812
  }
2813
2813
  }
2814
- function ft(e) {
2815
- return typeof e == "string" ? O(e) : e && typeof e == "object" && "hex" in e ? O(String(e.hex)) : O(String(e ?? ""));
2814
+ function mt(e) {
2815
+ return typeof e == "string" ? A(e) : e && typeof e == "object" && "hex" in e ? A(String(e.hex)) : A(String(e ?? ""));
2816
2816
  }
2817
2817
  function I(e) {
2818
2818
  return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
@@ -2826,7 +2826,7 @@ function L(e) {
2826
2826
  }
2827
2827
  return e && typeof e == "object" && "value" in e ? L(e.value) : 0;
2828
2828
  }
2829
- function pt(e) {
2829
+ function ht(e) {
2830
2830
  let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
2831
2831
  for (let e of t) e?.name && n.set(e.name, e);
2832
2832
  return {
@@ -2836,10 +2836,10 @@ function pt(e) {
2836
2836
  scopes: I(n.get("scopes")?.value),
2837
2837
  grantedAt: L(n.get("grantedAt")?.value),
2838
2838
  expiresAt: L(n.get("expiresAt")?.value),
2839
- permissionsHash: ft(n.get("permissionsHash")?.value)
2839
+ permissionsHash: mt(n.get("permissionsHash")?.value)
2840
2840
  };
2841
2841
  }
2842
- function mt(e) {
2842
+ function gt(e) {
2843
2843
  let t = Math.floor((e.now ?? Date.now()) / 1e3), n = [], r = e.expectedScopes ?? "publish,revoke", i = e.expirationTime, a = e.decoded.expiresAt;
2844
2844
  return typeof i == "number" && i > 0 && t >= i || a > 0 && t >= a ? {
2845
2845
  status: "expired",
@@ -2855,43 +2855,43 @@ function mt(e) {
2855
2855
  warnings: n
2856
2856
  });
2857
2857
  }
2858
- function ht(e) {
2859
- return "0x" + p(new TextEncoder().encode(e));
2858
+ function _t(e) {
2859
+ return "0x" + m(new TextEncoder().encode(e));
2860
2860
  }
2861
2861
  //#endregion
2862
2862
  //#region src/publishAuthorization.ts
2863
- async function gt(e = {}) {
2864
- let { identities: t, sessionKeys: n, apps: r, schemaUid: i, excludeRevoked: a = !0 } = e, o = {};
2865
- i ? o.schemaId = { equals: i } : o.schema = { is: { schemaNames: { some: { name: { equals: lt } } } } }, t?.length && (o.attester = { in: t.map((e) => {
2863
+ async function vt(e = {}) {
2864
+ let { identities: t, sessionKeys: n, apps: r, schemaUid: a, excludeRevoked: o = !0 } = e, s = {};
2865
+ a ? s.schemaId = { equals: a } : s.schema = { is: { schemaNames: { some: { name: { equals: dt } } } } }, t?.length && (s.attester = { in: t.map((e) => {
2866
2866
  try {
2867
- return h(e);
2867
+ return g(e);
2868
2868
  } catch {
2869
2869
  return e;
2870
2870
  }
2871
- }) }), n?.length && (o.recipient = { in: n.map((e) => {
2871
+ }) }), n?.length && (s.recipient = { in: n.map((e) => {
2872
2872
  try {
2873
- return h(e);
2873
+ return g(e);
2874
2874
  } catch {
2875
2875
  return e;
2876
2876
  }
2877
- }) }), a && (o = y(o));
2878
- let s = d.getQueryClient(), c = f.getEasClient(), { itemSeeds: l } = await s.fetchQuery({
2877
+ }) }), o && (s = y(s));
2878
+ let c = i.getQueryClient(), l = p.getEasClient(), { itemSeeds: u } = await c.fetchQuery({
2879
2879
  queryKey: [
2880
2880
  "getPublishAuthorizationFromEas",
2881
- a,
2882
- i ?? "seedprotocol.publishAuthorization",
2881
+ o,
2882
+ a ?? "seedprotocol.publishAuthorization",
2883
2883
  [...t ?? []].map((e) => e.toLowerCase()).sort(),
2884
2884
  [...n ?? []].map((e) => e.toLowerCase()).sort(),
2885
2885
  [...r ?? []].map((e) => e.toLowerCase()).sort()
2886
2886
  ],
2887
- queryFn: async () => c.request(S, { where: o })
2887
+ queryFn: async () => l.request(S, { where: s })
2888
2888
  });
2889
- if (!r?.length) return l;
2890
- let u = new Set(r.map((e) => e.toLowerCase()));
2891
- return l.filter((e) => {
2889
+ if (!r?.length) return u;
2890
+ let d = new Set(r.map((e) => e.toLowerCase()));
2891
+ return u.filter((e) => {
2892
2892
  try {
2893
- let t = pt(e.decodedDataJson ?? "[]");
2894
- return u.has(t.app.toLowerCase());
2893
+ let t = ht(e.decodedDataJson ?? "[]");
2894
+ return d.has(t.app.toLowerCase());
2895
2895
  } catch {
2896
2896
  return !1;
2897
2897
  }
@@ -2899,15 +2899,15 @@ async function gt(e = {}) {
2899
2899
  }
2900
2900
  //#endregion
2901
2901
  //#region src/easNames.ts
2902
- var R = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase(), _t = [
2902
+ var R = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase(), yt = [
2903
2903
  "exact",
2904
2904
  "normalized",
2905
2905
  "fuzzy"
2906
- ], vt = (e) => typeof e == "string" && _t.includes(e), z = {
2906
+ ], bt = (e) => typeof e == "string" && yt.includes(e), z = {
2907
2907
  exact: 0,
2908
2908
  normalized: 1,
2909
2909
  fuzzy: 2
2910
- }, yt = "fuzzy", B = (e) => e.toLowerCase().replace(/[^a-z0-9]/g, ""), V = (e, t = {}) => {
2910
+ }, xt = "fuzzy", B = (e) => e.toLowerCase().replace(/[^a-z0-9]/g, ""), V = (e, t = {}) => {
2911
2911
  let n = B(e);
2912
2912
  return t.relation && (n.length > 3 && n.endsWith("ids") ? n = n.slice(0, -3) : n.length > 2 && n.endsWith("id") && (n = n.slice(0, -2))), n.length > 3 && n.endsWith("s") && !n.endsWith("ss") && (n = n.slice(0, -1)), n;
2913
2913
  };
@@ -2917,7 +2917,7 @@ function H(e, t, n = {}) {
2917
2917
  if (V(e, n) === V(t, n)) return "fuzzy";
2918
2918
  }
2919
2919
  var U = (e, t) => z[e] <= z[t], W = (e, t) => z[e] - z[t];
2920
- function bt(e, t) {
2920
+ function St(e, t) {
2921
2921
  let n, r = [];
2922
2922
  for (let i of t) {
2923
2923
  let t = H(i.name, e, { relation: i.relation });
@@ -2933,7 +2933,7 @@ function bt(e, t) {
2933
2933
  tier: n
2934
2934
  };
2935
2935
  }
2936
- function xt(e, t, n = {}) {
2936
+ function Ct(e, t, n = {}) {
2937
2937
  let r = typeof n.level == "function" ? n.level : () => n.level ?? "fuzzy", i, a = /* @__PURE__ */ new Set();
2938
2938
  for (let o of t) {
2939
2939
  let t = H(o, e, { relation: n.relation });
@@ -2941,7 +2941,7 @@ function xt(e, t, n = {}) {
2941
2941
  }
2942
2942
  return a;
2943
2943
  }
2944
- function St(e) {
2944
+ function wt(e) {
2945
2945
  let t = e.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
2946
2946
  return [.../* @__PURE__ */ new Set([
2947
2947
  R(e),
@@ -2949,65 +2949,65 @@ function St(e) {
2949
2949
  B(e)
2950
2950
  ])];
2951
2951
  }
2952
- function Ct(e, t = yt) {
2952
+ function Tt(e, t = xt) {
2953
2953
  if (t === "exact") return [R(e)];
2954
- let n = /* @__PURE__ */ new Set([...St(e), e]);
2954
+ let n = /* @__PURE__ */ new Set([...wt(e), e]);
2955
2955
  if (t === "fuzzy") for (let e of [...n]) n.add(e.endsWith("s") ? e.slice(0, -1) : `${e}s`);
2956
2956
  return [...n];
2957
2957
  }
2958
2958
  //#endregion
2959
2959
  //#region src/easValues.ts
2960
- var wt = /^-?\d+$/, Tt = /^(-?)0x([0-9a-f]+)$/i;
2961
- function Et(e) {
2960
+ var Et = /^-?\d+$/, Dt = /^(-?)0x([0-9a-f]+)$/i;
2961
+ function Ot(e) {
2962
2962
  return typeof e == "string" && /^u?int\d*$/.test(e);
2963
2963
  }
2964
- function Dt(e) {
2965
- let t = Tt.exec(e.trim());
2964
+ function kt(e) {
2965
+ let t = Dt.exec(e.trim());
2966
2966
  if (!t) return;
2967
2967
  let n = BigInt("0x" + t[2]);
2968
2968
  return (t[1] ? -n : n).toString();
2969
2969
  }
2970
- function Ot(e) {
2970
+ function At(e) {
2971
2971
  if (typeof e == "bigint") return e.toString();
2972
2972
  if (typeof e == "number") return Number.isFinite(e) ? String(e) : void 0;
2973
2973
  if (typeof e == "string") {
2974
2974
  let t = e.trim();
2975
2975
  if (!t) return;
2976
- if (wt.test(t)) return BigInt(t).toString();
2977
- if (Tt.test(t)) return Dt(t);
2976
+ if (Et.test(t)) return BigInt(t).toString();
2977
+ if (Dt.test(t)) return kt(t);
2978
2978
  let n = Number(t);
2979
2979
  return Number.isFinite(n) ? String(n) : void 0;
2980
2980
  }
2981
2981
  if (e && typeof e == "object") {
2982
2982
  let t = e.hex ?? e._hex;
2983
- if (typeof t == "string") return Dt(t);
2983
+ if (typeof t == "string") return kt(t);
2984
2984
  }
2985
2985
  }
2986
2986
  //#endregion
2987
2987
  //#region src/publishedByHelpers.ts
2988
- var kt = "bytes32 seedUid,bytes32 versionUid,bytes32[] attestationUids,bytes32 batchHash,string toolName,string toolVersion", At = "seedprotocol.publishedBy";
2989
- function jt(e) {
2988
+ var jt = "bytes32 seedUid,bytes32 versionUid,bytes32[] attestationUids,bytes32 batchHash,string toolName,string toolVersion", Mt = "seedprotocol.publishedBy";
2989
+ function Nt(e) {
2990
2990
  let t = e.startsWith("0x") || e.startsWith("0X") ? e.slice(2) : e, n = new Uint8Array(t.length / 2);
2991
2991
  for (let e = 0; e < n.length; e++) n[e] = parseInt(t.slice(e * 2, e * 2 + 2), 16);
2992
2992
  return n;
2993
2993
  }
2994
- function Mt(e) {
2995
- let t = [...e].map((e) => O(e)).filter((e) => e !== "" && He(e)).sort();
2996
- if (t.length === 0) return "0x" + p(/* @__PURE__ */ new Uint8Array());
2994
+ function Pt(e) {
2995
+ let t = [...e].map((e) => A(e)).filter((e) => e !== "" && He(e)).sort();
2996
+ if (t.length === 0) return "0x" + m(/* @__PURE__ */ new Uint8Array());
2997
2997
  let n = new Uint8Array(t.length * 32);
2998
- for (let e = 0; e < t.length; e++) n.set(jt(t[e]), e * 32);
2999
- return "0x" + p(n);
2998
+ for (let e = 0; e < t.length; e++) n.set(Nt(t[e]), e * 32);
2999
+ return "0x" + m(n);
3000
3000
  }
3001
- function Nt(e) {
3002
- return O(Mt(e.attestationUids)) === O(e.batchHash);
3001
+ function Ft(e) {
3002
+ return A(Pt(e.attestationUids)) === A(e.batchHash);
3003
3003
  }
3004
3004
  function G(e) {
3005
- return typeof e == "string" ? O(e) : e && typeof e == "object" && "hex" in e ? O(String(e.hex)) : O(String(e ?? ""));
3005
+ return typeof e == "string" ? A(e) : e && typeof e == "object" && "hex" in e ? A(String(e.hex)) : A(String(e ?? ""));
3006
3006
  }
3007
- function Pt(e) {
3007
+ function It(e) {
3008
3008
  return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
3009
3009
  }
3010
- function Ft(e) {
3010
+ function Lt(e) {
3011
3011
  let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
3012
3012
  for (let e of t) e?.name && n.set(e.name, e);
3013
3013
  let r = n.get("attestationUids")?.value, i = [];
@@ -3016,74 +3016,84 @@ function Ft(e) {
3016
3016
  versionUid: G(n.get("versionUid")?.value),
3017
3017
  attestationUids: i,
3018
3018
  batchHash: G(n.get("batchHash")?.value),
3019
- toolName: Pt(n.get("toolName")?.value),
3020
- toolVersion: Pt(n.get("toolVersion")?.value)
3019
+ toolName: It(n.get("toolName")?.value),
3020
+ toolVersion: It(n.get("toolVersion")?.value)
3021
3021
  };
3022
3022
  }
3023
3023
  //#endregion
3024
3024
  //#region src/publishedBy.ts
3025
- async function It(e) {
3026
- let { toolAddresses: t, refUIDs: n, schemaUid: r, excludeRevoked: i = !0 } = e;
3025
+ async function Rt(e) {
3026
+ let { toolAddresses: t, refUIDs: n, schemaUid: r, excludeRevoked: a = !0 } = e;
3027
3027
  if (!t.length) return [];
3028
- let a = t.map((e) => {
3028
+ let o = t.map((e) => {
3029
3029
  try {
3030
- return h(e);
3030
+ return g(e);
3031
3031
  } catch {
3032
3032
  return e;
3033
3033
  }
3034
- }), o = { attester: { in: a } };
3035
- r ? o.schemaId = { equals: r } : o.schema = { is: { schemaNames: { some: { name: { equals: At } } } } }, n?.length && (o.refUID = { in: n }), i && (o = y(o));
3036
- let s = d.getQueryClient(), c = f.getEasClient(), { itemSeeds: l } = await s.fetchQuery({
3034
+ }), s = { attester: { in: o } };
3035
+ r ? s.schemaId = { equals: r } : s.schema = { is: { schemaNames: { some: { name: { equals: Mt } } } } }, n?.length && (s.refUID = { in: n }), a && (s = y(s));
3036
+ let c = i.getQueryClient(), l = p.getEasClient(), { itemSeeds: u } = await c.fetchQuery({
3037
3037
  queryKey: [
3038
3038
  "getPublishedByFromEas",
3039
- i,
3039
+ a,
3040
3040
  r ?? "seedprotocol.publishedBy",
3041
- [...a].sort(),
3041
+ [...o].sort(),
3042
3042
  [...n ?? []].sort()
3043
3043
  ],
3044
- queryFn: async () => c.request(S, { where: o })
3044
+ queryFn: async () => l.request(S, { where: s })
3045
3045
  });
3046
- return l;
3046
+ return u;
3047
3047
  }
3048
3048
  //#endregion
3049
3049
  //#region src/default/index.ts
3050
- function Lt() {
3051
- f.isConfigured() || f.configure(new te()), d.isConfigured() || d.configure(new oe());
3050
+ function zt() {
3051
+ p.isConfigured() || p.configure(new te()), i.isConfigured() || i.configure(new ae());
3052
3052
  }
3053
3053
  //#endregion
3054
3054
  //#region src/stores/schemaUidCache.ts
3055
- var K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), Rt = 3e5, J = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), Z = 0, zt = (e) => {
3056
- let t = "";
3055
+ var K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), Bt = 3e5, J = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), Z = 0, Vt = () => {
3057
3056
  try {
3058
- t = n();
3059
- } catch {}
3060
- return `${t}\n${e}`;
3061
- }, Q = async (e, t) => {
3062
- let n = zt(e), r = Y.get(n);
3057
+ return f();
3058
+ } catch {
3059
+ return "";
3060
+ }
3061
+ }, Q = (e) => `${Vt()}\n${e}`, $ = async (e, t) => {
3062
+ let n = Q(e), r = Y.get(n);
3063
3063
  if (r !== void 0) {
3064
3064
  if (Date.now() < r) return;
3065
3065
  Y.delete(n);
3066
3066
  }
3067
3067
  let i = X.get(n);
3068
3068
  if (i) return i;
3069
- let a = Z, o = t().then((e) => (!e && a === Z && Y.set(n, Date.now() + Rt), e)).finally(() => {
3069
+ let a = Z, o = t().then((e) => (!e && a === Z && Y.set(n, Date.now() + Bt), e)).finally(() => {
3070
3070
  X.get(n) === o && X.delete(n);
3071
3071
  });
3072
3072
  return X.set(n, o), o;
3073
- }, $ = () => {
3073
+ }, Ht = () => {
3074
3074
  Z++, Y.clear(), X.clear();
3075
- }, Bt = () => {
3076
- K.clear(), q.clear(), J.clear(), $();
3077
- }, Vt = ({ text: e, schemaUid: t }) => {
3078
- K.set(m(e), t), $();
3079
- }, Ht = ({ modelName: e, schemaUid: t }) => {
3080
- q.set(e.toLowerCase(), t), $();
3081
- }, Ut = (e) => q.get(e.toLowerCase()), Wt = (e) => K.get(m(e)), Gt = async ({ schemaText: e }) => {
3082
- let t = m(e);
3075
+ }, Ut = (e) => {
3076
+ let t = `${Vt()}\n`, n = (n) => n.startsWith(t) && e(n.slice(t.length)), r = !1;
3077
+ for (let e of [...Y.keys()]) n(e) && Y.delete(e);
3078
+ for (let e of [...X.keys()]) n(e) && (X.delete(e), r = !0);
3079
+ r && Z++;
3080
+ }, Wt = (e) => {
3081
+ let t = h(e);
3082
+ return (n) => n === `definition:${e}` || n.startsWith("schemaName:") && t.endsWith(n.slice(11));
3083
+ }, Gt = () => {
3084
+ K.clear(), q.clear(), J.clear(), Ht();
3085
+ }, Kt = ({ text: e, schemaUid: t }) => {
3086
+ K.set(h(e), t), Ut(Wt(e));
3087
+ }, qt = ({ modelName: e, schemaUid: t }) => {
3088
+ q.set(e.toLowerCase(), t);
3089
+ let n = `model:${R(e)}`;
3090
+ Ut((e) => e === n);
3091
+ }, Jt = (e) => q.get(e.toLowerCase()), Yt = (e) => K.get(h(e)), Xt = async ({ schemaText: e }) => {
3092
+ let t = h(e);
3083
3093
  if (!K.has(t)) {
3084
3094
  let e;
3085
3095
  try {
3086
- e = await Q(`schemaName:${t}`, () => E({ schemaName: t }));
3096
+ e = await $(`schemaName:${t}`, () => E({ schemaName: t }));
3087
3097
  } catch (e) {
3088
3098
  process.env.NODE_ENV === "development" && console.warn(`Failed to fetch schema for schema name ${t}:`, e);
3089
3099
  return;
@@ -3091,21 +3101,21 @@ var K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), Rt = 3e5, J =
3091
3101
  return e && K.set(t, e), e;
3092
3102
  }
3093
3103
  return K.get(t);
3094
- }, Kt = async (e) => {
3095
- let t = zt(e), n = J.get(t);
3104
+ }, Zt = async (e) => {
3105
+ let t = Q(e), n = J.get(t);
3096
3106
  if (n) return n;
3097
- let r = d.getQueryClient(), i = f.getEasClient();
3098
- if (!r || !i) return;
3099
- let a = await Q(`definition:${e}`, async () => {
3107
+ let r = i.getQueryClient(), a = p.getEasClient();
3108
+ if (!r || !a) return;
3109
+ let o = await $(`definition:${e}`, async () => {
3100
3110
  let t = await r.fetchQuery({
3101
3111
  queryKey: ["getSchemaByDefinition", e],
3102
- queryFn: async () => i.request(me, { where: { schema: { equals: e } } })
3112
+ queryFn: async () => a.request(ge, { where: { schema: { equals: e } } })
3103
3113
  }), n = t?.schemas ?? t?.data?.schemas;
3104
3114
  return Array.isArray(n) && n.length > 0 ? n[0].id : void 0;
3105
3115
  });
3106
- return a && J.set(t, a), a;
3116
+ return o && J.set(t, o), o;
3107
3117
  };
3108
3118
  //#endregion
3109
- export { f as BaseEasClient, f as EasClient, d as BaseQueryClient, a as DEFAULT_EAS_CHAIN_ID, yt as DEFAULT_NAME_MATCH_LEVEL, Ye as DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS, Ze as DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS, Ge as DOMAIN_OWNERSHIP_METHOD, Ue as DOMAIN_OWNERSHIP_SCHEMA_DEF, We as DOMAIN_OWNERSHIP_SCHEMA_NAME, qe as DOMAIN_OWNERSHIP_SCOPE_HOSTNAME, Ke as DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE, Xe as DOMAIN_OWNERSHIP_SOFT_STALE_MS, Je as DOMAIN_OWNERSHIP_TXT_LABEL, te as DefaultEasClient, oe as DefaultQueryClient, r as DuplicateEasModuleError, o as EAS_CHAIN_DEPLOYMENTS, Be as EAS_ENDPOINT, ye as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, Ce as GET_ATTESTATION_CHANGES, he as GET_DOMAIN_OWNERSHIPS, be as GET_FILES_METADATA, xe as GET_IMAGE_SEEDS, Se as GET_IMAGE_VERSIONS, ve as GET_PROPERTIES, x as GET_SCHEMAS, me as GET_SCHEMA_BY_NAME, S as GET_SEEDS, C as GET_SEEDS_LEAN, ge as GET_SEED_IDS, _e as GET_STORAGE_TRANSACTION_ID, w as GET_VERSIONS, _t as NAME_MATCH_LEVELS, re as OP_STACK_EAS_CONTRACT_ADDRESS, ee as OP_STACK_SCHEMA_REGISTRY_ADDRESS, kt as PUBLISHED_BY_SCHEMA_DEF, At as PUBLISHED_BY_SCHEMA_NAME, dt as PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS, ct as PUBLISH_AUTHORIZATION_SCHEMA_DEF, lt as PUBLISH_AUTHORIZATION_SCHEMA_NAME, ut as PUBLISH_AUTHORIZATION_SCOPES, Rt as SCHEMA_LOOKUP_MISS_TTL_MS, Le as ZERO_ADDRESS, Re as ZERO_BYTES, ze as ZERO_BYTES32, ce as assertSingleEasModule, ot as assessDomainOwnership, mt as assessPublishAuthorization, et as buildDomainOwnershipTxtValue, Q as cachedSchemaLookup, h as checksumAddress, $ as clearSchemaLookupMisses, W as compareNameMatchTiers, ie as configureEasReadChain, it as decodeDomainOwnershipData, Ot as decodeEasNumber, pt as decodePublishAuthorizationData, Ft as decodePublishedByData, $e as domainOwnershipTxtName, R as easName, St as easNameVariants, Ct as easNamesToFetch, Lt as ensureEasPlatform, l as expectEasReadChain, E as fetchEasSchemaUidBySchemaName, V as fuzzyNameKey, Fe as getAttestationChangesSince, Te as getCanonicalItemPropertiesFromEas, st as getDomainOwnershipFromEas, c as getEasAttestationExplorerUrl, s as getEasChainDeployment, n as getEasEndpoint, ne as getEasReadChainId, Ee as getEasSchemaUidBySchemaName, Kt as getEasSchemaUidForExactDefinition, Gt as getEasSchemaUidForSchemaDefinition, T as getItemPropertiesFromEas, we as getItemVersionsFromEas, gt as getPublishAuthorizationFromEas, It as getPublishedByFromEas, Me as getSchemaNamesBySchemaUids, Ut as getSchemaUidForModelFromCache, Wt as getSchemaUidForSchemaDefinitionFromCache, Ie as getSeedUidsBySchemaName, Oe as getSeedsBySchemaName, Ne as getSeedsByUidsFromEas, De as getSeedsFromSchemaUids, nt as hashDomainOwnershipChallenge, j as hashDomainRegistryFingerprint, ht as hashPublishAuthorizationMaterial, Mt as hashPublishedByBatch, ae as isEasReadChainConfigured, i as isEasReadChainSettled, U as isNameMatchAllowed, vt as isNameMatchLevel, Et as isNumericEasType, Ve as isPlaceholderUid, He as isValidEasAttestationUid, v as keepAttestationsFromRefAttester, xt as localNamesInBestMatchTier, bt as matchEasName, H as nameMatchTier, O as normalizeBytes32Hex, B as normalizedNameKey, tt as parseDomainOwnershipTxtValue, _ as partitionByRefAttester, g as pickLatestPropertyAttestationsByRefAndSchema, e as resetEasClientOwnerForTests, u as resetEasReadChain, je as resetSchemaNamesCache, Bt as resetSchemaUidCaches, t as resolveEasChainDeployment, Ht as setSchemaUidForModel, Vt as setSchemaUidForSchemaDefinition, m as toSnakeCase, Nt as verifyPublishedByBatch, se as whenEasReadChainSettled, y as withExcludeRevokedFilter };
3119
+ export { p as BaseEasClient, p as EasClient, i as BaseQueryClient, re as DEFAULT_EAS_CHAIN_ID, xt as DEFAULT_NAME_MATCH_LEVEL, Ye as DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS, Ze as DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS, Ge as DOMAIN_OWNERSHIP_METHOD, Ue as DOMAIN_OWNERSHIP_SCHEMA_DEF, We as DOMAIN_OWNERSHIP_SCHEMA_NAME, qe as DOMAIN_OWNERSHIP_SCOPE_HOSTNAME, Ke as DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE, Xe as DOMAIN_OWNERSHIP_SOFT_STALE_MS, Je as DOMAIN_OWNERSHIP_TXT_LABEL, te as DefaultEasClient, ae as DefaultQueryClient, t as DuplicateEasModuleError, ee as EAS_CHAIN_DEPLOYMENTS, Be as EAS_ENDPOINT, ie as EAS_REQUEST_TIMEOUT_MS, xe as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, Te as GET_ATTESTATION_CHANGES, _e as GET_DOMAIN_OWNERSHIPS, Se as GET_FILES_METADATA, Ce as GET_IMAGE_SEEDS, we as GET_IMAGE_VERSIONS, be as GET_PROPERTIES, x as GET_SCHEMAS, ge as GET_SCHEMA_BY_NAME, S as GET_SEEDS, C as GET_SEEDS_LEAN, ve as GET_SEED_IDS, ye as GET_STORAGE_TRANSACTION_ID, w as GET_VERSIONS, yt as NAME_MATCH_LEVELS, l as OP_STACK_EAS_CONTRACT_ADDRESS, c as OP_STACK_SCHEMA_REGISTRY_ADDRESS, jt as PUBLISHED_BY_SCHEMA_DEF, Mt as PUBLISHED_BY_SCHEMA_NAME, pt as PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS, ut as PUBLISH_AUTHORIZATION_SCHEMA_DEF, dt as PUBLISH_AUTHORIZATION_SCHEMA_NAME, ft as PUBLISH_AUTHORIZATION_SCOPES, Bt as SCHEMA_LOOKUP_MISS_TTL_MS, Le as ZERO_ADDRESS, Re as ZERO_BYTES, ze as ZERO_BYTES32, e as assertSingleEasModule, st as assessDomainOwnership, gt as assessPublishAuthorization, et as buildDomainOwnershipTxtValue, $ as cachedSchemaLookup, g as checksumAddress, Ht as clearSchemaLookupMisses, W as compareNameMatchTiers, r as configureEasReadChain, u as createEasGraphQLClient, at as decodeDomainOwnershipData, At as decodeEasNumber, ht as decodePublishAuthorizationData, Lt as decodePublishedByData, $e as domainOwnershipTxtName, R as easName, wt as easNameVariants, Tt as easNamesToFetch, zt as ensureEasPlatform, ne as expectEasReadChain, E as fetchEasSchemaUidBySchemaName, V as fuzzyNameKey, Fe as getAttestationChangesSince, De as getCanonicalItemPropertiesFromEas, lt as getDomainOwnershipFromEas, n as getEasAttestationExplorerUrl, se as getEasChainDeployment, f as getEasEndpoint, a as getEasReadChainId, Oe as getEasSchemaUidBySchemaName, Zt as getEasSchemaUidForExactDefinition, Xt as getEasSchemaUidForSchemaDefinition, T as getItemPropertiesFromEas, Ee as getItemVersionsFromEas, vt as getPublishAuthorizationFromEas, Rt as getPublishedByFromEas, Me as getSchemaNamesBySchemaUids, Jt as getSchemaUidForModelFromCache, Yt as getSchemaUidForSchemaDefinitionFromCache, Ie as getSeedUidsBySchemaName, D as getSeedsBySchemaName, Ne as getSeedsByUidsFromEas, ke as getSeedsFromSchemaUids, nt as hashDomainOwnershipChallenge, rt as hashDomainRegistryFingerprint, _t as hashPublishAuthorizationMaterial, Pt as hashPublishedByBatch, d as isEasReadChainConfigured, oe as isEasReadChainSettled, U as isNameMatchAllowed, bt as isNameMatchLevel, Ot as isNumericEasType, Ve as isPlaceholderUid, He as isValidEasAttestationUid, v as keepAttestationsFromRefAttester, Ct as localNamesInBestMatchTier, St as matchEasName, H as nameMatchTier, A as normalizeBytes32Hex, B as normalizedNameKey, tt as parseDomainOwnershipTxtValue, me as partitionByRefAttester, _ as pickLatestPropertyAttestationsByRefAndSchema, ce as resetEasClientOwnerForTests, o as resetEasReadChain, je as resetSchemaNamesCache, Gt as resetSchemaUidCaches, le as resolveEasChainDeployment, qt as setSchemaUidForModel, Kt as setSchemaUidForSchemaDefinition, h as toSnakeCase, Ft as verifyPublishedByBatch, s as whenEasReadChainSettled, y as withExcludeRevokedFilter };
3110
3120
 
3111
3121
  //# sourceMappingURL=index.js.map