@seedprotocol/eas 0.7.3-next.613.g79a8dfd → 0.7.3

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 { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as f, r as p, s as ee, t as te, u as ne } from "./easEndpoint-BYyoBW_s.js";
2
- import { keccak_256 as re } from "@noble/hashes/sha3";
3
- import { bytesToHex as ie, utf8ToBytes as ae } from "@noble/hashes/utils";
1
+ import { _ as e, a as t, c as n, d as r, f as i, g as a, h as o, i as s, l as c, m as l, n as u, o as d, p as ee, r as te, s as ne, t as f, u as re, v as p, y as m } from "./QueryClient-Ch6F96Za.js";
2
+ import { keccak_256 as ie } from "@noble/hashes/sha3";
3
+ import { bytesToHex as ae, utf8ToBytes as oe } from "@noble/hashes/utils";
4
4
  //#region src/keccak.ts
5
- function m(e) {
6
- let t = typeof e == "string" ? ae(e) : e;
7
- return ie(re(t));
5
+ function h(e) {
6
+ let t = typeof e == "string" ? oe(e) : e;
7
+ return ae(ie(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 g = (e) => e.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
12
+ function _(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 = h(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 _ = (e) => {
21
+ var se = (e) => {
22
22
  let t = /* @__PURE__ */ new Map();
23
23
  for (let n of e) {
24
24
  let e = n.schemaId;
@@ -28,10 +28,10 @@ var _ = (e) => {
28
28
  }
29
29
  return t;
30
30
  };
31
- function oe(e, t) {
32
- let n = _(e.filter((e) => !e.revoked));
31
+ function ce(e, t) {
32
+ let n = se(e.filter((e) => !e.revoked));
33
33
  if (t?.ifAllRevoked !== "newestRevoked") return [...n.values()];
34
- let r = _(e.filter((e) => e.revoked));
34
+ let r = se(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
  }
@@ -46,7 +46,7 @@ function v(e) {
46
46
  }
47
47
  //#endregion
48
48
  //#region src/graphql/gql/gql.ts
49
- var se = {
49
+ var le = {
50
50
  "\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": {
51
51
  kind: "Document",
52
52
  definitions: [{
@@ -2295,189 +2295,189 @@ var se = {
2295
2295
  }
2296
2296
  };
2297
2297
  function y(e) {
2298
- return se[e] ?? {};
2298
+ return le[e] ?? {};
2299
2299
  }
2300
2300
  //#endregion
2301
2301
  //#region src/queries.ts
2302
- var b = y("\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), ce = y("\n query GetSchemaByName($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), x = y("\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"), S = y("\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"), le = y("\n query GetSeedIds($where: AttestationWhereInput!) {\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n }\n }\n"), ue = y("\n query GetStorageTransactionId($where: AttestationWhereInput!) {\n storageTransactionId: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n id\n decodedDataJson\n }\n }\n"), C = y("\n query GetVersions($where: AttestationWhereInput!) {\n itemVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), w = y("\n query GetProperties($where: AttestationWhereInput!) {\n itemProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), de = y("\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\n allProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), fe = y("\n query GetFilesMetadata($where: AttestationWhereInput!) {\n filesMetadata: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), pe = y("\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"), me = y("\n query GetImageVersions($where: AttestationWhereInput!) {\n imageVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), T = y("\n query GetAttestationChanges($where: AttestationWhereInput!) {\n changes: attestations(where: $where) {\n id\n refUID\n timeCreated\n revocationTime\n }\n }\n"), he = async ({ seedUids: t, excludeRevoked: n = !0 }) => {
2303
- let r = a.getQueryClient(), i = e.getEasClient(), o = n ? v({ refUID: { in: t } }) : { refUID: { in: t } }, { itemVersions: s } = await r.fetchQuery({
2302
+ var b = y("\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), x = y("\n query GetSchemaByName($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), S = y("\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 = y("\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"), ue = y("\n query GetSeedIds($where: AttestationWhereInput!) {\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n }\n }\n"), de = y("\n query GetStorageTransactionId($where: AttestationWhereInput!) {\n storageTransactionId: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n id\n decodedDataJson\n }\n }\n"), fe = y("\n query GetVersions($where: AttestationWhereInput!) {\n itemVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), pe = y("\n query GetProperties($where: AttestationWhereInput!) {\n itemProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), me = y("\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\n allProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), he = y("\n query GetFilesMetadata($where: AttestationWhereInput!) {\n filesMetadata: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), ge = y("\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"), _e = y("\n query GetImageVersions($where: AttestationWhereInput!) {\n imageVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), w = y("\n query GetAttestationChanges($where: AttestationWhereInput!) {\n changes: attestations(where: $where) {\n id\n refUID\n timeCreated\n revocationTime\n }\n }\n"), ve = async ({ seedUids: e, excludeRevoked: t = !0 }) => {
2303
+ let n = p.getQueryClient(), r = m.getEasClient(), i = t ? v({ refUID: { in: e } }) : { refUID: { in: e } }, { itemVersions: a } = await n.fetchQuery({
2304
2304
  queryKey: [
2305
2305
  "getVersionsForAllModels",
2306
- [...t].sort(),
2307
- n
2306
+ [...e].sort(),
2307
+ t
2308
2308
  ],
2309
- queryFn: async () => i.request(C, { where: o })
2309
+ queryFn: async () => r.request(fe, { where: i })
2310
2310
  });
2311
- return s;
2312
- }, ge = async ({ versionUids: t, excludeRevoked: n = !0 }) => {
2313
- let r = a.getQueryClient(), i = e.getEasClient(), o = n ? v({ refUID: { in: t } }) : { refUID: { in: t } }, { itemProperties: s } = await r.fetchQuery({
2311
+ return a;
2312
+ }, T = async ({ versionUids: e, excludeRevoked: t = !0 }) => {
2313
+ let n = p.getQueryClient(), r = m.getEasClient(), i = t ? v({ refUID: { in: e } }) : { refUID: { in: e } }, { itemProperties: a } = await n.fetchQuery({
2314
2314
  queryKey: [
2315
2315
  "getPropertiesForAllModels",
2316
- [...t].sort(),
2317
- n
2316
+ [...e].sort(),
2317
+ t
2318
2318
  ],
2319
- queryFn: async () => i.request(w, { where: o })
2319
+ queryFn: async () => r.request(pe, { where: i })
2320
2320
  });
2321
- return s;
2322
- }, _e = async (e) => oe(await ge(e)), E = async ({ schemaName: t }) => {
2323
- let n = a.getQueryClient(), r = e.getEasClient();
2324
- if (!n || !r) return;
2325
- let { schemas: i } = await n.fetchQuery({
2326
- queryKey: ["getEasSchemaUidBySchemaName", t],
2327
- queryFn: async () => r.request(b, { where: { schema: { endsWith: t } } })
2321
+ return a;
2322
+ }, ye = async (e) => ce(await T(e)), E = async ({ schemaName: e }) => {
2323
+ let t = p.getQueryClient(), n = m.getEasClient();
2324
+ if (!t || !n) return;
2325
+ let { schemas: r } = await t.fetchQuery({
2326
+ queryKey: ["getEasSchemaUidBySchemaName", e],
2327
+ queryFn: async () => n.request(b, { where: { schema: { endsWith: e } } })
2328
2328
  });
2329
- if (i && i.length !== 0) return i[0].id;
2330
- }, ve = async ({ schemaName: e }) => {
2329
+ if (r && r.length !== 0) return r[0].id;
2330
+ }, be = async ({ schemaName: e }) => {
2331
2331
  try {
2332
2332
  return await E({ schemaName: e });
2333
2333
  } catch (t) {
2334
2334
  process.env.NODE_ENV === "development" && console.warn(`Failed to fetch schema for schema name ${e}:`, t);
2335
2335
  return;
2336
2336
  }
2337
- }, ye = async ({ schemaUids: t, addresses: n, excludeRevoked: r = !0 }) => {
2338
- let i = {
2339
- attester: { in: n.map((e) => {
2337
+ }, xe = async ({ schemaUids: e, addresses: t, excludeRevoked: n = !0 }) => {
2338
+ let r = {
2339
+ attester: { in: t.map((e) => {
2340
2340
  try {
2341
- return g(e);
2341
+ return _(e);
2342
2342
  } catch {
2343
2343
  return e;
2344
2344
  }
2345
2345
  }) },
2346
- schemaId: { in: t }
2346
+ schemaId: { in: e }
2347
2347
  };
2348
- r && (i = v(i));
2349
- let o = a.getQueryClient(), s = e.getEasClient(), { itemSeeds: c } = await o.fetchQuery({
2348
+ n && (r = v(r));
2349
+ let i = p.getQueryClient(), a = m.getEasClient(), { itemSeeds: o } = await i.fetchQuery({
2350
2350
  queryKey: [
2351
2351
  "getSeedsForAllModels",
2352
- r,
2353
- [...t].sort(),
2354
- [...n].sort()
2352
+ n,
2353
+ [...e].sort(),
2354
+ [...t].sort()
2355
2355
  ],
2356
- queryFn: async () => s.request(x, { where: i })
2356
+ queryFn: async () => a.request(S, { where: r })
2357
2357
  });
2358
- return c;
2359
- }, be = async (t, n = 10, r, i) => {
2360
- let o = r ?? 0, s = i?.uidPrefix, c = {
2358
+ return o;
2359
+ }, D = async (e, t = 10, n, r) => {
2360
+ let i = n ?? 0, a = r?.uidPrefix, o = {
2361
2361
  where: v({
2362
- ...s === void 0 ? {} : { id: { startsWith: s } },
2363
- schema: { is: { schemaNames: { some: { name: { equals: t } } } } }
2362
+ ...a === void 0 ? {} : { id: { startsWith: a } },
2363
+ schema: { is: { schemaNames: { some: { name: { equals: e } } } } }
2364
2364
  }),
2365
- take: n,
2366
- skip: o
2367
- }, l = a.getQueryClient(), u = e.getEasClient(), { itemSeeds: d } = await l.fetchQuery({
2365
+ take: t,
2366
+ skip: i
2367
+ }, s = p.getQueryClient(), c = m.getEasClient(), { itemSeeds: l } = await s.fetchQuery({
2368
2368
  queryKey: [
2369
2369
  "getSeedsBySchemaName",
2370
+ e,
2370
2371
  t,
2371
- n,
2372
- o,
2373
- s ?? null
2372
+ i,
2373
+ a ?? null
2374
2374
  ],
2375
- queryFn: async () => u.request(S, c)
2375
+ queryFn: async () => c.request(C, o)
2376
2376
  });
2377
- return d.map((e) => xe(e, [t]));
2378
- }, xe = (e, t) => ({
2377
+ return l.map((t) => O(t, [e]));
2378
+ }, O = (e, t) => ({
2379
2379
  ...e,
2380
2380
  schema: { schemaNames: t.map((e) => ({ name: e })) }
2381
- }), D = /* @__PURE__ */ new Map(), Se = (e) => {
2382
- let t = "";
2381
+ }), k = /* @__PURE__ */ new Map(), A = (e) => {
2382
+ let n = "";
2383
2383
  try {
2384
- t = p();
2384
+ n = t();
2385
2385
  } catch {}
2386
- return `${t}\n${e.toLowerCase()}`;
2387
- }, Ce = () => {
2388
- D.clear();
2389
- }, we = async (t) => {
2390
- let n = /* @__PURE__ */ new Map(), r = [];
2391
- for (let e of new Set(t)) {
2392
- let t = D.get(Se(e));
2393
- t ? n.set(e, t) : r.push(e);
2386
+ return `${n}\n${e.toLowerCase()}`;
2387
+ }, Se = () => {
2388
+ k.clear();
2389
+ }, j = async (e) => {
2390
+ let t = /* @__PURE__ */ new Map(), n = [];
2391
+ for (let r of new Set(e)) {
2392
+ let e = k.get(A(r));
2393
+ e ? t.set(r, e) : n.push(r);
2394
2394
  }
2395
- if (r.length === 0) return n;
2396
- let i = a.getQueryClient(), o = e.getEasClient(), { schemas: s } = await i.fetchQuery({
2397
- queryKey: ["getSchemaNamesBySchemaUids", [...r].sort()],
2398
- queryFn: async () => o.request(b, { where: { id: { in: r } } })
2399
- }), c = new Map(r.map((e) => [e.toLowerCase(), e]));
2400
- for (let e of s ?? []) {
2401
- let t = (e.schemaNames ?? []).map((e) => e.name), r = c.get(e.id.toLowerCase());
2402
- r && t.length !== 0 && (D.set(Se(r), t), n.set(r, t));
2395
+ if (n.length === 0) return t;
2396
+ let r = p.getQueryClient(), i = m.getEasClient(), { schemas: a } = await r.fetchQuery({
2397
+ queryKey: ["getSchemaNamesBySchemaUids", [...n].sort()],
2398
+ queryFn: async () => i.request(b, { where: { id: { in: n } } })
2399
+ }), o = new Map(n.map((e) => [e.toLowerCase(), e]));
2400
+ for (let e of a ?? []) {
2401
+ let n = (e.schemaNames ?? []).map((e) => e.name), r = o.get(e.id.toLowerCase());
2402
+ r && n.length !== 0 && (k.set(A(r), n), t.set(r, n));
2403
2403
  }
2404
- return n;
2405
- }, Te = async ({ uids: t, excludeRevoked: n = !0 }) => {
2406
- if (t.length === 0) return [];
2407
- let r = n ? v({ id: { in: t } }) : { id: { in: t } }, i = a.getQueryClient(), o = e.getEasClient(), { itemSeeds: s } = await i.fetchQuery({
2404
+ return t;
2405
+ }, Ce = async ({ uids: e, excludeRevoked: t = !0 }) => {
2406
+ if (e.length === 0) return [];
2407
+ let n = t ? v({ id: { in: e } }) : { id: { in: e } }, r = p.getQueryClient(), i = m.getEasClient(), { itemSeeds: a } = await r.fetchQuery({
2408
2408
  queryKey: [
2409
2409
  "getSeedsByUidsFromEas",
2410
- [...t].sort(),
2411
- n
2410
+ [...e].sort(),
2411
+ t
2412
2412
  ],
2413
- queryFn: async () => o.request(S, {
2414
- where: r,
2415
- take: t.length,
2413
+ queryFn: async () => i.request(C, {
2414
+ where: n,
2415
+ take: e.length,
2416
2416
  skip: 0
2417
2417
  })
2418
- }), c = s ?? [], l = await we(c.map((e) => e.schemaId));
2419
- return c.map((e) => xe(e, l.get(e.schemaId) ?? []));
2420
- }, Ee = 400, De = async ({ refUIDs: t, ids: n, since: r }) => {
2421
- let i = { OR: [{ timeCreated: { gt: r } }, { revocationTime: { gt: r } }] }, o = [], s = (e, t) => {
2418
+ }), o = a ?? [], s = await j(o.map((e) => e.schemaId));
2419
+ return o.map((e) => O(e, s.get(e.schemaId) ?? []));
2420
+ }, M = 400, we = async ({ refUIDs: e, ids: t, since: n }) => {
2421
+ let r = { OR: [{ timeCreated: { gt: n } }, { revocationTime: { gt: n } }] }, i = [], a = (e, t) => {
2422
2422
  let n = [...new Set(t)].sort();
2423
- for (let t = 0; t < n.length; t += Ee) o.push({ [e]: { in: n.slice(t, t + Ee) } });
2423
+ for (let t = 0; t < n.length; t += M) i.push({ [e]: { in: n.slice(t, t + M) } });
2424
2424
  };
2425
- if (s("refUID", t), s("id", n), o.length === 0) return [];
2426
- let c = a.getQueryClient(), l = e.getEasClient(), u = await Promise.all(o.map((e) => c.fetchQuery({
2425
+ if (a("refUID", e), a("id", t), i.length === 0) return [];
2426
+ let o = p.getQueryClient(), s = m.getEasClient(), c = await Promise.all(i.map((e) => o.fetchQuery({
2427
2427
  queryKey: [
2428
2428
  "getAttestationChangesSince",
2429
2429
  e,
2430
- r
2430
+ n
2431
2431
  ],
2432
- queryFn: async () => l.request(T, { where: { AND: [e, i] } })
2433
- }))), d = /* @__PURE__ */ new Map();
2434
- for (let { changes: e } of u) for (let t of e ?? []) d.set(t.id, t);
2435
- return [...d.values()];
2436
- }, Oe = async (e, t = 10) => (await be(e, t)).map((e) => e.id), ke = "0x0000000000000000000000000000000000000000", Ae = "0x", je = "0x0000000000000000000000000000000000000000000000000000000000000000", Me = typeof process < "u" && process.env?.NEXT_PUBLIC_EAS_ENDPOINT || typeof process < "u" && process.env?.EAS_ENDPOINT || "https://optimism-sepolia.easscan.org/graphql";
2432
+ queryFn: async () => s.request(w, { where: { AND: [e, r] } })
2433
+ }))), l = /* @__PURE__ */ new Map();
2434
+ for (let { changes: e } of c) for (let t of e ?? []) l.set(t.id, t);
2435
+ return [...l.values()];
2436
+ }, Te = async (e, t = 10) => (await D(e, t)).map((e) => e.id), Ee = "0x0000000000000000000000000000000000000000", De = "0x", Oe = "0x0000000000000000000000000000000000000000000000000000000000000000", ke = typeof process < "u" && process.env?.NEXT_PUBLIC_EAS_ENDPOINT || typeof process < "u" && process.env?.EAS_ENDPOINT || "https://optimism-sepolia.easscan.org/graphql";
2437
2437
  //#endregion
2438
2438
  //#region src/easUid.ts
2439
- function Ne(e) {
2439
+ function N(e) {
2440
2440
  if (e == null || e === "" || e === "NULL") return !0;
2441
2441
  let t = e.trim();
2442
2442
  return t === "" || t.toLowerCase() === "0x0000000000000000000000000000000000000000000000000000000000000000";
2443
2443
  }
2444
- function Pe(e) {
2445
- if (Ne(e)) return !1;
2444
+ function P(e) {
2445
+ if (N(e)) return !1;
2446
2446
  let t = String(e).trim();
2447
2447
  if (!/^0x/i.test(t)) return !1;
2448
2448
  let n = t.slice(2);
2449
2449
  return n.length === 64 && /^[0-9a-fA-F]{64}$/.test(n);
2450
2450
  }
2451
- function O(e) {
2451
+ function F(e) {
2452
2452
  if (e == null || e === "") return "";
2453
2453
  let t = String(e).trim();
2454
2454
  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();
2455
2455
  }
2456
2456
  //#endregion
2457
2457
  //#region src/domainOwnershipHelpers.ts
2458
- var Fe = "string domain,address claimer,string method,bytes32 challengeHash,uint64 verifiedAt,string registryCreationDate,string registryExpirationDate,bytes32 registryFingerprint,string scope", k = "seedprotocol.domainOwnership", Ie = "dns-txt-challenge", Le = "registrable", A = "_seedprotocol-challenge", Re = 2592e5, ze = 31536e6, Be = 31536e3;
2459
- function j(e) {
2458
+ var Ae = "string domain,address claimer,string method,bytes32 challengeHash,uint64 verifiedAt,string registryCreationDate,string registryExpirationDate,bytes32 registryFingerprint,string scope", I = "seedprotocol.domainOwnership", je = "dns-txt-challenge", Me = "registrable", L = "_seedprotocol-challenge", Ne = 2592e5, Pe = 31536e6, Fe = 31536e3;
2459
+ function Ie(e) {
2460
2460
  return new TextEncoder().encode(e);
2461
2461
  }
2462
- function M(e) {
2462
+ function R(e) {
2463
2463
  return e.trim().toLowerCase().replace(/\.$/, "");
2464
2464
  }
2465
- function N(e) {
2465
+ function z(e) {
2466
2466
  let t = e.trim();
2467
2467
  try {
2468
- return g(t).toLowerCase();
2468
+ return _(t).toLowerCase();
2469
2469
  } catch {
2470
2470
  return t.toLowerCase();
2471
2471
  }
2472
2472
  }
2473
- function Ve(e) {
2474
- return `${A}.${M(e)}`;
2473
+ function Le(e) {
2474
+ return `${L}.${R(e)}`;
2475
2475
  }
2476
- function He(e) {
2477
- let t = N(e.claimer);
2476
+ function Re(e) {
2477
+ let t = z(e.claimer);
2478
2478
  return `token=${e.token},addr=${t},expiry=${e.expiry}`;
2479
2479
  }
2480
- function Ue(e) {
2480
+ function ze(e) {
2481
2481
  let t = e.replace(/^"+|"+$/g, "").trim(), n = /* @__PURE__ */ new Map();
2482
2482
  for (let e of t.split(",")) {
2483
2483
  let t = e.indexOf("=");
@@ -2488,59 +2488,59 @@ function Ue(e) {
2488
2488
  let r = n.get("token"), i = n.get("addr") ?? n.get("claimer"), a = n.get("expiry");
2489
2489
  return !r || !i || !a ? null : {
2490
2490
  token: r,
2491
- claimer: N(i),
2491
+ claimer: z(i),
2492
2492
  expiry: a
2493
2493
  };
2494
2494
  }
2495
- function We(e) {
2496
- let t = M(e.domain), n = N(e.claimer), r = (e.scope ?? "registrable").trim();
2497
- return "0x" + m(j(`${t}|${n}|${e.token}|${r}`));
2495
+ function Be(e) {
2496
+ let t = R(e.domain), n = z(e.claimer), r = (e.scope ?? "registrable").trim();
2497
+ return "0x" + h(Ie(`${t}|${n}|${e.token}|${r}`));
2498
2498
  }
2499
- function P(e) {
2499
+ function B(e) {
2500
2500
  let t = {
2501
- domain: M(e.domain),
2501
+ domain: R(e.domain),
2502
2502
  creationDate: (e.creationDate ?? "").trim(),
2503
2503
  registrarIanaId: (e.registrarIanaId ?? "").trim()
2504
2504
  };
2505
- return "0x" + m(j(JSON.stringify(t)));
2505
+ return "0x" + h(Ie(JSON.stringify(t)));
2506
2506
  }
2507
- function F(e) {
2508
- return typeof e == "string" ? O(e) : e && typeof e == "object" && "hex" in e ? O(String(e.hex)) : O(String(e ?? ""));
2507
+ function Ve(e) {
2508
+ return typeof e == "string" ? F(e) : e && typeof e == "object" && "hex" in e ? F(String(e.hex)) : F(String(e ?? ""));
2509
2509
  }
2510
- function I(e) {
2510
+ function V(e) {
2511
2511
  return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
2512
2512
  }
2513
- function L(e) {
2513
+ function He(e) {
2514
2514
  if (typeof e == "number" && Number.isFinite(e)) return Math.trunc(e);
2515
2515
  if (typeof e == "bigint") return Number(e);
2516
2516
  if (typeof e == "string" && e.trim() !== "") {
2517
2517
  let t = Number(e);
2518
2518
  return Number.isFinite(t) ? Math.trunc(t) : 0;
2519
2519
  }
2520
- return e && typeof e == "object" && "value" in e ? L(e.value) : 0;
2520
+ return e && typeof e == "object" && "value" in e ? He(e.value) : 0;
2521
2521
  }
2522
- function R(e) {
2522
+ function Ue(e) {
2523
2523
  let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
2524
2524
  for (let e of t) e?.name && n.set(e.name, e);
2525
2525
  return {
2526
- domain: M(I(n.get("domain")?.value)),
2527
- claimer: N(I(n.get("claimer")?.value)),
2528
- method: I(n.get("method")?.value),
2529
- challengeHash: F(n.get("challengeHash")?.value),
2530
- verifiedAt: L(n.get("verifiedAt")?.value),
2531
- registryCreationDate: I(n.get("registryCreationDate")?.value),
2532
- registryExpirationDate: I(n.get("registryExpirationDate")?.value),
2533
- registryFingerprint: F(n.get("registryFingerprint")?.value),
2534
- scope: I(n.get("scope")?.value)
2526
+ domain: R(V(n.get("domain")?.value)),
2527
+ claimer: z(V(n.get("claimer")?.value)),
2528
+ method: V(n.get("method")?.value),
2529
+ challengeHash: Ve(n.get("challengeHash")?.value),
2530
+ verifiedAt: He(n.get("verifiedAt")?.value),
2531
+ registryCreationDate: V(n.get("registryCreationDate")?.value),
2532
+ registryExpirationDate: V(n.get("registryExpirationDate")?.value),
2533
+ registryFingerprint: Ve(n.get("registryFingerprint")?.value),
2534
+ scope: V(n.get("scope")?.value)
2535
2535
  };
2536
2536
  }
2537
- function Ge(e) {
2537
+ function We(e) {
2538
2538
  if (!e?.trim()) return null;
2539
2539
  let t = Date.parse(e);
2540
2540
  return Number.isFinite(t) ? Math.floor(t / 1e3) : null;
2541
2541
  }
2542
- function Ke(e) {
2543
- let t = Math.floor((e.now ?? Date.now()) / 1e3), n = [], r = e.softStaleMs ?? 31536e6, i = e.expirationTime, a = Ge(e.decoded.registryExpirationDate);
2542
+ function Ge(e) {
2543
+ let t = Math.floor((e.now ?? Date.now()) / 1e3), n = [], r = e.softStaleMs ?? 31536e6, i = e.expirationTime, a = We(e.decoded.registryExpirationDate);
2544
2544
  if (typeof i == "number" && i > 0 && t >= i || a != null && t >= a) return {
2545
2545
  status: "expired",
2546
2546
  warnings: n
@@ -2549,11 +2549,11 @@ function Ke(e) {
2549
2549
  status: "unknown",
2550
2550
  warnings: n
2551
2551
  };
2552
- if (e.registrySnapshot !== void 0) return O(P({
2552
+ if (e.registrySnapshot !== void 0) return F(B({
2553
2553
  domain: e.decoded.domain,
2554
2554
  creationDate: e.registrySnapshot.creationDate,
2555
2555
  registrarIanaId: e.registrySnapshot.registrarIanaId
2556
- })) === O(e.decoded.registryFingerprint) ? {
2556
+ })) === F(e.decoded.registryFingerprint) ? {
2557
2557
  status: "valid",
2558
2558
  warnings: n
2559
2559
  } : (n.push("Registry creation date or registrar IANA id no longer matches attestation fingerprint"), {
@@ -2571,43 +2571,43 @@ function Ke(e) {
2571
2571
  }
2572
2572
  //#endregion
2573
2573
  //#region src/domainOwnership.ts
2574
- function z(e) {
2574
+ function Ke(e) {
2575
2575
  return e.trim().toLowerCase().replace(/\.$/, "");
2576
2576
  }
2577
- async function qe(t) {
2578
- let { toolAddresses: n, domains: r, claimers: i, schemaUid: o, excludeRevoked: s = !0 } = t;
2579
- if (!n.length) return [];
2580
- let c = n.map((e) => {
2577
+ async function qe(e) {
2578
+ let { toolAddresses: t, domains: n, claimers: r, schemaUid: i, excludeRevoked: a = !0 } = e;
2579
+ if (!t.length) return [];
2580
+ let o = t.map((e) => {
2581
2581
  try {
2582
- return g(e);
2582
+ return _(e);
2583
2583
  } catch {
2584
2584
  return e;
2585
2585
  }
2586
- }), l = { attester: { in: c } };
2587
- o ? l.schemaId = { equals: o } : l.schema = { is: { schemaNames: { some: { name: { equals: k } } } } }, i?.length && (l.recipient = { in: i.map((e) => {
2586
+ }), s = { attester: { in: o } };
2587
+ i ? s.schemaId = { equals: i } : s.schema = { is: { schemaNames: { some: { name: { equals: I } } } } }, r?.length && (s.recipient = { in: r.map((e) => {
2588
2588
  try {
2589
- return g(e);
2589
+ return _(e);
2590
2590
  } catch {
2591
2591
  return e;
2592
2592
  }
2593
- }) }), s && (l = v(l));
2594
- let u = a.getQueryClient(), d = e.getEasClient(), { itemSeeds: f } = await u.fetchQuery({
2593
+ }) }), a && (s = v(s));
2594
+ let c = p.getQueryClient(), l = m.getEasClient(), { itemSeeds: u } = await c.fetchQuery({
2595
2595
  queryKey: [
2596
2596
  "getDomainOwnershipFromEas",
2597
- s,
2598
- o ?? "seedprotocol.domainOwnership",
2599
- [...c].sort(),
2600
- [...(r ?? []).map(z)].sort(),
2601
- [...i ?? []].map((e) => e.toLowerCase()).sort()
2597
+ a,
2598
+ i ?? "seedprotocol.domainOwnership",
2599
+ [...o].sort(),
2600
+ [...(n ?? []).map(Ke)].sort(),
2601
+ [...r ?? []].map((e) => e.toLowerCase()).sort()
2602
2602
  ],
2603
- queryFn: async () => d.request(x, { where: l })
2603
+ queryFn: async () => l.request(S, { where: s })
2604
2604
  });
2605
- if (!r?.length) return f;
2606
- let p = new Set(r.map(z));
2607
- return f.filter((e) => {
2605
+ if (!n?.length) return u;
2606
+ let d = new Set(n.map(Ke));
2607
+ return u.filter((e) => {
2608
2608
  try {
2609
- let t = R(e.decodedDataJson ?? "[]");
2610
- return p.has(t.domain);
2609
+ let t = Ue(e.decodedDataJson ?? "[]");
2610
+ return d.has(t.domain);
2611
2611
  } catch {
2612
2612
  return !1;
2613
2613
  }
@@ -2615,44 +2615,44 @@ async function qe(t) {
2615
2615
  }
2616
2616
  //#endregion
2617
2617
  //#region src/publishAuthorizationHelpers.ts
2618
- var Je = "address identity,address sessionKey,address app,string scopes,uint64 grantedAt,uint64 expiresAt,bytes32 permissionsHash", B = "seedprotocol.publishAuthorization", Ye = "publish,revoke", Xe = 31536e3;
2619
- function V(e) {
2618
+ var Je = "address identity,address sessionKey,address app,string scopes,uint64 grantedAt,uint64 expiresAt,bytes32 permissionsHash", Ye = "seedprotocol.publishAuthorization", Xe = "publish,revoke", Ze = 31536e3;
2619
+ function H(e) {
2620
2620
  let t = e.trim();
2621
2621
  try {
2622
- return g(t).toLowerCase();
2622
+ return _(t).toLowerCase();
2623
2623
  } catch {
2624
2624
  return t.toLowerCase();
2625
2625
  }
2626
2626
  }
2627
- function Ze(e) {
2628
- return typeof e == "string" ? O(e) : e && typeof e == "object" && "hex" in e ? O(String(e.hex)) : O(String(e ?? ""));
2627
+ function Qe(e) {
2628
+ return typeof e == "string" ? F(e) : e && typeof e == "object" && "hex" in e ? F(String(e.hex)) : F(String(e ?? ""));
2629
2629
  }
2630
- function H(e) {
2630
+ function U(e) {
2631
2631
  return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
2632
2632
  }
2633
- function U(e) {
2633
+ function W(e) {
2634
2634
  if (typeof e == "number" && Number.isFinite(e)) return Math.trunc(e);
2635
2635
  if (typeof e == "bigint") return Number(e);
2636
2636
  if (typeof e == "string" && e.trim() !== "") {
2637
2637
  let t = Number(e);
2638
2638
  return Number.isFinite(t) ? Math.trunc(t) : 0;
2639
2639
  }
2640
- return e && typeof e == "object" && "value" in e ? U(e.value) : 0;
2640
+ return e && typeof e == "object" && "value" in e ? W(e.value) : 0;
2641
2641
  }
2642
- function Qe(e) {
2642
+ function $e(e) {
2643
2643
  let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
2644
2644
  for (let e of t) e?.name && n.set(e.name, e);
2645
2645
  return {
2646
- identity: V(H(n.get("identity")?.value)),
2647
- sessionKey: V(H(n.get("sessionKey")?.value)),
2648
- app: V(H(n.get("app")?.value)),
2649
- scopes: H(n.get("scopes")?.value),
2650
- grantedAt: U(n.get("grantedAt")?.value),
2651
- expiresAt: U(n.get("expiresAt")?.value),
2652
- permissionsHash: Ze(n.get("permissionsHash")?.value)
2646
+ identity: H(U(n.get("identity")?.value)),
2647
+ sessionKey: H(U(n.get("sessionKey")?.value)),
2648
+ app: H(U(n.get("app")?.value)),
2649
+ scopes: U(n.get("scopes")?.value),
2650
+ grantedAt: W(n.get("grantedAt")?.value),
2651
+ expiresAt: W(n.get("expiresAt")?.value),
2652
+ permissionsHash: Qe(n.get("permissionsHash")?.value)
2653
2653
  };
2654
2654
  }
2655
- function $e(e) {
2655
+ function et(e) {
2656
2656
  let t = Math.floor((e.now ?? Date.now()) / 1e3), n = [], r = e.expectedScopes ?? "publish,revoke", i = e.expirationTime, a = e.decoded.expiresAt;
2657
2657
  return typeof i == "number" && i > 0 && t >= i || a > 0 && t >= a ? {
2658
2658
  status: "expired",
@@ -2668,43 +2668,43 @@ function $e(e) {
2668
2668
  warnings: n
2669
2669
  });
2670
2670
  }
2671
- function et(e) {
2672
- return "0x" + m(new TextEncoder().encode(e));
2671
+ function tt(e) {
2672
+ return "0x" + h(new TextEncoder().encode(e));
2673
2673
  }
2674
2674
  //#endregion
2675
2675
  //#region src/publishAuthorization.ts
2676
- async function tt(t = {}) {
2677
- let { identities: n, sessionKeys: r, apps: i, schemaUid: o, excludeRevoked: s = !0 } = t, c = {};
2678
- o ? c.schemaId = { equals: o } : c.schema = { is: { schemaNames: { some: { name: { equals: B } } } } }, n?.length && (c.attester = { in: n.map((e) => {
2676
+ async function nt(e = {}) {
2677
+ let { identities: t, sessionKeys: n, apps: r, schemaUid: i, excludeRevoked: a = !0 } = e, o = {};
2678
+ i ? o.schemaId = { equals: i } : o.schema = { is: { schemaNames: { some: { name: { equals: Ye } } } } }, t?.length && (o.attester = { in: t.map((e) => {
2679
2679
  try {
2680
- return g(e);
2680
+ return _(e);
2681
2681
  } catch {
2682
2682
  return e;
2683
2683
  }
2684
- }) }), r?.length && (c.recipient = { in: r.map((e) => {
2684
+ }) }), n?.length && (o.recipient = { in: n.map((e) => {
2685
2685
  try {
2686
- return g(e);
2686
+ return _(e);
2687
2687
  } catch {
2688
2688
  return e;
2689
2689
  }
2690
- }) }), s && (c = v(c));
2691
- let l = a.getQueryClient(), u = e.getEasClient(), { itemSeeds: d } = await l.fetchQuery({
2690
+ }) }), a && (o = v(o));
2691
+ let s = p.getQueryClient(), c = m.getEasClient(), { itemSeeds: l } = await s.fetchQuery({
2692
2692
  queryKey: [
2693
2693
  "getPublishAuthorizationFromEas",
2694
- s,
2695
- o ?? "seedprotocol.publishAuthorization",
2694
+ a,
2695
+ i ?? "seedprotocol.publishAuthorization",
2696
+ [...t ?? []].map((e) => e.toLowerCase()).sort(),
2696
2697
  [...n ?? []].map((e) => e.toLowerCase()).sort(),
2697
- [...r ?? []].map((e) => e.toLowerCase()).sort(),
2698
- [...i ?? []].map((e) => e.toLowerCase()).sort()
2698
+ [...r ?? []].map((e) => e.toLowerCase()).sort()
2699
2699
  ],
2700
- queryFn: async () => u.request(x, { where: c })
2700
+ queryFn: async () => c.request(S, { where: o })
2701
2701
  });
2702
- if (!i?.length) return d;
2703
- let f = new Set(i.map((e) => e.toLowerCase()));
2704
- return d.filter((e) => {
2702
+ if (!r?.length) return l;
2703
+ let u = new Set(r.map((e) => e.toLowerCase()));
2704
+ return l.filter((e) => {
2705
2705
  try {
2706
- let t = Qe(e.decodedDataJson ?? "[]");
2707
- return f.has(t.app.toLowerCase());
2706
+ let t = $e(e.decodedDataJson ?? "[]");
2707
+ return u.has(t.app.toLowerCase());
2708
2708
  } catch {
2709
2709
  return !1;
2710
2710
  }
@@ -2712,97 +2712,102 @@ async function tt(t = {}) {
2712
2712
  }
2713
2713
  //#endregion
2714
2714
  //#region src/publishedByHelpers.ts
2715
- var nt = "bytes32 seedUid,bytes32 versionUid,bytes32[] attestationUids,bytes32 batchHash,string toolName,string toolVersion", rt = "seedprotocol.publishedBy";
2716
- function it(e) {
2715
+ var rt = "bytes32 seedUid,bytes32 versionUid,bytes32[] attestationUids,bytes32 batchHash,string toolName,string toolVersion", it = "seedprotocol.publishedBy";
2716
+ function at(e) {
2717
2717
  let t = e.startsWith("0x") || e.startsWith("0X") ? e.slice(2) : e, n = new Uint8Array(t.length / 2);
2718
2718
  for (let e = 0; e < n.length; e++) n[e] = parseInt(t.slice(e * 2, e * 2 + 2), 16);
2719
2719
  return n;
2720
2720
  }
2721
- function at(e) {
2722
- let t = [...e].map((e) => O(e)).filter((e) => e !== "" && Pe(e)).sort();
2723
- if (t.length === 0) return "0x" + m(/* @__PURE__ */ new Uint8Array());
2721
+ function ot(e) {
2722
+ let t = [...e].map((e) => F(e)).filter((e) => e !== "" && P(e)).sort();
2723
+ if (t.length === 0) return "0x" + h(/* @__PURE__ */ new Uint8Array());
2724
2724
  let n = new Uint8Array(t.length * 32);
2725
- for (let e = 0; e < t.length; e++) n.set(it(t[e]), e * 32);
2726
- return "0x" + m(n);
2725
+ for (let e = 0; e < t.length; e++) n.set(at(t[e]), e * 32);
2726
+ return "0x" + h(n);
2727
2727
  }
2728
- function ot(e) {
2729
- return O(at(e.attestationUids)) === O(e.batchHash);
2728
+ function st(e) {
2729
+ return F(ot(e.attestationUids)) === F(e.batchHash);
2730
2730
  }
2731
- function W(e) {
2732
- return typeof e == "string" ? O(e) : e && typeof e == "object" && "hex" in e ? O(String(e.hex)) : O(String(e ?? ""));
2731
+ function G(e) {
2732
+ return typeof e == "string" ? F(e) : e && typeof e == "object" && "hex" in e ? F(String(e.hex)) : F(String(e ?? ""));
2733
2733
  }
2734
- function st(e) {
2734
+ function ct(e) {
2735
2735
  return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
2736
2736
  }
2737
- function ct(e) {
2737
+ function lt(e) {
2738
2738
  let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
2739
2739
  for (let e of t) e?.name && n.set(e.name, e);
2740
2740
  let r = n.get("attestationUids")?.value, i = [];
2741
- return Array.isArray(r) ? i = r.map((e) => W(e)) : r && typeof r == "object" && Array.isArray(r.value) && (i = r.value.map((e) => W(e))), {
2742
- seedUid: W(n.get("seedUid")?.value),
2743
- versionUid: W(n.get("versionUid")?.value),
2741
+ return Array.isArray(r) ? i = r.map((e) => G(e)) : r && typeof r == "object" && Array.isArray(r.value) && (i = r.value.map((e) => G(e))), {
2742
+ seedUid: G(n.get("seedUid")?.value),
2743
+ versionUid: G(n.get("versionUid")?.value),
2744
2744
  attestationUids: i,
2745
- batchHash: W(n.get("batchHash")?.value),
2746
- toolName: st(n.get("toolName")?.value),
2747
- toolVersion: st(n.get("toolVersion")?.value)
2745
+ batchHash: G(n.get("batchHash")?.value),
2746
+ toolName: ct(n.get("toolName")?.value),
2747
+ toolVersion: ct(n.get("toolVersion")?.value)
2748
2748
  };
2749
2749
  }
2750
2750
  //#endregion
2751
2751
  //#region src/publishedBy.ts
2752
- async function lt(t) {
2753
- let { toolAddresses: n, refUIDs: r, schemaUid: i, excludeRevoked: o = !0 } = t;
2754
- if (!n.length) return [];
2755
- let s = n.map((e) => {
2752
+ async function ut(e) {
2753
+ let { toolAddresses: t, refUIDs: n, schemaUid: r, excludeRevoked: i = !0 } = e;
2754
+ if (!t.length) return [];
2755
+ let a = t.map((e) => {
2756
2756
  try {
2757
- return g(e);
2757
+ return _(e);
2758
2758
  } catch {
2759
2759
  return e;
2760
2760
  }
2761
- }), c = { attester: { in: s } };
2762
- i ? c.schemaId = { equals: i } : c.schema = { is: { schemaNames: { some: { name: { equals: rt } } } } }, r?.length && (c.refUID = { in: r }), o && (c = v(c));
2763
- let l = a.getQueryClient(), u = e.getEasClient(), { itemSeeds: d } = await l.fetchQuery({
2761
+ }), o = { attester: { in: a } };
2762
+ r ? o.schemaId = { equals: r } : o.schema = { is: { schemaNames: { some: { name: { equals: it } } } } }, n?.length && (o.refUID = { in: n }), i && (o = v(o));
2763
+ let s = p.getQueryClient(), c = m.getEasClient(), { itemSeeds: l } = await s.fetchQuery({
2764
2764
  queryKey: [
2765
2765
  "getPublishedByFromEas",
2766
- o,
2767
- i ?? "seedprotocol.publishedBy",
2768
- [...s].sort(),
2769
- [...r ?? []].sort()
2766
+ i,
2767
+ r ?? "seedprotocol.publishedBy",
2768
+ [...a].sort(),
2769
+ [...n ?? []].sort()
2770
2770
  ],
2771
- queryFn: async () => u.request(x, { where: c })
2771
+ queryFn: async () => c.request(S, { where: o })
2772
2772
  });
2773
- return d;
2773
+ return l;
2774
+ }
2775
+ //#endregion
2776
+ //#region src/default/index.ts
2777
+ function dt() {
2778
+ m.isConfigured() || m.configure(new u()), p.isConfigured() || p.configure(new f());
2774
2779
  }
2775
2780
  //#endregion
2776
2781
  //#region src/stores/schemaUidCache.ts
2777
- var G = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), q = 3e5, J = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), Z = 0, ut = (e) => {
2778
- let t = "";
2782
+ var K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), ft = 3e5, J = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), Z = 0, pt = (e) => {
2783
+ let n = "";
2779
2784
  try {
2780
- t = p();
2785
+ n = t();
2781
2786
  } catch {}
2782
- return `${t}\n${e}`;
2787
+ return `${n}\n${e}`;
2783
2788
  }, Q = async (e, t) => {
2784
- let n = ut(e), r = Y.get(n);
2789
+ let n = pt(e), r = Y.get(n);
2785
2790
  if (r !== void 0) {
2786
2791
  if (Date.now() < r) return;
2787
2792
  Y.delete(n);
2788
2793
  }
2789
2794
  let i = X.get(n);
2790
2795
  if (i) return i;
2791
- let a = Z, o = t().then((e) => (!e && a === Z && Y.set(n, Date.now() + q), e)).finally(() => {
2796
+ let a = Z, o = t().then((e) => (!e && a === Z && Y.set(n, Date.now() + ft), e)).finally(() => {
2792
2797
  X.get(n) === o && X.delete(n);
2793
2798
  });
2794
2799
  return X.set(n, o), o;
2795
2800
  }, $ = () => {
2796
2801
  Z++, Y.clear(), X.clear();
2797
- }, dt = () => {
2798
- G.clear(), K.clear(), J.clear(), $();
2799
- }, ft = ({ text: e, schemaUid: t }) => {
2800
- G.set(h(e), t), $();
2801
- }, pt = ({ modelName: e, schemaUid: t }) => {
2802
- K.set(e.toLowerCase(), t), $();
2803
- }, mt = (e) => K.get(e.toLowerCase()), ht = async ({ schemaText: e }) => {
2804
- let t = h(e);
2805
- if (!G.has(t)) {
2802
+ }, mt = () => {
2803
+ K.clear(), q.clear(), J.clear(), $();
2804
+ }, ht = ({ text: e, schemaUid: t }) => {
2805
+ K.set(g(e), t), $();
2806
+ }, gt = ({ modelName: e, schemaUid: t }) => {
2807
+ q.set(e.toLowerCase(), t), $();
2808
+ }, _t = (e) => q.get(e.toLowerCase()), vt = async ({ schemaText: e }) => {
2809
+ let t = g(e);
2810
+ if (!K.has(t)) {
2806
2811
  let e;
2807
2812
  try {
2808
2813
  e = await Q(`schemaName:${t}`, () => E({ schemaName: t }));
@@ -2810,24 +2815,24 @@ var G = /* @__PURE__ */ new Map(), K = /* @__PURE__ */ new Map(), q = 3e5, J = /
2810
2815
  process.env.NODE_ENV === "development" && console.warn(`Failed to fetch schema for schema name ${t}:`, e);
2811
2816
  return;
2812
2817
  }
2813
- return e && G.set(t, e), e;
2818
+ return e && K.set(t, e), e;
2814
2819
  }
2815
- return G.get(t);
2816
- }, gt = async (t) => {
2817
- let n = ut(t), r = J.get(n);
2818
- if (r) return r;
2819
- let i = a.getQueryClient(), o = e.getEasClient();
2820
- if (!i || !o) return;
2821
- let s = await Q(`definition:${t}`, async () => {
2822
- let e = await i.fetchQuery({
2823
- queryKey: ["getSchemaByDefinition", t],
2824
- queryFn: async () => o.request(ce, { where: { schema: { equals: t } } })
2825
- }), n = e?.schemas ?? e?.data?.schemas;
2820
+ return K.get(t);
2821
+ }, yt = async (e) => {
2822
+ let t = pt(e), n = J.get(t);
2823
+ if (n) return n;
2824
+ let r = p.getQueryClient(), i = m.getEasClient();
2825
+ if (!r || !i) return;
2826
+ let a = await Q(`definition:${e}`, async () => {
2827
+ let t = await r.fetchQuery({
2828
+ queryKey: ["getSchemaByDefinition", e],
2829
+ queryFn: async () => i.request(x, { where: { schema: { equals: e } } })
2830
+ }), n = t?.schemas ?? t?.data?.schemas;
2826
2831
  return Array.isArray(n) && n.length > 0 ? n[0].id : void 0;
2827
2832
  });
2828
- return s && J.set(n, s), s;
2833
+ return a && J.set(t, a), a;
2829
2834
  };
2830
2835
  //#endregion
2831
- export { e as BaseEasClient, e as EasClient, a as BaseQueryClient, c as DEFAULT_EAS_CHAIN_ID, Re as DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS, Be as DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS, Ie as DOMAIN_OWNERSHIP_METHOD, Fe as DOMAIN_OWNERSHIP_SCHEMA_DEF, k as DOMAIN_OWNERSHIP_SCHEMA_NAME, Le as DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE, ze as DOMAIN_OWNERSHIP_SOFT_STALE_MS, A as DOMAIN_OWNERSHIP_TXT_LABEL, ne as EAS_CHAIN_DEPLOYMENTS, Me as EAS_ENDPOINT, de as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, T as GET_ATTESTATION_CHANGES, fe as GET_FILES_METADATA, pe as GET_IMAGE_SEEDS, me as GET_IMAGE_VERSIONS, w as GET_PROPERTIES, b as GET_SCHEMAS, ce as GET_SCHEMA_BY_NAME, x as GET_SEEDS, S as GET_SEEDS_LEAN, le as GET_SEED_IDS, ue as GET_STORAGE_TRANSACTION_ID, C as GET_VERSIONS, r as OP_STACK_EAS_CONTRACT_ADDRESS, i as OP_STACK_SCHEMA_REGISTRY_ADDRESS, nt as PUBLISHED_BY_SCHEMA_DEF, rt as PUBLISHED_BY_SCHEMA_NAME, Xe as PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS, Je as PUBLISH_AUTHORIZATION_SCHEMA_DEF, B as PUBLISH_AUTHORIZATION_SCHEMA_NAME, Ye as PUBLISH_AUTHORIZATION_SCOPES, q as SCHEMA_LOOKUP_MISS_TTL_MS, ke as ZERO_ADDRESS, Ae as ZERO_BYTES, je as ZERO_BYTES32, Ke as assessDomainOwnership, $e as assessPublishAuthorization, He as buildDomainOwnershipTxtValue, Q as cachedSchemaLookup, g as checksumAddress, $ as clearSchemaLookupMisses, te as configureEasReadChain, R as decodeDomainOwnershipData, Qe as decodePublishAuthorizationData, ct as decodePublishedByData, Ve as domainOwnershipTxtName, u as expectEasReadChain, E as fetchEasSchemaUidBySchemaName, De as getAttestationChangesSince, _e as getCanonicalItemPropertiesFromEas, qe as getDomainOwnershipFromEas, f as getEasAttestationExplorerUrl, l as getEasChainDeployment, p as getEasEndpoint, s as getEasReadChainId, ve as getEasSchemaUidBySchemaName, gt as getEasSchemaUidForExactDefinition, ht as getEasSchemaUidForSchemaDefinition, ge as getItemPropertiesFromEas, he as getItemVersionsFromEas, tt as getPublishAuthorizationFromEas, lt as getPublishedByFromEas, we as getSchemaNamesBySchemaUids, mt as getSchemaUidForModelFromCache, Oe as getSeedUidsBySchemaName, be as getSeedsBySchemaName, Te as getSeedsByUidsFromEas, ye as getSeedsFromSchemaUids, We as hashDomainOwnershipChallenge, P as hashDomainRegistryFingerprint, et as hashPublishAuthorizationMaterial, at as hashPublishedByBatch, t as isEasReadChainConfigured, d as isEasReadChainSettled, Ne as isPlaceholderUid, Pe as isValidEasAttestationUid, O as normalizeBytes32Hex, Ue as parseDomainOwnershipTxtValue, oe as pickLatestPropertyAttestationsByRefAndSchema, ee as resetEasReadChain, Ce as resetSchemaNamesCache, dt as resetSchemaUidCaches, o as resolveEasChainDeployment, pt as setSchemaUidForModel, ft as setSchemaUidForSchemaDefinition, h as toSnakeCase, ot as verifyPublishedByBatch, n as whenEasReadChainSettled, v as withExcludeRevokedFilter };
2836
+ export { m as BaseEasClient, m as EasClient, p as BaseQueryClient, r as DEFAULT_EAS_CHAIN_ID, Ne as DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS, Fe as DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS, je as DOMAIN_OWNERSHIP_METHOD, Ae as DOMAIN_OWNERSHIP_SCHEMA_DEF, I as DOMAIN_OWNERSHIP_SCHEMA_NAME, Me as DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE, Pe as DOMAIN_OWNERSHIP_SOFT_STALE_MS, L as DOMAIN_OWNERSHIP_TXT_LABEL, u as DefaultEasClient, f as DefaultQueryClient, i as EAS_CHAIN_DEPLOYMENTS, ke as EAS_ENDPOINT, me as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, w as GET_ATTESTATION_CHANGES, he as GET_FILES_METADATA, ge as GET_IMAGE_SEEDS, _e as GET_IMAGE_VERSIONS, pe as GET_PROPERTIES, b as GET_SCHEMAS, x as GET_SCHEMA_BY_NAME, S as GET_SEEDS, C as GET_SEEDS_LEAN, ue as GET_SEED_IDS, de as GET_STORAGE_TRANSACTION_ID, fe as GET_VERSIONS, ee as OP_STACK_EAS_CONTRACT_ADDRESS, l as OP_STACK_SCHEMA_REGISTRY_ADDRESS, rt as PUBLISHED_BY_SCHEMA_DEF, it as PUBLISHED_BY_SCHEMA_NAME, Ze as PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS, Je as PUBLISH_AUTHORIZATION_SCHEMA_DEF, Ye as PUBLISH_AUTHORIZATION_SCHEMA_NAME, Xe as PUBLISH_AUTHORIZATION_SCOPES, ft as SCHEMA_LOOKUP_MISS_TTL_MS, Ee as ZERO_ADDRESS, De as ZERO_BYTES, Oe as ZERO_BYTES32, Ge as assessDomainOwnership, et as assessPublishAuthorization, Re as buildDomainOwnershipTxtValue, Q as cachedSchemaLookup, _ as checksumAddress, $ as clearSchemaLookupMisses, te as configureEasReadChain, Ue as decodeDomainOwnershipData, $e as decodePublishAuthorizationData, lt as decodePublishedByData, Le as domainOwnershipTxtName, dt as ensureEasPlatform, s as expectEasReadChain, E as fetchEasSchemaUidBySchemaName, we as getAttestationChangesSince, ye as getCanonicalItemPropertiesFromEas, qe as getDomainOwnershipFromEas, o as getEasAttestationExplorerUrl, a as getEasChainDeployment, t as getEasEndpoint, d as getEasReadChainId, be as getEasSchemaUidBySchemaName, yt as getEasSchemaUidForExactDefinition, vt as getEasSchemaUidForSchemaDefinition, T as getItemPropertiesFromEas, ve as getItemVersionsFromEas, nt as getPublishAuthorizationFromEas, ut as getPublishedByFromEas, j as getSchemaNamesBySchemaUids, _t as getSchemaUidForModelFromCache, Te as getSeedUidsBySchemaName, D as getSeedsBySchemaName, Ce as getSeedsByUidsFromEas, xe as getSeedsFromSchemaUids, Be as hashDomainOwnershipChallenge, B as hashDomainRegistryFingerprint, tt as hashPublishAuthorizationMaterial, ot as hashPublishedByBatch, ne as isEasReadChainConfigured, n as isEasReadChainSettled, N as isPlaceholderUid, P as isValidEasAttestationUid, F as normalizeBytes32Hex, ze as parseDomainOwnershipTxtValue, ce as pickLatestPropertyAttestationsByRefAndSchema, c as resetEasReadChain, Se as resetSchemaNamesCache, mt as resetSchemaUidCaches, e as resolveEasChainDeployment, gt as setSchemaUidForModel, ht as setSchemaUidForSchemaDefinition, g as toSnakeCase, st as verifyPublishedByBatch, re as whenEasReadChainSettled, v as withExcludeRevokedFilter };
2832
2837
 
2833
2838
  //# sourceMappingURL=index.js.map