@seedprotocol/eas 0.7.6-next.920.gdd0b533 → 0.7.6-next.957.g6bb7768
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
|
@@ -2758,10 +2758,10 @@ function ot(e) {
|
|
|
2758
2758
|
}
|
|
2759
2759
|
//#endregion
|
|
2760
2760
|
//#region src/domainOwnership.ts
|
|
2761
|
-
function
|
|
2761
|
+
function P(e) {
|
|
2762
2762
|
return e.trim().toLowerCase().replace(/\.$/, "");
|
|
2763
2763
|
}
|
|
2764
|
-
async function
|
|
2764
|
+
async function st(e) {
|
|
2765
2765
|
let { toolAddresses: t, domains: n, claimers: r, schemaUid: i, excludeRevoked: a = !0 } = e;
|
|
2766
2766
|
if (!t.length) return [];
|
|
2767
2767
|
let o = t.map((e) => {
|
|
@@ -2784,13 +2784,13 @@ async function ct(e) {
|
|
|
2784
2784
|
a,
|
|
2785
2785
|
i ?? "seedprotocol.domainOwnership",
|
|
2786
2786
|
[...o].sort(),
|
|
2787
|
-
[...(n ?? []).map(
|
|
2787
|
+
[...(n ?? []).map(P)].sort(),
|
|
2788
2788
|
[...r ?? []].map((e) => e.toLowerCase()).sort()
|
|
2789
2789
|
],
|
|
2790
2790
|
queryFn: async () => l.request(he, { where: s })
|
|
2791
2791
|
});
|
|
2792
2792
|
if (!n?.length) return u;
|
|
2793
|
-
let ee = new Set(n.map(
|
|
2793
|
+
let ee = new Set(n.map(P));
|
|
2794
2794
|
return u.filter((e) => {
|
|
2795
2795
|
try {
|
|
2796
2796
|
let t = it(e.decodedDataJson ?? "[]");
|
|
@@ -2802,8 +2802,8 @@ async function ct(e) {
|
|
|
2802
2802
|
}
|
|
2803
2803
|
//#endregion
|
|
2804
2804
|
//#region src/publishAuthorizationHelpers.ts
|
|
2805
|
-
var
|
|
2806
|
-
function
|
|
2805
|
+
var ct = "address identity,address sessionKey,address app,string scopes,uint64 grantedAt,uint64 expiresAt,bytes32 permissionsHash", lt = "seedprotocol.publishAuthorization", ut = "publish,revoke", dt = 31536e3;
|
|
2806
|
+
function F(e) {
|
|
2807
2807
|
let t = e.trim();
|
|
2808
2808
|
try {
|
|
2809
2809
|
return h(t).toLowerCase();
|
|
@@ -2811,35 +2811,35 @@ function P(e) {
|
|
|
2811
2811
|
return t.toLowerCase();
|
|
2812
2812
|
}
|
|
2813
2813
|
}
|
|
2814
|
-
function
|
|
2814
|
+
function ft(e) {
|
|
2815
2815
|
return typeof e == "string" ? O(e) : e && typeof e == "object" && "hex" in e ? O(String(e.hex)) : O(String(e ?? ""));
|
|
2816
2816
|
}
|
|
2817
|
-
function
|
|
2817
|
+
function I(e) {
|
|
2818
2818
|
return typeof e == "string" ? e : e && typeof e == "object" && "value" in e ? String(e.value ?? "") : String(e ?? "");
|
|
2819
2819
|
}
|
|
2820
|
-
function
|
|
2820
|
+
function L(e) {
|
|
2821
2821
|
if (typeof e == "number" && Number.isFinite(e)) return Math.trunc(e);
|
|
2822
2822
|
if (typeof e == "bigint") return Number(e);
|
|
2823
2823
|
if (typeof e == "string" && e.trim() !== "") {
|
|
2824
2824
|
let t = Number(e);
|
|
2825
2825
|
return Number.isFinite(t) ? Math.trunc(t) : 0;
|
|
2826
2826
|
}
|
|
2827
|
-
return e && typeof e == "object" && "value" in e ?
|
|
2827
|
+
return e && typeof e == "object" && "value" in e ? L(e.value) : 0;
|
|
2828
2828
|
}
|
|
2829
|
-
function
|
|
2829
|
+
function pt(e) {
|
|
2830
2830
|
let t = typeof e == "string" ? JSON.parse(e) : e, n = /* @__PURE__ */ new Map();
|
|
2831
2831
|
for (let e of t) e?.name && n.set(e.name, e);
|
|
2832
2832
|
return {
|
|
2833
|
-
identity:
|
|
2834
|
-
sessionKey:
|
|
2835
|
-
app:
|
|
2836
|
-
scopes:
|
|
2837
|
-
grantedAt:
|
|
2838
|
-
expiresAt:
|
|
2839
|
-
permissionsHash:
|
|
2833
|
+
identity: F(I(n.get("identity")?.value)),
|
|
2834
|
+
sessionKey: F(I(n.get("sessionKey")?.value)),
|
|
2835
|
+
app: F(I(n.get("app")?.value)),
|
|
2836
|
+
scopes: I(n.get("scopes")?.value),
|
|
2837
|
+
grantedAt: L(n.get("grantedAt")?.value),
|
|
2838
|
+
expiresAt: L(n.get("expiresAt")?.value),
|
|
2839
|
+
permissionsHash: ft(n.get("permissionsHash")?.value)
|
|
2840
2840
|
};
|
|
2841
2841
|
}
|
|
2842
|
-
function
|
|
2842
|
+
function mt(e) {
|
|
2843
2843
|
let t = Math.floor((e.now ?? Date.now()) / 1e3), n = [], r = e.expectedScopes ?? "publish,revoke", i = e.expirationTime, a = e.decoded.expiresAt;
|
|
2844
2844
|
return typeof i == "number" && i > 0 && t >= i || a > 0 && t >= a ? {
|
|
2845
2845
|
status: "expired",
|
|
@@ -2855,14 +2855,14 @@ function ht(e) {
|
|
|
2855
2855
|
warnings: n
|
|
2856
2856
|
});
|
|
2857
2857
|
}
|
|
2858
|
-
function
|
|
2858
|
+
function ht(e) {
|
|
2859
2859
|
return "0x" + p(new TextEncoder().encode(e));
|
|
2860
2860
|
}
|
|
2861
2861
|
//#endregion
|
|
2862
2862
|
//#region src/publishAuthorization.ts
|
|
2863
|
-
async function
|
|
2863
|
+
async function gt(e = {}) {
|
|
2864
2864
|
let { identities: t, sessionKeys: n, apps: r, schemaUid: i, excludeRevoked: a = !0 } = e, o = {};
|
|
2865
|
-
i ? o.schemaId = { equals: i } : o.schema = { is: { schemaNames: { some: { name: { equals:
|
|
2865
|
+
i ? o.schemaId = { equals: i } : o.schema = { is: { schemaNames: { some: { name: { equals: lt } } } } }, t?.length && (o.attester = { in: t.map((e) => {
|
|
2866
2866
|
try {
|
|
2867
2867
|
return h(e);
|
|
2868
2868
|
} catch {
|
|
@@ -2890,7 +2890,7 @@ async function _t(e = {}) {
|
|
|
2890
2890
|
let u = new Set(r.map((e) => e.toLowerCase()));
|
|
2891
2891
|
return l.filter((e) => {
|
|
2892
2892
|
try {
|
|
2893
|
-
let t =
|
|
2893
|
+
let t = pt(e.decodedDataJson ?? "[]");
|
|
2894
2894
|
return u.has(t.app.toLowerCase());
|
|
2895
2895
|
} catch {
|
|
2896
2896
|
return !1;
|
|
@@ -2899,29 +2899,29 @@ async function _t(e = {}) {
|
|
|
2899
2899
|
}
|
|
2900
2900
|
//#endregion
|
|
2901
2901
|
//#region src/easNames.ts
|
|
2902
|
-
var
|
|
2902
|
+
var R = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/([A-Z])([A-Z][a-z])/g, "$1_$2").replace(/[^A-Za-z0-9]+/g, "_").replace(/^_+|_+$/g, "").toLowerCase(), _t = [
|
|
2903
2903
|
"exact",
|
|
2904
2904
|
"normalized",
|
|
2905
2905
|
"fuzzy"
|
|
2906
|
-
],
|
|
2906
|
+
], vt = (e) => typeof e == "string" && _t.includes(e), z = {
|
|
2907
2907
|
exact: 0,
|
|
2908
2908
|
normalized: 1,
|
|
2909
2909
|
fuzzy: 2
|
|
2910
|
-
},
|
|
2911
|
-
let n =
|
|
2910
|
+
}, yt = "fuzzy", B = (e) => e.toLowerCase().replace(/[^a-z0-9]/g, ""), V = (e, t = {}) => {
|
|
2911
|
+
let n = B(e);
|
|
2912
2912
|
return t.relation && (n.length > 3 && n.endsWith("ids") ? n = n.slice(0, -3) : n.length > 2 && n.endsWith("id") && (n = n.slice(0, -2))), n.length > 3 && n.endsWith("s") && !n.endsWith("ss") && (n = n.slice(0, -1)), n;
|
|
2913
2913
|
};
|
|
2914
|
-
function
|
|
2915
|
-
if (
|
|
2916
|
-
if (
|
|
2917
|
-
if (
|
|
2914
|
+
function H(e, t, n = {}) {
|
|
2915
|
+
if (R(e) === t) return "exact";
|
|
2916
|
+
if (B(e) === B(t)) return "normalized";
|
|
2917
|
+
if (V(e, n) === V(t, n)) return "fuzzy";
|
|
2918
2918
|
}
|
|
2919
|
-
var
|
|
2920
|
-
function
|
|
2919
|
+
var U = (e, t) => z[e] <= z[t], W = (e, t) => z[e] - z[t];
|
|
2920
|
+
function bt(e, t) {
|
|
2921
2921
|
let n, r = [];
|
|
2922
2922
|
for (let i of t) {
|
|
2923
|
-
let t =
|
|
2924
|
-
t &&
|
|
2923
|
+
let t = H(i.name, e, { relation: i.relation });
|
|
2924
|
+
t && U(t, i.level ?? "fuzzy") && (n === void 0 || W(t, n) < 0 ? (n = t, r = [i.value]) : t === n && r.push(i.value));
|
|
2925
2925
|
}
|
|
2926
2926
|
return n === void 0 ? { kind: "none" } : r.length > 1 ? {
|
|
2927
2927
|
kind: "ambiguous",
|
|
@@ -2933,36 +2933,36 @@ function xt(e, t) {
|
|
|
2933
2933
|
tier: n
|
|
2934
2934
|
};
|
|
2935
2935
|
}
|
|
2936
|
-
function
|
|
2936
|
+
function xt(e, t, n = {}) {
|
|
2937
2937
|
let r = typeof n.level == "function" ? n.level : () => n.level ?? "fuzzy", i, a = /* @__PURE__ */ new Set();
|
|
2938
2938
|
for (let o of t) {
|
|
2939
|
-
let t =
|
|
2940
|
-
t &&
|
|
2939
|
+
let t = H(o, e, { relation: n.relation });
|
|
2940
|
+
t && U(t, r(o)) && (i === void 0 || W(t, i) < 0 ? (i = t, a = /* @__PURE__ */ new Set([o])) : t === i && a.add(o));
|
|
2941
2941
|
}
|
|
2942
2942
|
return a;
|
|
2943
2943
|
}
|
|
2944
|
-
function
|
|
2944
|
+
function St(e) {
|
|
2945
2945
|
let t = e.replace(/([a-z])([A-Z])/g, "$1_$2").toLowerCase();
|
|
2946
2946
|
return [.../* @__PURE__ */ new Set([
|
|
2947
|
-
|
|
2947
|
+
R(e),
|
|
2948
2948
|
t,
|
|
2949
|
-
|
|
2949
|
+
B(e)
|
|
2950
2950
|
])];
|
|
2951
2951
|
}
|
|
2952
|
-
function
|
|
2953
|
-
if (t === "exact") return [
|
|
2954
|
-
let n = /* @__PURE__ */ new Set([...
|
|
2952
|
+
function Ct(e, t = yt) {
|
|
2953
|
+
if (t === "exact") return [R(e)];
|
|
2954
|
+
let n = /* @__PURE__ */ new Set([...St(e), e]);
|
|
2955
2955
|
if (t === "fuzzy") for (let e of [...n]) n.add(e.endsWith("s") ? e.slice(0, -1) : `${e}s`);
|
|
2956
2956
|
return [...n];
|
|
2957
2957
|
}
|
|
2958
2958
|
//#endregion
|
|
2959
2959
|
//#region src/easValues.ts
|
|
2960
|
-
var
|
|
2961
|
-
function
|
|
2960
|
+
var wt = /^-?\d+$/, Tt = /^(-?)0x([0-9a-f]+)$/i;
|
|
2961
|
+
function Et(e) {
|
|
2962
2962
|
return typeof e == "string" && /^u?int\d*$/.test(e);
|
|
2963
2963
|
}
|
|
2964
|
-
function
|
|
2965
|
-
let t =
|
|
2964
|
+
function Dt(e) {
|
|
2965
|
+
let t = Tt.exec(e.trim());
|
|
2966
2966
|
if (!t) return;
|
|
2967
2967
|
let n = BigInt("0x" + t[2]);
|
|
2968
2968
|
return (t[1] ? -n : n).toString();
|
|
@@ -2973,14 +2973,14 @@ function Ot(e) {
|
|
|
2973
2973
|
if (typeof e == "string") {
|
|
2974
2974
|
let t = e.trim();
|
|
2975
2975
|
if (!t) return;
|
|
2976
|
-
if (
|
|
2977
|
-
if (
|
|
2976
|
+
if (wt.test(t)) return BigInt(t).toString();
|
|
2977
|
+
if (Tt.test(t)) return Dt(t);
|
|
2978
2978
|
let n = Number(t);
|
|
2979
2979
|
return Number.isFinite(n) ? String(n) : void 0;
|
|
2980
2980
|
}
|
|
2981
2981
|
if (e && typeof e == "object") {
|
|
2982
2982
|
let t = e.hex ?? e._hex;
|
|
2983
|
-
if (typeof t == "string") return
|
|
2983
|
+
if (typeof t == "string") return Dt(t);
|
|
2984
2984
|
}
|
|
2985
2985
|
}
|
|
2986
2986
|
//#endregion
|
|
@@ -3078,7 +3078,7 @@ var K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), Rt = 3e5, J =
|
|
|
3078
3078
|
K.set(m(e), t), $();
|
|
3079
3079
|
}, Ht = ({ modelName: e, schemaUid: t }) => {
|
|
3080
3080
|
q.set(e.toLowerCase(), t), $();
|
|
3081
|
-
}, Ut = (e) => q.get(e.toLowerCase()), Wt = async ({ schemaText: e }) => {
|
|
3081
|
+
}, Ut = (e) => q.get(e.toLowerCase()), Wt = (e) => K.get(m(e)), Gt = async ({ schemaText: e }) => {
|
|
3082
3082
|
let t = m(e);
|
|
3083
3083
|
if (!K.has(t)) {
|
|
3084
3084
|
let e;
|
|
@@ -3091,7 +3091,7 @@ var K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), Rt = 3e5, J =
|
|
|
3091
3091
|
return e && K.set(t, e), e;
|
|
3092
3092
|
}
|
|
3093
3093
|
return K.get(t);
|
|
3094
|
-
},
|
|
3094
|
+
}, Kt = async (e) => {
|
|
3095
3095
|
let t = zt(e), n = J.get(t);
|
|
3096
3096
|
if (n) return n;
|
|
3097
3097
|
let r = d.getQueryClient(), i = f.getEasClient();
|
|
@@ -3106,6 +3106,6 @@ var K = /* @__PURE__ */ new Map(), q = /* @__PURE__ */ new Map(), Rt = 3e5, J =
|
|
|
3106
3106
|
return a && J.set(t, a), a;
|
|
3107
3107
|
};
|
|
3108
3108
|
//#endregion
|
|
3109
|
-
export { f as BaseEasClient, f as EasClient, d as BaseQueryClient, a as DEFAULT_EAS_CHAIN_ID,
|
|
3109
|
+
export { f as BaseEasClient, f as EasClient, d as BaseQueryClient, a as DEFAULT_EAS_CHAIN_ID, yt as DEFAULT_NAME_MATCH_LEVEL, Ye as DOMAIN_OWNERSHIP_CHALLENGE_TTL_MS, Ze as DOMAIN_OWNERSHIP_DEFAULT_EXPIRATION_SECS, Ge as DOMAIN_OWNERSHIP_METHOD, Ue as DOMAIN_OWNERSHIP_SCHEMA_DEF, We as DOMAIN_OWNERSHIP_SCHEMA_NAME, qe as DOMAIN_OWNERSHIP_SCOPE_HOSTNAME, Ke as DOMAIN_OWNERSHIP_SCOPE_REGISTRABLE, Xe as DOMAIN_OWNERSHIP_SOFT_STALE_MS, Je as DOMAIN_OWNERSHIP_TXT_LABEL, te as DefaultEasClient, oe as DefaultQueryClient, r as DuplicateEasModuleError, o as EAS_CHAIN_DEPLOYMENTS, Be as EAS_ENDPOINT, ye as GET_ALL_PROPERTIES_FOR_ALL_VERSIONS, Ce as GET_ATTESTATION_CHANGES, he as GET_DOMAIN_OWNERSHIPS, be as GET_FILES_METADATA, xe as GET_IMAGE_SEEDS, Se as GET_IMAGE_VERSIONS, ve as GET_PROPERTIES, x as GET_SCHEMAS, me as GET_SCHEMA_BY_NAME, S as GET_SEEDS, C as GET_SEEDS_LEAN, ge as GET_SEED_IDS, _e as GET_STORAGE_TRANSACTION_ID, w as GET_VERSIONS, _t as NAME_MATCH_LEVELS, re as OP_STACK_EAS_CONTRACT_ADDRESS, ee as OP_STACK_SCHEMA_REGISTRY_ADDRESS, kt as PUBLISHED_BY_SCHEMA_DEF, At as PUBLISHED_BY_SCHEMA_NAME, dt as PUBLISH_AUTHORIZATION_DEFAULT_EXPIRATION_SECS, ct as PUBLISH_AUTHORIZATION_SCHEMA_DEF, lt as PUBLISH_AUTHORIZATION_SCHEMA_NAME, ut as PUBLISH_AUTHORIZATION_SCOPES, Rt as SCHEMA_LOOKUP_MISS_TTL_MS, Le as ZERO_ADDRESS, Re as ZERO_BYTES, ze as ZERO_BYTES32, ce as assertSingleEasModule, ot as assessDomainOwnership, mt as assessPublishAuthorization, et as buildDomainOwnershipTxtValue, Q as cachedSchemaLookup, h as checksumAddress, $ as clearSchemaLookupMisses, W as compareNameMatchTiers, ie as configureEasReadChain, it as decodeDomainOwnershipData, Ot as decodeEasNumber, pt as decodePublishAuthorizationData, Ft as decodePublishedByData, $e as domainOwnershipTxtName, R as easName, St as easNameVariants, Ct as easNamesToFetch, Lt as ensureEasPlatform, l as expectEasReadChain, E as fetchEasSchemaUidBySchemaName, V as fuzzyNameKey, Fe as getAttestationChangesSince, Te as getCanonicalItemPropertiesFromEas, st as getDomainOwnershipFromEas, c as getEasAttestationExplorerUrl, s as getEasChainDeployment, n as getEasEndpoint, ne as getEasReadChainId, Ee as getEasSchemaUidBySchemaName, Kt as getEasSchemaUidForExactDefinition, Gt as getEasSchemaUidForSchemaDefinition, T as getItemPropertiesFromEas, we as getItemVersionsFromEas, gt as getPublishAuthorizationFromEas, It as getPublishedByFromEas, Me as getSchemaNamesBySchemaUids, Ut as getSchemaUidForModelFromCache, Wt as getSchemaUidForSchemaDefinitionFromCache, Ie as getSeedUidsBySchemaName, Oe as getSeedsBySchemaName, Ne as getSeedsByUidsFromEas, De as getSeedsFromSchemaUids, nt as hashDomainOwnershipChallenge, j as hashDomainRegistryFingerprint, ht as hashPublishAuthorizationMaterial, Mt as hashPublishedByBatch, ae as isEasReadChainConfigured, i as isEasReadChainSettled, U as isNameMatchAllowed, vt as isNameMatchLevel, Et as isNumericEasType, Ve as isPlaceholderUid, He as isValidEasAttestationUid, v as keepAttestationsFromRefAttester, xt as localNamesInBestMatchTier, bt as matchEasName, H as nameMatchTier, O as normalizeBytes32Hex, B as normalizedNameKey, tt as parseDomainOwnershipTxtValue, _ as partitionByRefAttester, g as pickLatestPropertyAttestationsByRefAndSchema, e as resetEasClientOwnerForTests, u as resetEasReadChain, je as resetSchemaNamesCache, Bt as resetSchemaUidCaches, t as resolveEasChainDeployment, Ht as setSchemaUidForModel, Vt as setSchemaUidForSchemaDefinition, m as toSnakeCase, Nt as verifyPublishedByBatch, se as whenEasReadChainSettled, y as withExcludeRevokedFilter };
|
|
3110
3110
|
|
|
3111
3111
|
//# sourceMappingURL=index.js.map
|