@seedprotocol/eas 0.7.1 → 0.7.2-next.593.gd5bd4ea

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
@@ -18,7 +18,7 @@ function g(e) {
18
18
  }
19
19
  //#endregion
20
20
  //#region src/easPropertyCanonical.ts
21
- var oe = (e) => {
21
+ var _ = (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 oe = (e) => {
28
28
  }
29
29
  return t;
30
30
  };
31
- function se(e, t) {
32
- let n = oe(e.filter((e) => !e.revoked));
31
+ function oe(e, t) {
32
+ let n = _(e.filter((e) => !e.revoked));
33
33
  if (t?.ifAllRevoked !== "newestRevoked") return [...n.values()];
34
- let r = oe(e.filter((e) => e.revoked));
34
+ let r = _(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/easRevokedFilter.ts
40
- function _(e) {
40
+ function v(e) {
41
41
  let t = { revoked: { equals: !1 } }, n = Array.isArray(e.AND) ? e.AND : [];
42
42
  return {
43
43
  ...e,
@@ -46,8 +46,8 @@ function _(e) {
46
46
  }
47
47
  //#endregion
48
48
  //#region src/graphql/gql/gql.ts
49
- var ce = {
50
- "\n fragment attestationFields on Attestation {\n id\n decodedDataJson\n attester\n schema {\n schemaNames {\n name\n }\n }\n refUID\n revoked\n revocationTime\n schemaId\n txid\n timeCreated\n time\n isOffchain\n }\n": {
49
+ var se = {
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: [{
53
53
  kind: "FragmentDefinition",
@@ -86,33 +86,6 @@ var ce = {
86
86
  value: "attester"
87
87
  }
88
88
  },
89
- {
90
- kind: "Field",
91
- name: {
92
- kind: "Name",
93
- value: "schema"
94
- },
95
- selectionSet: {
96
- kind: "SelectionSet",
97
- selections: [{
98
- kind: "Field",
99
- name: {
100
- kind: "Name",
101
- value: "schemaNames"
102
- },
103
- selectionSet: {
104
- kind: "SelectionSet",
105
- selections: [{
106
- kind: "Field",
107
- name: {
108
- kind: "Name",
109
- value: "name"
110
- }
111
- }]
112
- }
113
- }]
114
- }
115
- },
116
89
  {
117
90
  kind: "Field",
118
91
  name: {
@@ -702,6 +675,223 @@ var ce = {
702
675
  }
703
676
  }]
704
677
  },
678
+ "\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": {
679
+ kind: "Document",
680
+ definitions: [{
681
+ kind: "OperationDefinition",
682
+ operation: "query",
683
+ name: {
684
+ kind: "Name",
685
+ value: "GetSeedsLean"
686
+ },
687
+ variableDefinitions: [
688
+ {
689
+ kind: "VariableDefinition",
690
+ variable: {
691
+ kind: "Variable",
692
+ name: {
693
+ kind: "Name",
694
+ value: "where"
695
+ }
696
+ },
697
+ type: {
698
+ kind: "NonNullType",
699
+ type: {
700
+ kind: "NamedType",
701
+ name: {
702
+ kind: "Name",
703
+ value: "AttestationWhereInput"
704
+ }
705
+ }
706
+ }
707
+ },
708
+ {
709
+ kind: "VariableDefinition",
710
+ variable: {
711
+ kind: "Variable",
712
+ name: {
713
+ kind: "Name",
714
+ value: "take"
715
+ }
716
+ },
717
+ type: {
718
+ kind: "NamedType",
719
+ name: {
720
+ kind: "Name",
721
+ value: "Int"
722
+ }
723
+ }
724
+ },
725
+ {
726
+ kind: "VariableDefinition",
727
+ variable: {
728
+ kind: "Variable",
729
+ name: {
730
+ kind: "Name",
731
+ value: "skip"
732
+ }
733
+ },
734
+ type: {
735
+ kind: "NamedType",
736
+ name: {
737
+ kind: "Name",
738
+ value: "Int"
739
+ }
740
+ }
741
+ }
742
+ ],
743
+ selectionSet: {
744
+ kind: "SelectionSet",
745
+ selections: [{
746
+ kind: "Field",
747
+ alias: {
748
+ kind: "Name",
749
+ value: "itemSeeds"
750
+ },
751
+ name: {
752
+ kind: "Name",
753
+ value: "attestations"
754
+ },
755
+ arguments: [
756
+ {
757
+ kind: "Argument",
758
+ name: {
759
+ kind: "Name",
760
+ value: "where"
761
+ },
762
+ value: {
763
+ kind: "Variable",
764
+ name: {
765
+ kind: "Name",
766
+ value: "where"
767
+ }
768
+ }
769
+ },
770
+ {
771
+ kind: "Argument",
772
+ name: {
773
+ kind: "Name",
774
+ value: "orderBy"
775
+ },
776
+ value: {
777
+ kind: "ListValue",
778
+ values: [{
779
+ kind: "ObjectValue",
780
+ fields: [{
781
+ kind: "ObjectField",
782
+ name: {
783
+ kind: "Name",
784
+ value: "timeCreated"
785
+ },
786
+ value: {
787
+ kind: "EnumValue",
788
+ value: "desc"
789
+ }
790
+ }]
791
+ }]
792
+ }
793
+ },
794
+ {
795
+ kind: "Argument",
796
+ name: {
797
+ kind: "Name",
798
+ value: "take"
799
+ },
800
+ value: {
801
+ kind: "Variable",
802
+ name: {
803
+ kind: "Name",
804
+ value: "take"
805
+ }
806
+ }
807
+ },
808
+ {
809
+ kind: "Argument",
810
+ name: {
811
+ kind: "Name",
812
+ value: "skip"
813
+ },
814
+ value: {
815
+ kind: "Variable",
816
+ name: {
817
+ kind: "Name",
818
+ value: "skip"
819
+ }
820
+ }
821
+ }
822
+ ],
823
+ selectionSet: {
824
+ kind: "SelectionSet",
825
+ selections: [
826
+ {
827
+ kind: "Field",
828
+ name: {
829
+ kind: "Name",
830
+ value: "id"
831
+ }
832
+ },
833
+ {
834
+ kind: "Field",
835
+ name: {
836
+ kind: "Name",
837
+ value: "decodedDataJson"
838
+ }
839
+ },
840
+ {
841
+ kind: "Field",
842
+ name: {
843
+ kind: "Name",
844
+ value: "attester"
845
+ }
846
+ },
847
+ {
848
+ kind: "Field",
849
+ name: {
850
+ kind: "Name",
851
+ value: "refUID"
852
+ }
853
+ },
854
+ {
855
+ kind: "Field",
856
+ name: {
857
+ kind: "Name",
858
+ value: "revoked"
859
+ }
860
+ },
861
+ {
862
+ kind: "Field",
863
+ name: {
864
+ kind: "Name",
865
+ value: "revocationTime"
866
+ }
867
+ },
868
+ {
869
+ kind: "Field",
870
+ name: {
871
+ kind: "Name",
872
+ value: "schemaId"
873
+ }
874
+ },
875
+ {
876
+ kind: "Field",
877
+ name: {
878
+ kind: "Name",
879
+ value: "timeCreated"
880
+ }
881
+ },
882
+ {
883
+ kind: "Field",
884
+ name: {
885
+ kind: "Name",
886
+ value: "isOffchain"
887
+ }
888
+ }
889
+ ]
890
+ }
891
+ }]
892
+ }
893
+ }]
894
+ },
705
895
  "\n query GetSeedIds($where: AttestationWhereInput!) {\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n }\n }\n": {
706
896
  kind: "Document",
707
897
  definitions: [{
@@ -1012,38 +1202,11 @@ var ce = {
1012
1202
  value: "decodedDataJson"
1013
1203
  }
1014
1204
  },
1015
- {
1016
- kind: "Field",
1017
- name: {
1018
- kind: "Name",
1019
- value: "attester"
1020
- }
1021
- },
1022
- {
1023
- kind: "Field",
1024
- name: {
1025
- kind: "Name",
1026
- value: "schema"
1027
- },
1028
- selectionSet: {
1029
- kind: "SelectionSet",
1030
- selections: [{
1031
- kind: "Field",
1032
- name: {
1033
- kind: "Name",
1034
- value: "schemaNames"
1035
- },
1036
- selectionSet: {
1037
- kind: "SelectionSet",
1038
- selections: [{
1039
- kind: "Field",
1040
- name: {
1041
- kind: "Name",
1042
- value: "name"
1043
- }
1044
- }]
1045
- }
1046
- }]
1205
+ {
1206
+ kind: "Field",
1207
+ name: {
1208
+ kind: "Name",
1209
+ value: "attester"
1047
1210
  }
1048
1211
  },
1049
1212
  {
@@ -1233,33 +1396,6 @@ var ce = {
1233
1396
  value: "attester"
1234
1397
  }
1235
1398
  },
1236
- {
1237
- kind: "Field",
1238
- name: {
1239
- kind: "Name",
1240
- value: "schema"
1241
- },
1242
- selectionSet: {
1243
- kind: "SelectionSet",
1244
- selections: [{
1245
- kind: "Field",
1246
- name: {
1247
- kind: "Name",
1248
- value: "schemaNames"
1249
- },
1250
- selectionSet: {
1251
- kind: "SelectionSet",
1252
- selections: [{
1253
- kind: "Field",
1254
- name: {
1255
- kind: "Name",
1256
- value: "name"
1257
- }
1258
- }]
1259
- }
1260
- }]
1261
- }
1262
- },
1263
1399
  {
1264
1400
  kind: "Field",
1265
1401
  name: {
@@ -1447,33 +1583,6 @@ var ce = {
1447
1583
  value: "attester"
1448
1584
  }
1449
1585
  },
1450
- {
1451
- kind: "Field",
1452
- name: {
1453
- kind: "Name",
1454
- value: "schema"
1455
- },
1456
- selectionSet: {
1457
- kind: "SelectionSet",
1458
- selections: [{
1459
- kind: "Field",
1460
- name: {
1461
- kind: "Name",
1462
- value: "schemaNames"
1463
- },
1464
- selectionSet: {
1465
- kind: "SelectionSet",
1466
- selections: [{
1467
- kind: "Field",
1468
- name: {
1469
- kind: "Name",
1470
- value: "name"
1471
- }
1472
- }]
1473
- }
1474
- }]
1475
- }
1476
- },
1477
1586
  {
1478
1587
  kind: "Field",
1479
1588
  name: {
@@ -1661,33 +1770,6 @@ var ce = {
1661
1770
  value: "attester"
1662
1771
  }
1663
1772
  },
1664
- {
1665
- kind: "Field",
1666
- name: {
1667
- kind: "Name",
1668
- value: "schema"
1669
- },
1670
- selectionSet: {
1671
- kind: "SelectionSet",
1672
- selections: [{
1673
- kind: "Field",
1674
- name: {
1675
- kind: "Name",
1676
- value: "schemaNames"
1677
- },
1678
- selectionSet: {
1679
- kind: "SelectionSet",
1680
- selections: [{
1681
- kind: "Field",
1682
- name: {
1683
- kind: "Name",
1684
- value: "name"
1685
- }
1686
- }]
1687
- }
1688
- }]
1689
- }
1690
- },
1691
1773
  {
1692
1774
  kind: "Field",
1693
1775
  name: {
@@ -2059,33 +2141,6 @@ var ce = {
2059
2141
  value: "attester"
2060
2142
  }
2061
2143
  },
2062
- {
2063
- kind: "Field",
2064
- name: {
2065
- kind: "Name",
2066
- value: "schema"
2067
- },
2068
- selectionSet: {
2069
- kind: "SelectionSet",
2070
- selections: [{
2071
- kind: "Field",
2072
- name: {
2073
- kind: "Name",
2074
- value: "schemaNames"
2075
- },
2076
- selectionSet: {
2077
- kind: "SelectionSet",
2078
- selections: [{
2079
- kind: "Field",
2080
- name: {
2081
- kind: "Name",
2082
- value: "name"
2083
- }
2084
- }]
2085
- }
2086
- }]
2087
- }
2088
- },
2089
2144
  {
2090
2145
  kind: "Field",
2091
2146
  name: {
@@ -2145,49 +2200,141 @@ var ce = {
2145
2200
  ]
2146
2201
  }
2147
2202
  }]
2203
+ },
2204
+ "\n query GetAttestationChanges($where: AttestationWhereInput!) {\n changes: attestations(where: $where) {\n id\n refUID\n timeCreated\n revocationTime\n }\n }\n": {
2205
+ kind: "Document",
2206
+ definitions: [{
2207
+ kind: "OperationDefinition",
2208
+ operation: "query",
2209
+ name: {
2210
+ kind: "Name",
2211
+ value: "GetAttestationChanges"
2212
+ },
2213
+ variableDefinitions: [{
2214
+ kind: "VariableDefinition",
2215
+ variable: {
2216
+ kind: "Variable",
2217
+ name: {
2218
+ kind: "Name",
2219
+ value: "where"
2220
+ }
2221
+ },
2222
+ type: {
2223
+ kind: "NonNullType",
2224
+ type: {
2225
+ kind: "NamedType",
2226
+ name: {
2227
+ kind: "Name",
2228
+ value: "AttestationWhereInput"
2229
+ }
2230
+ }
2231
+ }
2232
+ }],
2233
+ selectionSet: {
2234
+ kind: "SelectionSet",
2235
+ selections: [{
2236
+ kind: "Field",
2237
+ alias: {
2238
+ kind: "Name",
2239
+ value: "changes"
2240
+ },
2241
+ name: {
2242
+ kind: "Name",
2243
+ value: "attestations"
2244
+ },
2245
+ arguments: [{
2246
+ kind: "Argument",
2247
+ name: {
2248
+ kind: "Name",
2249
+ value: "where"
2250
+ },
2251
+ value: {
2252
+ kind: "Variable",
2253
+ name: {
2254
+ kind: "Name",
2255
+ value: "where"
2256
+ }
2257
+ }
2258
+ }],
2259
+ selectionSet: {
2260
+ kind: "SelectionSet",
2261
+ selections: [
2262
+ {
2263
+ kind: "Field",
2264
+ name: {
2265
+ kind: "Name",
2266
+ value: "id"
2267
+ }
2268
+ },
2269
+ {
2270
+ kind: "Field",
2271
+ name: {
2272
+ kind: "Name",
2273
+ value: "refUID"
2274
+ }
2275
+ },
2276
+ {
2277
+ kind: "Field",
2278
+ name: {
2279
+ kind: "Name",
2280
+ value: "timeCreated"
2281
+ }
2282
+ },
2283
+ {
2284
+ kind: "Field",
2285
+ name: {
2286
+ kind: "Name",
2287
+ value: "revocationTime"
2288
+ }
2289
+ }
2290
+ ]
2291
+ }
2292
+ }]
2293
+ }
2294
+ }]
2148
2295
  }
2149
2296
  };
2150
- function v(e) {
2151
- return ce[e] ?? {};
2297
+ function y(e) {
2298
+ return se[e] ?? {};
2152
2299
  }
2153
2300
  //#endregion
2154
2301
  //#region src/queries.ts
2155
- var y = v("\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), b = v("\n query GetSchemaByName($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n"), x = v("\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"), le = v("\n query GetSeedIds($where: AttestationWhereInput!) {\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n }\n }\n"), ue = v("\n query GetStorageTransactionId($where: AttestationWhereInput!) {\n storageTransactionId: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n id\n decodedDataJson\n }\n }\n"), S = v("\n query GetVersions($where: AttestationWhereInput!) {\n itemVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), C = v("\n query GetProperties($where: AttestationWhereInput!) {\n itemProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), de = v("\n query GetAllPropertiesForAllVersions($where: AttestationWhereInput!) {\n allProperties: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), fe = v("\n query GetFilesMetadata($where: AttestationWhereInput!) {\n filesMetadata: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), pe = v("\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 = v("\n query GetImageVersions($where: AttestationWhereInput!) {\n imageVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"), he = async ({ seedUids: t, excludeRevoked: n = !0 }) => {
2156
- let r = a.getQueryClient(), i = e.getEasClient(), o = n ? _({ 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"), 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({
2157
2304
  queryKey: [
2158
2305
  "getVersionsForAllModels",
2159
2306
  [...t].sort(),
2160
2307
  n
2161
2308
  ],
2162
- queryFn: async () => i.request(S, { where: o })
2309
+ queryFn: async () => i.request(C, { where: o })
2163
2310
  });
2164
2311
  return s;
2165
- }, w = async ({ versionUids: t, excludeRevoked: n = !0 }) => {
2166
- let r = a.getQueryClient(), i = e.getEasClient(), o = n ? _({ refUID: { in: t } }) : { refUID: { in: t } }, { itemProperties: s } = await r.fetchQuery({
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({
2167
2314
  queryKey: [
2168
2315
  "getPropertiesForAllModels",
2169
2316
  [...t].sort(),
2170
2317
  n
2171
2318
  ],
2172
- queryFn: async () => i.request(C, { where: o })
2319
+ queryFn: async () => i.request(w, { where: o })
2173
2320
  });
2174
2321
  return s;
2175
- }, ge = async (e) => se(await w(e)), T = async ({ schemaName: t }) => {
2322
+ }, _e = async (e) => oe(await ge(e)), E = async ({ schemaName: t }) => {
2176
2323
  let n = a.getQueryClient(), r = e.getEasClient();
2177
2324
  if (!n || !r) return;
2178
2325
  let { schemas: i } = await n.fetchQuery({
2179
2326
  queryKey: ["getEasSchemaUidBySchemaName", t],
2180
- queryFn: async () => r.request(y, { where: { schema: { endsWith: t } } })
2327
+ queryFn: async () => r.request(b, { where: { schema: { endsWith: t } } })
2181
2328
  });
2182
2329
  if (i && i.length !== 0) return i[0].id;
2183
- }, _e = async ({ schemaName: e }) => {
2330
+ }, ve = async ({ schemaName: e }) => {
2184
2331
  try {
2185
- return await T({ schemaName: e });
2332
+ return await E({ schemaName: e });
2186
2333
  } catch (t) {
2187
2334
  process.env.NODE_ENV === "development" && console.warn(`Failed to fetch schema for schema name ${e}:`, t);
2188
2335
  return;
2189
2336
  }
2190
- }, ve = async ({ schemaUids: t, addresses: n, excludeRevoked: r = !0 }) => {
2337
+ }, ye = async ({ schemaUids: t, addresses: n, excludeRevoked: r = !0 }) => {
2191
2338
  let i = {
2192
2339
  attester: { in: n.map((e) => {
2193
2340
  try {
@@ -2198,7 +2345,7 @@ var y = v("\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schem
2198
2345
  }) },
2199
2346
  schemaId: { in: t }
2200
2347
  };
2201
- r && (i = _(i));
2348
+ r && (i = v(i));
2202
2349
  let o = a.getQueryClient(), s = e.getEasClient(), { itemSeeds: c } = await o.fetchQuery({
2203
2350
  queryKey: [
2204
2351
  "getSeedsForAllModels",
@@ -2209,51 +2356,113 @@ var y = v("\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schem
2209
2356
  queryFn: async () => s.request(x, { where: i })
2210
2357
  });
2211
2358
  return c;
2212
- }, E = async (t, n = 10, r) => {
2213
- let i = r ?? 0, o = {
2214
- where: _({ schema: { is: { schemaNames: { some: { name: { equals: t } } } } } }),
2359
+ }, be = async (t, n = 10, r, i) => {
2360
+ let o = r ?? 0, s = i?.uidPrefix, c = {
2361
+ where: v({
2362
+ ...s === void 0 ? {} : { id: { startsWith: s } },
2363
+ schema: { is: { schemaNames: { some: { name: { equals: t } } } } }
2364
+ }),
2215
2365
  take: n,
2216
- skip: i
2217
- }, s = a.getQueryClient(), c = e.getEasClient(), { itemSeeds: l } = await s.fetchQuery({
2366
+ skip: o
2367
+ }, l = a.getQueryClient(), u = e.getEasClient(), { itemSeeds: d } = await l.fetchQuery({
2218
2368
  queryKey: [
2219
2369
  "getSeedsBySchemaName",
2220
2370
  t,
2221
2371
  n,
2222
- i
2372
+ o,
2373
+ s ?? null
2223
2374
  ],
2224
- queryFn: async () => c.request(x, o)
2375
+ queryFn: async () => u.request(S, c)
2225
2376
  });
2226
- return l;
2227
- }, ye = async (e, t = 10) => (await E(e, t)).map((e) => e.id), be = "0x0000000000000000000000000000000000000000", xe = "0x", Se = "0x0000000000000000000000000000000000000000000000000000000000000000", Ce = typeof process < "u" && process.env?.NEXT_PUBLIC_EAS_ENDPOINT || typeof process < "u" && process.env?.EAS_ENDPOINT || "https://optimism-sepolia.easscan.org/graphql";
2377
+ return d.map((e) => xe(e, [t]));
2378
+ }, xe = (e, t) => ({
2379
+ ...e,
2380
+ schema: { schemaNames: t.map((e) => ({ name: e })) }
2381
+ }), D = /* @__PURE__ */ new Map(), Se = (e) => {
2382
+ let t = "";
2383
+ try {
2384
+ t = p();
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);
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));
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({
2408
+ queryKey: [
2409
+ "getSeedsByUidsFromEas",
2410
+ [...t].sort(),
2411
+ n
2412
+ ],
2413
+ queryFn: async () => o.request(S, {
2414
+ where: r,
2415
+ take: t.length,
2416
+ skip: 0
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) => {
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) } });
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({
2427
+ queryKey: [
2428
+ "getAttestationChangesSince",
2429
+ e,
2430
+ r
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";
2228
2437
  //#endregion
2229
2438
  //#region src/easUid.ts
2230
- function D(e) {
2439
+ function Ne(e) {
2231
2440
  if (e == null || e === "" || e === "NULL") return !0;
2232
2441
  let t = e.trim();
2233
2442
  return t === "" || t.toLowerCase() === "0x0000000000000000000000000000000000000000000000000000000000000000";
2234
2443
  }
2235
- function O(e) {
2236
- if (D(e)) return !1;
2444
+ function Pe(e) {
2445
+ if (Ne(e)) return !1;
2237
2446
  let t = String(e).trim();
2238
2447
  if (!/^0x/i.test(t)) return !1;
2239
2448
  let n = t.slice(2);
2240
2449
  return n.length === 64 && /^[0-9a-fA-F]{64}$/.test(n);
2241
2450
  }
2242
- function k(e) {
2451
+ function O(e) {
2243
2452
  if (e == null || e === "") return "";
2244
2453
  let t = String(e).trim();
2245
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();
2246
2455
  }
2247
2456
  //#endregion
2248
2457
  //#region src/domainOwnershipHelpers.ts
2249
- var we = "string domain,address claimer,string method,bytes32 challengeHash,uint64 verifiedAt,string registryCreationDate,string registryExpirationDate,bytes32 registryFingerprint,string scope", A = "seedprotocol.domainOwnership", Te = "dns-txt-challenge", Ee = "registrable", j = "_seedprotocol-challenge", De = 2592e5, Oe = 31536e6, ke = 31536e3;
2250
- function M(e) {
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) {
2251
2460
  return new TextEncoder().encode(e);
2252
2461
  }
2253
- function N(e) {
2462
+ function M(e) {
2254
2463
  return e.trim().toLowerCase().replace(/\.$/, "");
2255
2464
  }
2256
- function P(e) {
2465
+ function N(e) {
2257
2466
  let t = e.trim();
2258
2467
  try {
2259
2468
  return g(t).toLowerCase();
@@ -2261,14 +2470,14 @@ function P(e) {
2261
2470
  return t.toLowerCase();
2262
2471
  }
2263
2472
  }
2264
- function Ae(e) {
2265
- return `${j}.${N(e)}`;
2473
+ function Ve(e) {
2474
+ return `${A}.${M(e)}`;
2266
2475
  }
2267
- function je(e) {
2268
- let t = P(e.claimer);
2476
+ function He(e) {
2477
+ let t = N(e.claimer);
2269
2478
  return `token=${e.token},addr=${t},expiry=${e.expiry}`;
2270
2479
  }
2271
- function Me(e) {
2480
+ function Ue(e) {
2272
2481
  let t = e.replace(/^"+|"+$/g, "").trim(), n = /* @__PURE__ */ new Map();
2273
2482
  for (let e of t.split(",")) {
2274
2483
  let t = e.indexOf("=");
@@ -2279,59 +2488,59 @@ function Me(e) {
2279
2488
  let r = n.get("token"), i = n.get("addr") ?? n.get("claimer"), a = n.get("expiry");
2280
2489
  return !r || !i || !a ? null : {
2281
2490
  token: r,
2282
- claimer: P(i),
2491
+ claimer: N(i),
2283
2492
  expiry: a
2284
2493
  };
2285
2494
  }
2286
- function Ne(e) {
2287
- let t = N(e.domain), n = P(e.claimer), r = (e.scope ?? "registrable").trim();
2288
- return "0x" + m(M(`${t}|${n}|${e.token}|${r}`));
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}`));
2289
2498
  }
2290
- function F(e) {
2499
+ function P(e) {
2291
2500
  let t = {
2292
- domain: N(e.domain),
2501
+ domain: M(e.domain),
2293
2502
  creationDate: (e.creationDate ?? "").trim(),
2294
2503
  registrarIanaId: (e.registrarIanaId ?? "").trim()
2295
2504
  };
2296
- return "0x" + m(M(JSON.stringify(t)));
2505
+ return "0x" + m(j(JSON.stringify(t)));
2297
2506
  }
2298
- function I(e) {
2299
- return typeof e == "string" ? k(e) : e && typeof e == "object" && "hex" in e ? k(String(e.hex)) : k(String(e ?? ""));
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 ?? ""));
2300
2509
  }
2301
- function L(e) {
2510
+ function I(e) {
2302
2511
  return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
2303
2512
  }
2304
- function R(e) {
2513
+ function L(e) {
2305
2514
  if (typeof e == "number" && Number.isFinite(e)) return Math.trunc(e);
2306
2515
  if (typeof e == "bigint") return Number(e);
2307
2516
  if (typeof e == "string" && e.trim() !== "") {
2308
2517
  let t = Number(e);
2309
2518
  return Number.isFinite(t) ? Math.trunc(t) : 0;
2310
2519
  }
2311
- return e && typeof e == "object" && "value" in e ? R(e.value) : 0;
2520
+ return e && typeof e == "object" && "value" in e ? L(e.value) : 0;
2312
2521
  }
2313
- function z(e) {
2522
+ function R(e) {
2314
2523
  let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
2315
2524
  for (let e of t) e?.name && n.set(e.name, e);
2316
2525
  return {
2317
- domain: N(L(n.get("domain")?.value)),
2318
- claimer: P(L(n.get("claimer")?.value)),
2319
- method: L(n.get("method")?.value),
2320
- challengeHash: I(n.get("challengeHash")?.value),
2321
- verifiedAt: R(n.get("verifiedAt")?.value),
2322
- registryCreationDate: L(n.get("registryCreationDate")?.value),
2323
- registryExpirationDate: L(n.get("registryExpirationDate")?.value),
2324
- registryFingerprint: I(n.get("registryFingerprint")?.value),
2325
- scope: L(n.get("scope")?.value)
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)
2326
2535
  };
2327
2536
  }
2328
- function Pe(e) {
2537
+ function Ge(e) {
2329
2538
  if (!e?.trim()) return null;
2330
2539
  let t = Date.parse(e);
2331
2540
  return Number.isFinite(t) ? Math.floor(t / 1e3) : null;
2332
2541
  }
2333
- function Fe(e) {
2334
- let t = Math.floor((e.now ?? Date.now()) / 1e3), n = [], r = e.softStaleMs ?? 31536e6, i = e.expirationTime, a = Pe(e.decoded.registryExpirationDate);
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);
2335
2544
  if (typeof i == "number" && i > 0 && t >= i || a != null && t >= a) return {
2336
2545
  status: "expired",
2337
2546
  warnings: n
@@ -2340,11 +2549,11 @@ function Fe(e) {
2340
2549
  status: "unknown",
2341
2550
  warnings: n
2342
2551
  };
2343
- if (e.registrySnapshot !== void 0) return k(F({
2552
+ if (e.registrySnapshot !== void 0) return O(P({
2344
2553
  domain: e.decoded.domain,
2345
2554
  creationDate: e.registrySnapshot.creationDate,
2346
2555
  registrarIanaId: e.registrySnapshot.registrarIanaId
2347
- })) === k(e.decoded.registryFingerprint) ? {
2556
+ })) === O(e.decoded.registryFingerprint) ? {
2348
2557
  status: "valid",
2349
2558
  warnings: n
2350
2559
  } : (n.push("Registry creation date or registrar IANA id no longer matches attestation fingerprint"), {
@@ -2362,10 +2571,10 @@ function Fe(e) {
2362
2571
  }
2363
2572
  //#endregion
2364
2573
  //#region src/domainOwnership.ts
2365
- function B(e) {
2574
+ function z(e) {
2366
2575
  return e.trim().toLowerCase().replace(/\.$/, "");
2367
2576
  }
2368
- async function Ie(t) {
2577
+ async function qe(t) {
2369
2578
  let { toolAddresses: n, domains: r, claimers: i, schemaUid: o, excludeRevoked: s = !0 } = t;
2370
2579
  if (!n.length) return [];
2371
2580
  let c = n.map((e) => {
@@ -2375,29 +2584,29 @@ async function Ie(t) {
2375
2584
  return e;
2376
2585
  }
2377
2586
  }), l = { attester: { in: c } };
2378
- o ? l.schemaId = { equals: o } : l.schema = { is: { schemaNames: { some: { name: { equals: A } } } } }, i?.length && (l.recipient = { in: i.map((e) => {
2587
+ o ? l.schemaId = { equals: o } : l.schema = { is: { schemaNames: { some: { name: { equals: k } } } } }, i?.length && (l.recipient = { in: i.map((e) => {
2379
2588
  try {
2380
2589
  return g(e);
2381
2590
  } catch {
2382
2591
  return e;
2383
2592
  }
2384
- }) }), s && (l = _(l));
2593
+ }) }), s && (l = v(l));
2385
2594
  let u = a.getQueryClient(), d = e.getEasClient(), { itemSeeds: f } = await u.fetchQuery({
2386
2595
  queryKey: [
2387
2596
  "getDomainOwnershipFromEas",
2388
2597
  s,
2389
2598
  o ?? "seedprotocol.domainOwnership",
2390
2599
  [...c].sort(),
2391
- [...(r ?? []).map(B)].sort(),
2600
+ [...(r ?? []).map(z)].sort(),
2392
2601
  [...i ?? []].map((e) => e.toLowerCase()).sort()
2393
2602
  ],
2394
2603
  queryFn: async () => d.request(x, { where: l })
2395
2604
  });
2396
2605
  if (!r?.length) return f;
2397
- let p = new Set(r.map(B));
2606
+ let p = new Set(r.map(z));
2398
2607
  return f.filter((e) => {
2399
2608
  try {
2400
- let t = z(e.decodedDataJson ?? "[]");
2609
+ let t = R(e.decodedDataJson ?? "[]");
2401
2610
  return p.has(t.domain);
2402
2611
  } catch {
2403
2612
  return !1;
@@ -2406,8 +2615,8 @@ async function Ie(t) {
2406
2615
  }
2407
2616
  //#endregion
2408
2617
  //#region src/publishAuthorizationHelpers.ts
2409
- var Le = "address identity,address sessionKey,address app,string scopes,uint64 grantedAt,uint64 expiresAt,bytes32 permissionsHash", V = "seedprotocol.publishAuthorization", Re = "publish,revoke", ze = 31536e3;
2410
- function H(e) {
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) {
2411
2620
  let t = e.trim();
2412
2621
  try {
2413
2622
  return g(t).toLowerCase();
@@ -2415,35 +2624,35 @@ function H(e) {
2415
2624
  return t.toLowerCase();
2416
2625
  }
2417
2626
  }
2418
- function Be(e) {
2419
- return typeof e == "string" ? k(e) : e && typeof e == "object" && "hex" in e ? k(String(e.hex)) : k(String(e ?? ""));
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 ?? ""));
2420
2629
  }
2421
- function U(e) {
2630
+ function H(e) {
2422
2631
  return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
2423
2632
  }
2424
- function W(e) {
2633
+ function U(e) {
2425
2634
  if (typeof e == "number" && Number.isFinite(e)) return Math.trunc(e);
2426
2635
  if (typeof e == "bigint") return Number(e);
2427
2636
  if (typeof e == "string" && e.trim() !== "") {
2428
2637
  let t = Number(e);
2429
2638
  return Number.isFinite(t) ? Math.trunc(t) : 0;
2430
2639
  }
2431
- return e && typeof e == "object" && "value" in e ? W(e.value) : 0;
2640
+ return e && typeof e == "object" && "value" in e ? U(e.value) : 0;
2432
2641
  }
2433
- function Ve(e) {
2642
+ function Qe(e) {
2434
2643
  let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
2435
2644
  for (let e of t) e?.name && n.set(e.name, e);
2436
2645
  return {
2437
- identity: H(U(n.get("identity")?.value)),
2438
- sessionKey: H(U(n.get("sessionKey")?.value)),
2439
- app: H(U(n.get("app")?.value)),
2440
- scopes: U(n.get("scopes")?.value),
2441
- grantedAt: W(n.get("grantedAt")?.value),
2442
- expiresAt: W(n.get("expiresAt")?.value),
2443
- permissionsHash: Be(n.get("permissionsHash")?.value)
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)
2444
2653
  };
2445
2654
  }
2446
- function He(e) {
2655
+ function $e(e) {
2447
2656
  let t = Math.floor((e.now ?? Date.now()) / 1e3), n = [], r = e.expectedScopes ?? "publish,revoke", i = e.expirationTime, a = e.decoded.expiresAt;
2448
2657
  return typeof i == "number" && i > 0 && t >= i || a > 0 && t >= a ? {
2449
2658
  status: "expired",
@@ -2459,14 +2668,14 @@ function He(e) {
2459
2668
  warnings: n
2460
2669
  });
2461
2670
  }
2462
- function Ue(e) {
2671
+ function et(e) {
2463
2672
  return "0x" + m(new TextEncoder().encode(e));
2464
2673
  }
2465
2674
  //#endregion
2466
2675
  //#region src/publishAuthorization.ts
2467
- async function We(t = {}) {
2676
+ async function tt(t = {}) {
2468
2677
  let { identities: n, sessionKeys: r, apps: i, schemaUid: o, excludeRevoked: s = !0 } = t, c = {};
2469
- o ? c.schemaId = { equals: o } : c.schema = { is: { schemaNames: { some: { name: { equals: V } } } } }, n?.length && (c.attester = { in: n.map((e) => {
2678
+ o ? c.schemaId = { equals: o } : c.schema = { is: { schemaNames: { some: { name: { equals: B } } } } }, n?.length && (c.attester = { in: n.map((e) => {
2470
2679
  try {
2471
2680
  return g(e);
2472
2681
  } catch {
@@ -2478,7 +2687,7 @@ async function We(t = {}) {
2478
2687
  } catch {
2479
2688
  return e;
2480
2689
  }
2481
- }) }), s && (c = _(c));
2690
+ }) }), s && (c = v(c));
2482
2691
  let l = a.getQueryClient(), u = e.getEasClient(), { itemSeeds: d } = await l.fetchQuery({
2483
2692
  queryKey: [
2484
2693
  "getPublishAuthorizationFromEas",
@@ -2494,7 +2703,7 @@ async function We(t = {}) {
2494
2703
  let f = new Set(i.map((e) => e.toLowerCase()));
2495
2704
  return d.filter((e) => {
2496
2705
  try {
2497
- let t = Ve(e.decodedDataJson ?? "[]");
2706
+ let t = Qe(e.decodedDataJson ?? "[]");
2498
2707
  return f.has(t.app.toLowerCase());
2499
2708
  } catch {
2500
2709
  return !1;
@@ -2503,44 +2712,44 @@ async function We(t = {}) {
2503
2712
  }
2504
2713
  //#endregion
2505
2714
  //#region src/publishedByHelpers.ts
2506
- var Ge = "bytes32 seedUid,bytes32 versionUid,bytes32[] attestationUids,bytes32 batchHash,string toolName,string toolVersion", Ke = "seedprotocol.publishedBy";
2507
- function qe(e) {
2715
+ var nt = "bytes32 seedUid,bytes32 versionUid,bytes32[] attestationUids,bytes32 batchHash,string toolName,string toolVersion", rt = "seedprotocol.publishedBy";
2716
+ function it(e) {
2508
2717
  let t = e.startsWith("0x") || e.startsWith("0X") ? e.slice(2) : e, n = new Uint8Array(t.length / 2);
2509
2718
  for (let e = 0; e < n.length; e++) n[e] = parseInt(t.slice(e * 2, e * 2 + 2), 16);
2510
2719
  return n;
2511
2720
  }
2512
- function Je(e) {
2513
- let t = [...e].map((e) => k(e)).filter((e) => e !== "" && O(e)).sort();
2721
+ function at(e) {
2722
+ let t = [...e].map((e) => O(e)).filter((e) => e !== "" && Pe(e)).sort();
2514
2723
  if (t.length === 0) return "0x" + m(/* @__PURE__ */ new Uint8Array());
2515
2724
  let n = new Uint8Array(t.length * 32);
2516
- for (let e = 0; e < t.length; e++) n.set(qe(t[e]), e * 32);
2725
+ for (let e = 0; e < t.length; e++) n.set(it(t[e]), e * 32);
2517
2726
  return "0x" + m(n);
2518
2727
  }
2519
- function Ye(e) {
2520
- return k(Je(e.attestationUids)) === k(e.batchHash);
2728
+ function ot(e) {
2729
+ return O(at(e.attestationUids)) === O(e.batchHash);
2521
2730
  }
2522
- function G(e) {
2523
- return typeof e == "string" ? k(e) : e && typeof e == "object" && "hex" in e ? k(String(e.hex)) : k(String(e ?? ""));
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 ?? ""));
2524
2733
  }
2525
- function Xe(e) {
2734
+ function st(e) {
2526
2735
  return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
2527
2736
  }
2528
- function Ze(e) {
2737
+ function ct(e) {
2529
2738
  let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
2530
2739
  for (let e of t) e?.name && n.set(e.name, e);
2531
2740
  let r = n.get("attestationUids")?.value, i = [];
2532
- 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))), {
2533
- seedUid: G(n.get("seedUid")?.value),
2534
- versionUid: G(n.get("versionUid")?.value),
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),
2535
2744
  attestationUids: i,
2536
- batchHash: G(n.get("batchHash")?.value),
2537
- toolName: Xe(n.get("toolName")?.value),
2538
- toolVersion: Xe(n.get("toolVersion")?.value)
2745
+ batchHash: W(n.get("batchHash")?.value),
2746
+ toolName: st(n.get("toolName")?.value),
2747
+ toolVersion: st(n.get("toolVersion")?.value)
2539
2748
  };
2540
2749
  }
2541
2750
  //#endregion
2542
2751
  //#region src/publishedBy.ts
2543
- async function Qe(t) {
2752
+ async function lt(t) {
2544
2753
  let { toolAddresses: n, refUIDs: r, schemaUid: i, excludeRevoked: o = !0 } = t;
2545
2754
  if (!n.length) return [];
2546
2755
  let s = n.map((e) => {
@@ -2550,7 +2759,7 @@ async function Qe(t) {
2550
2759
  return e;
2551
2760
  }
2552
2761
  }), c = { attester: { in: s } };
2553
- i ? c.schemaId = { equals: i } : c.schema = { is: { schemaNames: { some: { name: { equals: Ke } } } } }, r?.length && (c.refUID = { in: r }), o && (c = _(c));
2762
+ i ? c.schemaId = { equals: i } : c.schema = { is: { schemaNames: { some: { name: { equals: rt } } } } }, r?.length && (c.refUID = { in: r }), o && (c = v(c));
2554
2763
  let l = a.getQueryClient(), u = e.getEasClient(), { itemSeeds: d } = await l.fetchQuery({
2555
2764
  queryKey: [
2556
2765
  "getPublishedByFromEas",
@@ -2565,60 +2774,60 @@ async function Qe(t) {
2565
2774
  }
2566
2775
  //#endregion
2567
2776
  //#region src/stores/schemaUidCache.ts
2568
- var K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), $e = 3e5, J = /* @__PURE__ */ new Map(), Y = /* @__PURE__ */ new Map(), X = /* @__PURE__ */ new Map(), Z = 0, et = (e) => {
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) => {
2569
2778
  let t = "";
2570
2779
  try {
2571
2780
  t = p();
2572
2781
  } catch {}
2573
2782
  return `${t}\n${e}`;
2574
2783
  }, Q = async (e, t) => {
2575
- let n = et(e), r = Y.get(n);
2784
+ let n = ut(e), r = Y.get(n);
2576
2785
  if (r !== void 0) {
2577
2786
  if (Date.now() < r) return;
2578
2787
  Y.delete(n);
2579
2788
  }
2580
2789
  let i = X.get(n);
2581
2790
  if (i) return i;
2582
- let a = Z, o = t().then((e) => (!e && a === Z && Y.set(n, Date.now() + $e), e)).finally(() => {
2791
+ let a = Z, o = t().then((e) => (!e && a === Z && Y.set(n, Date.now() + q), e)).finally(() => {
2583
2792
  X.get(n) === o && X.delete(n);
2584
2793
  });
2585
2794
  return X.set(n, o), o;
2586
2795
  }, $ = () => {
2587
2796
  Z++, Y.clear(), X.clear();
2588
- }, tt = () => {
2589
- K.clear(), q.clear(), J.clear(), $();
2590
- }, nt = ({ text: e, schemaUid: t }) => {
2591
- K.set(h(e), t), $();
2592
- }, rt = ({ modelName: e, schemaUid: t }) => {
2593
- q.set(e.toLowerCase(), t), $();
2594
- }, it = (e) => q.get(e.toLowerCase()), at = async ({ schemaText: e }) => {
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 }) => {
2595
2804
  let t = h(e);
2596
- if (!K.has(t)) {
2805
+ if (!G.has(t)) {
2597
2806
  let e;
2598
2807
  try {
2599
- e = await Q(`schemaName:${t}`, () => T({ schemaName: t }));
2808
+ e = await Q(`schemaName:${t}`, () => E({ schemaName: t }));
2600
2809
  } catch (e) {
2601
2810
  process.env.NODE_ENV === "development" && console.warn(`Failed to fetch schema for schema name ${t}:`, e);
2602
2811
  return;
2603
2812
  }
2604
- return e && K.set(t, e), e;
2813
+ return e && G.set(t, e), e;
2605
2814
  }
2606
- return K.get(t);
2607
- }, ot = async (t) => {
2608
- let n = et(t), r = J.get(n);
2815
+ return G.get(t);
2816
+ }, gt = async (t) => {
2817
+ let n = ut(t), r = J.get(n);
2609
2818
  if (r) return r;
2610
2819
  let i = a.getQueryClient(), o = e.getEasClient();
2611
2820
  if (!i || !o) return;
2612
2821
  let s = await Q(`definition:${t}`, async () => {
2613
2822
  let e = await i.fetchQuery({
2614
2823
  queryKey: ["getSchemaByDefinition", t],
2615
- queryFn: async () => o.request(b, { where: { schema: { equals: t } } })
2824
+ queryFn: async () => o.request(ce, { where: { schema: { equals: t } } })
2616
2825
  }), n = e?.schemas ?? e?.data?.schemas;
2617
2826
  return Array.isArray(n) && n.length > 0 ? n[0].id : void 0;
2618
2827
  });
2619
2828
  return s && J.set(n, s), s;
2620
2829
  };
2621
2830
  //#endregion
2622
- export { e as BaseEasClient, e as EasClient, a as BaseQueryClient, c as DEFAULT_EAS_CHAIN_ID, De as DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS, ke as DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS, Te as DOMAIN_OWNERSHIP_METHOD, we as DOMAIN_OWNERSHIP_SCHEMA_DEF, A as DOMAIN_OWNERSHIP_SCHEMA_NAME, Ee as DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE, Oe as DOMAIN_OWNERSHIP_SOFT_STALE_MS, j as DOMAIN_OWNERSHIP_TXT_LABEL, ne as EAS_CHAIN_DEPLOYMENTS, Ce as EAS_ENDPOINT, de as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, fe as GET_FILES_METADATA, pe as GET_IMAGE_SEEDS, me as GET_IMAGE_VERSIONS, C as GET_PROPERTIES, y as GET_SCHEMAS, b as GET_SCHEMA_BY_NAME, x as GET_SEEDS, le as GET_SEED_IDS, ue as GET_STORAGE_TRANSACTION_ID, S as GET_VERSIONS, r as OP_STACK_EAS_CONTRACT_ADDRESS, i as OP_STACK_SCHEMA_REGISTRY_ADDRESS, Ge as PUBLISHED_BY_SCHEMA_DEF, Ke as PUBLISHED_BY_SCHEMA_NAME, ze as PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS, Le as PUBLISH_AUTHORIZATION_SCHEMA_DEF, V as PUBLISH_AUTHORIZATION_SCHEMA_NAME, Re as PUBLISH_AUTHORIZATION_SCOPES, $e as SCHEMA_LOOKUP_MISS_TTL_MS, be as ZERO_ADDRESS, xe as ZERO_BYTES, Se as ZERO_BYTES32, Fe as assessDomainOwnership, He as assessPublishAuthorization, je as buildDomainOwnershipTxtValue, Q as cachedSchemaLookup, g as checksumAddress, $ as clearSchemaLookupMisses, te as configureEasReadChain, z as decodeDomainOwnershipData, Ve as decodePublishAuthorizationData, Ze as decodePublishedByData, Ae as domainOwnershipTxtName, u as expectEasReadChain, T as fetchEasSchemaUidBySchemaName, ge as getCanonicalItemPropertiesFromEas, Ie as getDomainOwnershipFromEas, f as getEasAttestationExplorerUrl, l as getEasChainDeployment, p as getEasEndpoint, s as getEasReadChainId, _e as getEasSchemaUidBySchemaName, ot as getEasSchemaUidForExactDefinition, at as getEasSchemaUidForSchemaDefinition, w as getItemPropertiesFromEas, he as getItemVersionsFromEas, We as getPublishAuthorizationFromEas, Qe as getPublishedByFromEas, it as getSchemaUidForModelFromCache, ye as getSeedUidsBySchemaName, E as getSeedsBySchemaName, ve as getSeedsFromSchemaUids, Ne as hashDomainOwnershipChallenge, F as hashDomainRegistryFingerprint, Ue as hashPublishAuthorizationMaterial, Je as hashPublishedByBatch, t as isEasReadChainConfigured, d as isEasReadChainSettled, D as isPlaceholderUid, O as isValidEasAttestationUid, k as normalizeBytes32Hex, Me as parseDomainOwnershipTxtValue, se as pickLatestPropertyAttestationsByRefAndSchema, ee as resetEasReadChain, tt as resetSchemaUidCaches, o as resolveEasChainDeployment, rt as setSchemaUidForModel, nt as setSchemaUidForSchemaDefinition, h as toSnakeCase, Ye as verifyPublishedByBatch, n as whenEasReadChainSettled, _ as withExcludeRevokedFilter };
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 };
2623
2832
 
2624
2833
  //# sourceMappingURL=index.js.map