@seedprotocol/eas 0.7.9-next.1177.ga3e08ed → 0.7.9-next.1189.g5e63267

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