@seedprotocol/eas 0.7.9-next.1177.ga3e08ed → 0.7.9-next.1306.g4ff6582
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/README.md +1 -1
- package/dist/EasClient/createEasGraphQLClient.d.ts +8 -1
- package/dist/EasClient/createEasGraphQLClient.d.ts.map +1 -1
- package/dist/{QueryClient-Ns40c8jS.js → QueryClient-D3BW5tJk.js} +171 -86
- package/dist/QueryClient-D3BW5tJk.js.map +1 -0
- package/dist/api.d.ts +0 -10
- package/dist/api.d.ts.map +1 -1
- package/dist/default/EasClient.d.ts +2 -0
- package/dist/default/EasClient.d.ts.map +1 -1
- package/dist/easTiming.d.ts +27 -0
- package/dist/easTiming.d.ts.map +1 -0
- package/dist/easValues.d.ts +7 -0
- package/dist/easValues.d.ts.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +337 -318
- package/dist/index.js.map +1 -1
- package/dist/modelSchemas.d.ts +33 -0
- package/dist/modelSchemas.d.ts.map +1 -0
- package/dist/node/EasClient.d.ts +17 -0
- package/dist/node/EasClient.d.ts.map +1 -1
- package/dist/node/easDispatcher.d.ts +26 -0
- package/dist/node/easDispatcher.d.ts.map +1 -0
- package/dist/node/index.d.ts +12 -2
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node.js +33 -8
- package/dist/node.js.map +1 -1
- package/dist/stores/schemaUidCache.d.ts +5 -0
- package/dist/stores/schemaUidCache.d.ts.map +1 -1
- package/package.json +3 -2
- package/dist/QueryClient-Ns40c8jS.js.map +0 -1
package/README.md
CHANGED
|
@@ -56,7 +56,7 @@ getEasChainDeployment(8453) // { name: 'Base', easContractAddress, indexerUrl,
|
|
|
56
56
|
| Entry | Main exports |
|
|
57
57
|
|-------|--------------|
|
|
58
58
|
| `@seedprotocol/eas` | Seeds / Versions / properties: `getSeedsBySchemaName`, `getSeedsByUidsFromEas`, `getSeedsFromSchemaUids`, `getSeedUidsBySchemaName`, `getItemVersionsFromEas`, `getItemPropertiesFromEas`, `getCanonicalItemPropertiesFromEas`, `getAttestationChangesSince` |
|
|
59
|
-
| | Schemas: `
|
|
59
|
+
| | Schemas: `getEasModelSchemasForNames`, `getSchemaNamesBySchemaUids`, schema UID cache (`cachedSchemaLookup`, `getEasSchemaUidForSchemaDefinition`, `setSchemaUidForModel`, …) |
|
|
60
60
|
| | Chain config: `configureEasReadChain`, `getEasReadChainId`, `getEasEndpoint`, `whenEasReadChainSettled`, `EAS_CHAIN_DEPLOYMENTS`, `DEFAULT_EAS_CHAIN_ID`, `getEasChainDeployment`, `resolveEasChainDeployment`, `getEasAttestationExplorerUrl` |
|
|
61
61
|
| | Canonicalization / filters: `pickLatestPropertyAttestationsByRefAndSchema`, `withExcludeRevokedFilter`, `isValidEasAttestationUid`, `normalizeBytes32Hex` |
|
|
62
62
|
| | Sidecars: `getPublishedByFromEas`, `decodePublishedByData`, `verifyPublishedByBatch`; `getPublishAuthorizationFromEas`, `assessPublishAuthorization`; `getDomainOwnershipFromEas`, `assessDomainOwnership`, plus their `*_SCHEMA_NAME` / `*_SCHEMA_DEF` constants |
|
|
@@ -5,6 +5,13 @@ import { GraphQLClient } from 'graphql-request';
|
|
|
5
5
|
* Large sync queries stay well under this.
|
|
6
6
|
*/
|
|
7
7
|
export declare const EAS_REQUEST_TIMEOUT_MS = 30000;
|
|
8
|
+
export type EasGraphQLClientOptions = {
|
|
9
|
+
/**
|
|
10
|
+
* Passed to `fetch` as `dispatcher` on every request (Node's fetch takes an undici
|
|
11
|
+
* `Dispatcher` there; other runtimes ignore it). `@seedprotocol/eas/node` sets one.
|
|
12
|
+
*/
|
|
13
|
+
dispatcher?: unknown;
|
|
14
|
+
};
|
|
8
15
|
/** A GraphQL client for the EAS indexer at `url` whose requests abort after `timeoutMs`. */
|
|
9
|
-
export declare function createEasGraphQLClient(url: string, timeoutMs?: number): GraphQLClient;
|
|
16
|
+
export declare function createEasGraphQLClient(url: string, timeoutMs?: number, { dispatcher }?: EasGraphQLClientOptions): GraphQLClient;
|
|
10
17
|
//# sourceMappingURL=createEasGraphQLClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createEasGraphQLClient.d.ts","sourceRoot":"","sources":["../../src/EasClient/createEasGraphQLClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;
|
|
1
|
+
{"version":3,"file":"createEasGraphQLClient.d.ts","sourceRoot":"","sources":["../../src/EasClient/createEasGraphQLClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAG/C;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,QAAS,CAAA;AAa5C,MAAM,MAAM,uBAAuB,GAAG;IACpC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAA;CACrB,CAAA;AAED,4FAA4F;AAC5F,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,MAAM,EACX,SAAS,SAAyB,EAClC,EAAE,UAAU,EAAE,GAAE,uBAA4B,GAC3C,aAAa,CASf"}
|
|
@@ -1,29 +1,30 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import e from "debug";
|
|
2
|
+
import { GraphQLClient as t } from "graphql-request";
|
|
3
|
+
import { QueryClient as n } from "@tanstack/query-core";
|
|
3
4
|
//#region src/moduleOwner.ts
|
|
4
|
-
var
|
|
5
|
-
function
|
|
6
|
-
globalThis[
|
|
5
|
+
var r = Symbol.for("@seedprotocol/eas:clientOwner"), i = Object.freeze({ package: "@seedprotocol/eas" });
|
|
6
|
+
function a() {
|
|
7
|
+
globalThis[r] = i;
|
|
7
8
|
}
|
|
8
|
-
var
|
|
9
|
+
var o = class extends Error {
|
|
9
10
|
constructor() {
|
|
10
11
|
super("Two copies of @seedprotocol/eas are loaded, and EAS clients were registered on the other copy (e.g. by SeedClient). Reads through this copy would use different clients and a different chain. Make sure every @seedprotocol/* package is the same version and installed once (`npm ls @seedprotocol/eas`). With Vite, keep @seedprotocol/* packages out of optimizeDeps.exclude so they are pre-bundled together, and dedupe them (seedVitePlugin does) when they are linked into the app."), this.name = "DuplicateEasModuleError";
|
|
11
12
|
}
|
|
12
13
|
};
|
|
13
|
-
function o() {
|
|
14
|
-
let e = globalThis[n];
|
|
15
|
-
if (e !== void 0 && e !== r) throw new a();
|
|
16
|
-
}
|
|
17
14
|
function s() {
|
|
18
|
-
|
|
15
|
+
let e = globalThis[r];
|
|
16
|
+
if (e !== void 0 && e !== i) throw new o();
|
|
17
|
+
}
|
|
18
|
+
function c() {
|
|
19
|
+
delete globalThis[r];
|
|
19
20
|
}
|
|
20
21
|
//#endregion
|
|
21
22
|
//#region src/EasClient/BaseEasClient.ts
|
|
22
|
-
var
|
|
23
|
+
var l = class e {
|
|
23
24
|
static _impl = null;
|
|
24
25
|
static configure(t) {
|
|
25
26
|
if (!t) throw Error("Cannot configure EasClient with undefined or null. Ensure the platform-specific EasClient is properly created.");
|
|
26
|
-
e._impl = t,
|
|
27
|
+
e._impl = t, a();
|
|
27
28
|
}
|
|
28
29
|
static isConfigured() {
|
|
29
30
|
return e._impl != null;
|
|
@@ -38,11 +39,11 @@ var c = class e {
|
|
|
38
39
|
static async getSeedsBySchemaName(e) {
|
|
39
40
|
throw Error("BaseEasClient.getSeedsBySchemaName is not implemented. Use getSeedsBySchemaName from @seedprotocol/eas instead.");
|
|
40
41
|
}
|
|
41
|
-
},
|
|
42
|
+
}, u = class e {
|
|
42
43
|
static _impl = null;
|
|
43
44
|
static configure(t) {
|
|
44
45
|
if (!t) throw Error("Cannot configure QueryClient with undefined or null. Ensure the platform-specific QueryClient is properly created.");
|
|
45
|
-
e._impl = t,
|
|
46
|
+
e._impl = t, a();
|
|
46
47
|
}
|
|
47
48
|
static isConfigured() {
|
|
48
49
|
return e._impl != null;
|
|
@@ -54,51 +55,51 @@ var c = class e {
|
|
|
54
55
|
static getQueryClient() {
|
|
55
56
|
return e.requireImpl().getQueryClient();
|
|
56
57
|
}
|
|
57
|
-
},
|
|
58
|
-
function
|
|
58
|
+
}, d = "0x4200000000000000000000000000000000000021", f = "0x4200000000000000000000000000000000000020";
|
|
59
|
+
function p(e, t, n, r = !1) {
|
|
59
60
|
return {
|
|
60
61
|
chainId: e,
|
|
61
62
|
name: t,
|
|
62
|
-
easContractAddress:
|
|
63
|
-
schemaRegistryAddress:
|
|
63
|
+
easContractAddress: d,
|
|
64
|
+
schemaRegistryAddress: f,
|
|
64
65
|
indexerUrl: `https://${n}.easscan.org/graphql`,
|
|
65
66
|
explorerUrl: `https://${n}.easscan.org`,
|
|
66
67
|
testnet: r
|
|
67
68
|
};
|
|
68
69
|
}
|
|
69
|
-
function
|
|
70
|
+
function m(e) {
|
|
70
71
|
let t = e ? `https://${e}.easscan.org` : "https://easscan.org";
|
|
71
72
|
return {
|
|
72
73
|
indexerUrl: `${t}/graphql`,
|
|
73
74
|
explorerUrl: t
|
|
74
75
|
};
|
|
75
76
|
}
|
|
76
|
-
var
|
|
77
|
+
var h = {
|
|
77
78
|
1: {
|
|
78
79
|
chainId: 1,
|
|
79
80
|
name: "Ethereum",
|
|
80
81
|
easContractAddress: "0xA1207F3BBa224E2c9c3c6D5aF63D0eb1582Ce587",
|
|
81
82
|
schemaRegistryAddress: "0xA7b39296258348C78294F95B872b282326A97BDF",
|
|
82
|
-
...
|
|
83
|
+
...m(null)
|
|
83
84
|
},
|
|
84
85
|
11155111: {
|
|
85
86
|
chainId: 11155111,
|
|
86
87
|
name: "Sepolia",
|
|
87
88
|
easContractAddress: "0xC2679fBD37d54388Ce493F1DB75320D236e1815e",
|
|
88
89
|
schemaRegistryAddress: "0x0a7E2Ff54e76B8E6659aedc9103FB21c038050D0",
|
|
89
|
-
...
|
|
90
|
+
...m("sepolia"),
|
|
90
91
|
testnet: !0
|
|
91
92
|
},
|
|
92
|
-
10:
|
|
93
|
-
11155420:
|
|
94
|
-
8453:
|
|
95
|
-
84532:
|
|
93
|
+
10: p(10, "Optimism", "optimism"),
|
|
94
|
+
11155420: p(11155420, "Optimism Sepolia", "optimism-sepolia", !0),
|
|
95
|
+
8453: p(8453, "Base", "base"),
|
|
96
|
+
84532: p(84532, "Base Sepolia", "base-sepolia", !0),
|
|
96
97
|
42161: {
|
|
97
98
|
chainId: 42161,
|
|
98
99
|
name: "Arbitrum One",
|
|
99
100
|
easContractAddress: "0xbD75f629A22Dc1ceD33dDA0b68c546A1c035c458",
|
|
100
101
|
schemaRegistryAddress: "0xA310da9c5B885E7fb3fbA9D66E9Ba6Df512b78eB",
|
|
101
|
-
...
|
|
102
|
+
...m("arbitrum")
|
|
102
103
|
},
|
|
103
104
|
421614: {
|
|
104
105
|
chainId: 421614,
|
|
@@ -112,28 +113,28 @@ var m = {
|
|
|
112
113
|
name: "Polygon",
|
|
113
114
|
easContractAddress: "0x5E634ef5355f45A855d02D66eCD687b1502AF790",
|
|
114
115
|
schemaRegistryAddress: "0x7876EEF51A891E737AF8ba5A5E0f0Fd29073D5a7",
|
|
115
|
-
...
|
|
116
|
+
...m("polygon")
|
|
116
117
|
},
|
|
117
118
|
534352: {
|
|
118
119
|
chainId: 534352,
|
|
119
120
|
name: "Scroll",
|
|
120
121
|
easContractAddress: "0xC47300428b6AD2c7D03BB76D05A176058b47E6B0",
|
|
121
122
|
schemaRegistryAddress: "0xD2CDF46556543316e7D34e8eDc4624e2bB95e3B6",
|
|
122
|
-
...
|
|
123
|
+
...m("scroll")
|
|
123
124
|
},
|
|
124
125
|
59144: {
|
|
125
126
|
chainId: 59144,
|
|
126
127
|
name: "Linea",
|
|
127
128
|
easContractAddress: "0xaEF4103A04090071165F78D45D83A0C0782c2B2a",
|
|
128
129
|
schemaRegistryAddress: "0x55D26f9ae0203EF95494AE4C170eD35f4Cf77797",
|
|
129
|
-
...
|
|
130
|
+
...m("linea")
|
|
130
131
|
}
|
|
131
|
-
},
|
|
132
|
-
function
|
|
133
|
-
return
|
|
132
|
+
}, g = 11155420;
|
|
133
|
+
function _(e) {
|
|
134
|
+
return h[e];
|
|
134
135
|
}
|
|
135
|
-
function
|
|
136
|
-
let n =
|
|
136
|
+
function v(e, t = {}) {
|
|
137
|
+
let n = _(e), r = Object.fromEntries(Object.entries(t).filter(([, e]) => e !== void 0)), i = {
|
|
137
138
|
...n,
|
|
138
139
|
...r,
|
|
139
140
|
chainId: e
|
|
@@ -144,17 +145,17 @@ function _(e, t = {}) {
|
|
|
144
145
|
name: i.name ?? `chain ${e}`
|
|
145
146
|
};
|
|
146
147
|
}
|
|
147
|
-
function
|
|
148
|
+
function y(e, t) {
|
|
148
149
|
if (e.explorerUrl) return `${e.explorerUrl.replace(/\/+$/, "")}/attestation/view/${t}`;
|
|
149
150
|
}
|
|
150
151
|
//#endregion
|
|
151
152
|
//#region src/easEndpoint.ts
|
|
152
|
-
var
|
|
153
|
+
var b = {
|
|
153
154
|
sdk: {},
|
|
154
155
|
publish: {},
|
|
155
156
|
localDb: {}
|
|
156
|
-
},
|
|
157
|
-
function
|
|
157
|
+
}, x = /* @__PURE__ */ new Set(), S = /* @__PURE__ */ new Set(), C = !1;
|
|
158
|
+
function w() {
|
|
158
159
|
try {
|
|
159
160
|
if (typeof process < "u" && process.env) {
|
|
160
161
|
let e = process.env.NEXT_PUBLIC_EAS_ENDPOINT || process.env.EAS_ENDPOINT;
|
|
@@ -164,7 +165,7 @@ function C() {
|
|
|
164
165
|
let e = globalThis.window?.env;
|
|
165
166
|
return e?.NEXT_PUBLIC_EAS_ENDPOINT || e?.EAS_ENDPOINT || void 0;
|
|
166
167
|
}
|
|
167
|
-
function
|
|
168
|
+
function T() {
|
|
168
169
|
let e;
|
|
169
170
|
try {
|
|
170
171
|
typeof process < "u" && process.env && (e = process.env.NEXT_PUBLIC_EAS_CHAIN_ID || process.env.EAS_CHAIN_ID);
|
|
@@ -172,72 +173,149 @@ function w() {
|
|
|
172
173
|
let t = Number(e);
|
|
173
174
|
return e && Number.isInteger(t) && t > 0 ? t : void 0;
|
|
174
175
|
}
|
|
175
|
-
function
|
|
176
|
+
function E(e, t) {
|
|
176
177
|
let n = t.chainId;
|
|
177
|
-
if (n !== void 0) for (let t of Object.keys(
|
|
178
|
-
let r =
|
|
179
|
-
if (t !== e && r !== void 0 && r !== n) throw Error(
|
|
178
|
+
if (n !== void 0) for (let t of Object.keys(b)) {
|
|
179
|
+
let r = b[t].chainId;
|
|
180
|
+
if (t !== e && r !== void 0 && r !== n) throw Error(A({
|
|
180
181
|
[e]: n,
|
|
181
182
|
[t]: r
|
|
182
183
|
}));
|
|
183
184
|
}
|
|
184
|
-
if (
|
|
185
|
+
if (b[e] = { ...t }, O()) for (let e of [...S]) e();
|
|
185
186
|
}
|
|
186
|
-
function
|
|
187
|
-
|
|
187
|
+
function D(e) {
|
|
188
|
+
x.add(e);
|
|
188
189
|
}
|
|
189
|
-
function
|
|
190
|
-
if (
|
|
191
|
-
for (let e of
|
|
190
|
+
function O() {
|
|
191
|
+
if (j() || b.localDb.chainId !== void 0) return !0;
|
|
192
|
+
for (let e of x) if (b[e].chainId === void 0) return !1;
|
|
192
193
|
return !0;
|
|
193
194
|
}
|
|
194
|
-
function
|
|
195
|
-
return
|
|
195
|
+
function k(e) {
|
|
196
|
+
return O() ? Promise.resolve(!0) : new Promise((t) => {
|
|
196
197
|
let n = (e) => {
|
|
197
|
-
clearTimeout(i),
|
|
198
|
+
clearTimeout(i), S.delete(r), t(e);
|
|
198
199
|
}, r = () => n(!0), i = setTimeout(() => n(!1), e);
|
|
199
|
-
|
|
200
|
+
S.add(r);
|
|
200
201
|
});
|
|
201
202
|
}
|
|
202
|
-
function
|
|
203
|
+
function A(e) {
|
|
203
204
|
if (e.localDb !== void 0) {
|
|
204
205
|
let t = e.sdk ?? e.publish;
|
|
205
206
|
return `Seed Protocol chain mismatch: the local database holds attestations from chain ${e.localDb}, but the app is configured for chain ${t}. Use a separate database per chain (SeedConfig.filesDir / dbConfig), clear the local database, or configure chain ${e.localDb} again.`;
|
|
206
207
|
}
|
|
207
208
|
return `Seed Protocol chain mismatch: the SDK reads EAS on chain ${e.sdk} but @seedprotocol/publish writes to chain ${e.publish}. Use the same chain in SeedConfig.eas.chainId and PublishConfig.chain.`;
|
|
208
209
|
}
|
|
209
|
-
function A() {
|
|
210
|
-
return y.sdk.chainId !== void 0 || y.publish.chainId !== void 0 || w() !== void 0;
|
|
211
|
-
}
|
|
212
210
|
function j() {
|
|
213
|
-
|
|
211
|
+
return b.sdk.chainId !== void 0 || b.publish.chainId !== void 0 || T() !== void 0;
|
|
214
212
|
}
|
|
215
213
|
function M() {
|
|
216
|
-
|
|
214
|
+
b.sdk = {}, b.publish = {}, b.localDb = {}, x.clear(), S.clear(), C = !1;
|
|
217
215
|
}
|
|
218
216
|
function N() {
|
|
219
|
-
|
|
220
|
-
|
|
217
|
+
return b.sdk.chainId ?? b.publish.chainId ?? b.localDb.chainId ?? T() ?? 11155420;
|
|
218
|
+
}
|
|
219
|
+
function P() {
|
|
220
|
+
if (b.sdk.indexerUrl) return b.sdk.indexerUrl;
|
|
221
|
+
let e = N(), t = _(e)?.indexerUrl, n = w();
|
|
221
222
|
if (n) {
|
|
222
|
-
let r =
|
|
223
|
+
let r = I(n);
|
|
223
224
|
if (r !== void 0 && r !== e) throw Error(`Seed Protocol chain mismatch: EAS_ENDPOINT / NEXT_PUBLIC_EAS_ENDPOINT (${n}) is the indexer for chain ${r}, but Seed reads EAS on chain ${e}. Unset it, point it at chain ${e}'s indexer, or set SeedConfig.eas.indexerUrl.`);
|
|
224
|
-
return t && t !== n && e !== 11155420 && !
|
|
225
|
+
return t && t !== n && e !== 11155420 && !C && (C = !0, console.warn(`[Seed Protocol] EAS_ENDPOINT (${n}) overrides the indexer for chain ${e} (${t}). Make sure it indexes chain ${e}, or set SeedConfig.eas.indexerUrl.`)), n;
|
|
225
226
|
}
|
|
226
|
-
let r = t ??
|
|
227
|
+
let r = t ?? b.publish.indexerUrl;
|
|
227
228
|
if (!r) throw Error(`No EAS indexer is known for chain ${e}. Set SeedConfig.eas.indexerUrl (or the EAS_ENDPOINT env var).`);
|
|
228
229
|
return r;
|
|
229
230
|
}
|
|
230
|
-
function
|
|
231
|
+
function F(e) {
|
|
231
232
|
return e.trim().replace(/\/+$/, "").toLowerCase();
|
|
232
233
|
}
|
|
233
|
-
function
|
|
234
|
-
let t =
|
|
235
|
-
for (let [e, n] of Object.entries(
|
|
234
|
+
function I(e) {
|
|
235
|
+
let t = F(e);
|
|
236
|
+
for (let [e, n] of Object.entries(h)) if (n.indexerUrl && F(n.indexerUrl) === t) return Number(e);
|
|
237
|
+
}
|
|
238
|
+
//#endregion
|
|
239
|
+
//#region src/easTiming.ts
|
|
240
|
+
var L = e("seedEas:timing"), R = () => typeof performance < "u" ? performance.now() : Date.now(), z = (e, t = []) => {
|
|
241
|
+
if (Array.isArray(e)) for (let n of e) z(n, t);
|
|
242
|
+
else if (e && typeof e == "object") for (let [n, r] of Object.entries(e)) {
|
|
243
|
+
let e = r?.in;
|
|
244
|
+
(n === "id" || n === "refUID") && Array.isArray(e) ? t.push(`${n}.in=${e.length}`) : z(r, t);
|
|
245
|
+
}
|
|
246
|
+
return t;
|
|
247
|
+
}, B = (e) => {
|
|
248
|
+
if (typeof e != "string") return {
|
|
249
|
+
operation: "(unnamed)",
|
|
250
|
+
filters: []
|
|
251
|
+
};
|
|
252
|
+
try {
|
|
253
|
+
let t = JSON.parse(e);
|
|
254
|
+
return {
|
|
255
|
+
operation: t.operationName || "(unnamed)",
|
|
256
|
+
filters: z(t.variables?.where)
|
|
257
|
+
};
|
|
258
|
+
} catch {
|
|
259
|
+
return {
|
|
260
|
+
operation: "(unnamed)",
|
|
261
|
+
filters: []
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
}, V = (e) => {
|
|
265
|
+
try {
|
|
266
|
+
let t = JSON.parse(e).data;
|
|
267
|
+
return t ? Object.values(t).reduce((e, t) => e + (Array.isArray(t) ? t.length : +!!t), 0) : void 0;
|
|
268
|
+
} catch {
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
};
|
|
272
|
+
async function H(e, t) {
|
|
273
|
+
if (!L.enabled) return e();
|
|
274
|
+
let n = R(), { operation: r, filters: i } = B(t?.body), a = [
|
|
275
|
+
"request",
|
|
276
|
+
r,
|
|
277
|
+
...i
|
|
278
|
+
].join(" "), o;
|
|
279
|
+
try {
|
|
280
|
+
o = await e();
|
|
281
|
+
} catch (e) {
|
|
282
|
+
throw L(`${a} ${Math.round(R() - n)}ms (failed: ${e?.name ?? "error"})`), e;
|
|
283
|
+
}
|
|
284
|
+
let s = await o.text(), c = V(s), l = new TextEncoder().encode(s).length, u = o.ok ? "" : ` status=${o.status}`;
|
|
285
|
+
return L(`${a} rows=${c ?? "?"} bytes=${l}${u} ${Math.round(R() - n)}ms`), new Response(s, {
|
|
286
|
+
status: o.status,
|
|
287
|
+
statusText: o.statusText,
|
|
288
|
+
headers: o.headers
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
var U = /* @__PURE__ */ new Map();
|
|
292
|
+
async function W(e, t) {
|
|
293
|
+
if (!L.enabled) return e.fetchQuery(t);
|
|
294
|
+
let n = JSON.stringify(t.queryKey), r = U.has(n), i = !1, a = async () => {
|
|
295
|
+
i = !0, U.set(n, (U.get(n) ?? 0) + 1);
|
|
296
|
+
try {
|
|
297
|
+
return await t.queryFn();
|
|
298
|
+
} finally {
|
|
299
|
+
let e = (U.get(n) ?? 1) - 1;
|
|
300
|
+
e > 0 ? U.set(n, e) : U.delete(n);
|
|
301
|
+
}
|
|
302
|
+
}, o = R(), s = !1;
|
|
303
|
+
try {
|
|
304
|
+
return await e.fetchQuery({
|
|
305
|
+
...t,
|
|
306
|
+
queryFn: a
|
|
307
|
+
});
|
|
308
|
+
} catch (e) {
|
|
309
|
+
throw s = !0, e;
|
|
310
|
+
} finally {
|
|
311
|
+
let e = i ? "network" : r ? "deduped" : "cache";
|
|
312
|
+
L(`fetchQuery ${String(t.queryKey[0])} ${e} ${Math.round(R() - o)}ms${s ? " (failed)" : ""}`);
|
|
313
|
+
}
|
|
236
314
|
}
|
|
237
315
|
//#endregion
|
|
238
316
|
//#region src/EasClient/createEasGraphQLClient.ts
|
|
239
|
-
var
|
|
240
|
-
function
|
|
317
|
+
var G = 3e4;
|
|
318
|
+
function K(e, t) {
|
|
241
319
|
if (typeof AbortSignal > "u" || typeof AbortSignal.timeout != "function") return e;
|
|
242
320
|
let n = AbortSignal.timeout(t), r = e?.signal, i = r && typeof AbortSignal.any == "function" ? AbortSignal.any([r, n]) : r ?? n;
|
|
243
321
|
return {
|
|
@@ -245,38 +323,45 @@ function L(e, t) {
|
|
|
245
323
|
signal: i
|
|
246
324
|
};
|
|
247
325
|
}
|
|
248
|
-
function
|
|
249
|
-
return new e
|
|
326
|
+
function q(e, n = G, { dispatcher: r } = {}) {
|
|
327
|
+
return new t(e, { fetch: (e, t) => {
|
|
328
|
+
let i = K(t, n), a = r ? {
|
|
329
|
+
...i,
|
|
330
|
+
dispatcher: r
|
|
331
|
+
} : i;
|
|
332
|
+
return H(() => fetch(e, a), t);
|
|
333
|
+
} });
|
|
250
334
|
}
|
|
251
335
|
//#endregion
|
|
252
336
|
//#region src/default/EasClient.ts
|
|
253
|
-
var
|
|
337
|
+
var J = class {
|
|
254
338
|
easClient;
|
|
339
|
+
getDispatcher() {}
|
|
255
340
|
getEasClient() {
|
|
256
|
-
let e =
|
|
341
|
+
let e = P();
|
|
257
342
|
return this.easClient?.url !== e && (this.easClient = {
|
|
258
343
|
url: e,
|
|
259
|
-
client:
|
|
344
|
+
client: q(e, G, { dispatcher: this.getDispatcher() })
|
|
260
345
|
}), this.easClient.client;
|
|
261
346
|
}
|
|
262
|
-
},
|
|
347
|
+
}, Y = (e) => {
|
|
263
348
|
let t = "";
|
|
264
349
|
try {
|
|
265
|
-
t =
|
|
350
|
+
t = P();
|
|
266
351
|
} catch {}
|
|
267
352
|
return [t, ...e];
|
|
268
|
-
},
|
|
353
|
+
}, X = class {
|
|
269
354
|
queryClient;
|
|
270
355
|
getQueryClient() {
|
|
271
356
|
if (this.queryClient) return this.queryClient;
|
|
272
|
-
let e = new
|
|
357
|
+
let e = new n({ defaultOptions: { queries: {
|
|
273
358
|
gcTime: 0,
|
|
274
359
|
networkMode: "always",
|
|
275
360
|
structuralSharing: !1
|
|
276
361
|
} } });
|
|
277
362
|
return this.queryClient = {
|
|
278
363
|
fetchQuery: ({ queryKey: t, queryFn: n, networkMode: r, staleTime: i }) => e.query({
|
|
279
|
-
queryKey:
|
|
364
|
+
queryKey: Y(t),
|
|
280
365
|
queryFn: n,
|
|
281
366
|
...r ? { networkMode: r === "onlineOnly" ? "online" : r } : {},
|
|
282
367
|
...i ? {
|
|
@@ -284,14 +369,14 @@ var z = class {
|
|
|
284
369
|
gcTime: i
|
|
285
370
|
} : {}
|
|
286
371
|
}),
|
|
287
|
-
getQueryData: (t) => e.getQueryData(
|
|
372
|
+
getQueryData: (t) => e.getQueryData(Y(t)),
|
|
288
373
|
removeQueries: async ({ queryKey: t }) => {
|
|
289
|
-
e.removeQueries({ queryKey:
|
|
374
|
+
e.removeQueries({ queryKey: Y(t) });
|
|
290
375
|
}
|
|
291
376
|
}, this.queryClient;
|
|
292
377
|
}
|
|
293
378
|
};
|
|
294
379
|
//#endregion
|
|
295
|
-
export { o as C,
|
|
380
|
+
export { o as C, l as S, c as T, f as _, W as a, v as b, P as c, O as d, M as f, d as g, h, q as i, N as l, g as m, J as n, E as o, k as p, G as r, D as s, X as t, j as u, y as v, s as w, u as x, _ as y };
|
|
296
381
|
|
|
297
|
-
//# sourceMappingURL=QueryClient-
|
|
382
|
+
//# sourceMappingURL=QueryClient-D3BW5tJk.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"QueryClient-D3BW5tJk.js","names":["TanStackQueryClient","debug","OWNER_KEY","thisCopy","markEasClientOwner","DuplicateEasModuleError","assertSingleEasModule","owner","resetEasClientOwnerForTests","BaseEasClient","impl","BaseQueryClient","OP_STACK_EAS_CONTRACT_ADDRESS","OP_STACK_SCHEMA_REGISTRY_ADDRESS","opStack","easscanSubdomain","easscan","origin","subdomain","EAS_CHAIN_DEPLOYMENTS","DEFAULT_EAS_CHAIN_ID","getEasChainDeployment","chainId","resolveEasChainDeployment","known","definedOverrides","overrides","v","merged","getEasAttestationExplorerUrl","deployment","uid","settings","expectedSources","settledListeners","warnedEnvOverride","readEnvEndpoint","windowEnv","readEnvChainId","raw","parsed","configureEasReadChain","setting","other","otherId","source","chainMismatchMessage","isEasReadChainSettled","listener","expectEasReadChain","isEasReadChainConfigured","whenEasReadChainSettled","done","timer","onSettled","resolve","settled","timeoutMs","ids","configured","resetEasReadChain","getEasReadChainId","getEasEndpoint","knownIndexer","env","envChainId","chainIdOfKnownIndexer","url","normalizeUrl","target","id","easTimingLogger","now","uidListLengths","where","entry","out","key","value","list","describeRequestBody","body","countRows","data","text","sum","timedEasFetch","doFetch","start","init","label","operation","filters","response","error","rows","bytes","status","inFlightKeys","timedFetchQuery","queryClient","options","wasInFlight","ran","queryFn","left","failed","EAS_REQUEST_TIMEOUT_MS","withTimeout","timeout","callerSignal","signal","createEasGraphQLClient","GraphQLClient","timed","requestInit","dispatcher","input","DefaultEasClient","scopeKey","endpoint","queryKey","DefaultQueryClient","client","QueryClient","networkMode","staleTime"],"sources":["../src/moduleOwner.ts","../src/EasClient/BaseEasClient.ts","../src/QueryClient/BaseQueryClient.ts","../src/chains.ts","../src/easEndpoint.ts","../src/easTiming.ts","../src/EasClient/createEasGraphQLClient.ts","../src/default/EasClient.ts","../src/default/QueryClient.ts"],"sourcesContent":["/**\n * Detects a second copy of this package in one page or process. Each copy has its own\n * BaseEasClient / BaseQueryClient slots and its own chain settings, so code reading through\n * one copy would quietly miss the clients and chain registered on the other.\n *\n * Whichever copy last registered a client records itself under a global key that every copy\n * shares; {@link assertSingleEasModule} throws when that is not the caller's copy.\n */\nconst OWNER_KEY = Symbol.for('@seedprotocol/eas:clientOwner')\n\n/** Identity of this copy of the module. */\nconst thisCopy = Object.freeze({ package: '@seedprotocol/eas' })\n\ntype GlobalWithOwner = typeof globalThis & { [OWNER_KEY]?: object }\n\n/** @internal Called by BaseEasClient / BaseQueryClient when a client is registered. */\nexport function markEasClientOwner(): void {\n ;(globalThis as GlobalWithOwner)[OWNER_KEY] = thisCopy\n}\n\nexport class DuplicateEasModuleError extends Error {\n constructor() {\n super(\n 'Two copies of @seedprotocol/eas are loaded, and EAS clients were registered on the other copy ' +\n '(e.g. by SeedClient). Reads through this copy would use different clients and a different chain. ' +\n 'Make sure every @seedprotocol/* package is the same version and installed once (`npm ls @seedprotocol/eas`). ' +\n 'With Vite, keep @seedprotocol/* packages out of optimizeDeps.exclude so they are pre-bundled together, ' +\n 'and dedupe them (seedVitePlugin does) when they are linked into the app.',\n )\n this.name = 'DuplicateEasModuleError'\n }\n}\n\n/** Throws {@link DuplicateEasModuleError} when another copy of this package registered EAS clients. */\nexport function assertSingleEasModule(): void {\n const owner = (globalThis as GlobalWithOwner)[OWNER_KEY]\n if (owner !== undefined && owner !== thisCopy) throw new DuplicateEasModuleError()\n}\n\n/** @internal Tests that load fresh module copies (vi.resetModules) clear the shared marker. */\nexport function resetEasClientOwnerForTests(): void {\n delete (globalThis as GlobalWithOwner)[OWNER_KEY]\n}\n","import type { Attestation } from '../graphql/gql/graphql.js'\nimport type { GraphQLClient } from 'graphql-request'\nimport type { IEasClient } from './IEasClient.js'\nimport { markEasClientOwner } from '../moduleOwner.js'\n\nexport abstract class BaseEasClient {\n private static _impl: IEasClient | null = null\n\n static configure(impl: IEasClient): void {\n if (!impl) {\n throw new Error(\n 'Cannot configure EasClient with undefined or null. Ensure the platform-specific EasClient is properly created.',\n )\n }\n BaseEasClient._impl = impl\n markEasClientOwner()\n }\n\n /** True once a platform (SDK, Node bootstrap, host app) has registered an implementation. */\n static isConfigured(): boolean {\n return BaseEasClient._impl != null\n }\n\n private static requireImpl(): IEasClient {\n if (!BaseEasClient._impl) {\n throw new Error(\n 'EasClient not configured. Import from @seedprotocol/eas/node to register the Node.js implementation, or ensure SDK platform init has run.',\n )\n }\n return BaseEasClient._impl\n }\n\n static getEasClient(): GraphQLClient {\n return BaseEasClient.requireImpl().getEasClient()\n }\n\n /**\n * @deprecated Prefer getSeedsBySchemaName from @seedprotocol/eas api helpers.\n * Kept for API compatibility; not implemented by platform clients.\n */\n static async getSeedsBySchemaName(_schemaName: string): Promise<Attestation[]> {\n throw new Error(\n 'BaseEasClient.getSeedsBySchemaName is not implemented. Use getSeedsBySchemaName from @seedprotocol/eas instead.',\n )\n }\n}\n\nexport { BaseEasClient as EasClient }\n","import type { IQueryClient } from './IQueryClient.js'\nimport type { IQueryClientFactory } from './IQueryClientFactory.js'\nimport { markEasClientOwner } from '../moduleOwner.js'\n\nexport abstract class BaseQueryClient {\n private static _impl: IQueryClientFactory | null = null\n\n static configure(impl: IQueryClientFactory): void {\n if (!impl) {\n throw new Error(\n 'Cannot configure QueryClient with undefined or null. Ensure the platform-specific QueryClient is properly created.',\n )\n }\n BaseQueryClient._impl = impl\n markEasClientOwner()\n }\n\n /** True once a platform (SDK, Node bootstrap, host app) has registered an implementation. */\n static isConfigured(): boolean {\n return BaseQueryClient._impl != null\n }\n\n private static requireImpl(): IQueryClientFactory {\n if (!BaseQueryClient._impl) {\n throw new Error(\n 'QueryClient not configured. Import from @seedprotocol/eas/node to register the Node.js implementation.',\n )\n }\n return BaseQueryClient._impl\n }\n\n static getQueryClient(): IQueryClient {\n return BaseQueryClient.requireImpl().getQueryClient()\n }\n}\n","/**\n * EAS deployments per chain. Pure data (no viem / thirdweb) so read and write packages can share it.\n *\n * Addresses from https://github.com/ethereum-attestation-service/eas-contracts#deployments.\n * OP Stack chains use the predeploys 0x4200…0021 (EAS) and 0x4200…0020 (SchemaRegistry).\n */\n\nexport type HexAddress = `0x${string}`\n\nexport interface EasChainDeployment {\n chainId: number\n /** Human-readable chain name (used in error messages). */\n name: string\n easContractAddress: HexAddress\n schemaRegistryAddress: HexAddress\n /** EAS indexer GraphQL endpoint (easscan). */\n indexerUrl?: string\n /** EAS explorer origin; attestation pages live at `{explorerUrl}/attestation/view/{uid}`. */\n explorerUrl?: string\n testnet?: boolean\n}\n\nexport const OP_STACK_EAS_CONTRACT_ADDRESS: HexAddress = '0x4200000000000000000000000000000000000021'\nexport const OP_STACK_SCHEMA_REGISTRY_ADDRESS: HexAddress = '0x4200000000000000000000000000000000000020'\n\nfunction opStack(\n chainId: number,\n name: string,\n easscanSubdomain: string,\n testnet = false,\n): EasChainDeployment {\n return {\n chainId,\n name,\n easContractAddress: OP_STACK_EAS_CONTRACT_ADDRESS,\n schemaRegistryAddress: OP_STACK_SCHEMA_REGISTRY_ADDRESS,\n indexerUrl: `https://${easscanSubdomain}.easscan.org/graphql`,\n explorerUrl: `https://${easscanSubdomain}.easscan.org`,\n testnet,\n }\n}\n\nfunction easscan(subdomain: string | null) {\n const origin = subdomain ? `https://${subdomain}.easscan.org` : 'https://easscan.org'\n return { indexerUrl: `${origin}/graphql`, explorerUrl: origin }\n}\n\n/** Known EAS deployments keyed by chain id. */\nexport const EAS_CHAIN_DEPLOYMENTS: Readonly<Record<number, EasChainDeployment>> = {\n 1: {\n chainId: 1,\n name: 'Ethereum',\n easContractAddress: '0xA1207F3BBa224E2c9c3c6D5aF63D0eb1582Ce587',\n schemaRegistryAddress: '0xA7b39296258348C78294F95B872b282326A97BDF',\n ...easscan(null),\n },\n 11155111: {\n chainId: 11155111,\n name: 'Sepolia',\n easContractAddress: '0xC2679fBD37d54388Ce493F1DB75320D236e1815e',\n schemaRegistryAddress: '0x0a7E2Ff54e76B8E6659aedc9103FB21c038050D0',\n ...easscan('sepolia'),\n testnet: true,\n },\n 10: opStack(10, 'Optimism', 'optimism'),\n 11155420: opStack(11155420, 'Optimism Sepolia', 'optimism-sepolia', true),\n 8453: opStack(8453, 'Base', 'base'),\n 84532: opStack(84532, 'Base Sepolia', 'base-sepolia', true),\n 42161: {\n chainId: 42161,\n name: 'Arbitrum One',\n easContractAddress: '0xbD75f629A22Dc1ceD33dDA0b68c546A1c035c458',\n schemaRegistryAddress: '0xA310da9c5B885E7fb3fbA9D66E9Ba6Df512b78eB',\n ...easscan('arbitrum'),\n },\n 421614: {\n chainId: 421614,\n name: 'Arbitrum Sepolia',\n easContractAddress: '0x2521021fc8BF070473E1e1801D3c7B4aB701E1dE',\n schemaRegistryAddress: '0x45CB6Fa0870a8Af06796Ac15915619a0f22cd475',\n // No public easscan indexer found for this chain; set SeedConfig.eas.indexerUrl.\n testnet: true,\n },\n 137: {\n chainId: 137,\n name: 'Polygon',\n easContractAddress: '0x5E634ef5355f45A855d02D66eCD687b1502AF790',\n schemaRegistryAddress: '0x7876EEF51A891E737AF8ba5A5E0f0Fd29073D5a7',\n ...easscan('polygon'),\n },\n 534352: {\n chainId: 534352,\n name: 'Scroll',\n easContractAddress: '0xC47300428b6AD2c7D03BB76D05A176058b47E6B0',\n schemaRegistryAddress: '0xD2CDF46556543316e7D34e8eDc4624e2bB95e3B6',\n ...easscan('scroll'),\n },\n 59144: {\n chainId: 59144,\n name: 'Linea',\n easContractAddress: '0xaEF4103A04090071165F78D45D83A0C0782c2B2a',\n schemaRegistryAddress: '0x55D26f9ae0203EF95494AE4C170eD35f4Cf77797',\n ...easscan('linea'),\n },\n}\n\n/** Chain id Seed Protocol uses when an app does not configure one. */\nexport const DEFAULT_EAS_CHAIN_ID = 11155420\n\nexport function getEasChainDeployment(chainId: number): EasChainDeployment | undefined {\n return EAS_CHAIN_DEPLOYMENTS[chainId]\n}\n\n/**\n * Merge a known deployment with app overrides. Throws when the chain is unknown and the\n * overrides do not supply both contract addresses.\n */\nexport function resolveEasChainDeployment(\n chainId: number,\n overrides: Partial<Omit<EasChainDeployment, 'chainId'>> = {},\n): EasChainDeployment {\n const known = getEasChainDeployment(chainId)\n const definedOverrides = Object.fromEntries(\n Object.entries(overrides).filter(([, v]) => v !== undefined),\n ) as Partial<EasChainDeployment>\n const merged = { ...known, ...definedOverrides, chainId } as Partial<EasChainDeployment>\n if (!merged.easContractAddress || !merged.schemaRegistryAddress) {\n throw new Error(\n `No known EAS deployment for chain ${chainId}. Pass easContractAddress and schemaRegistryAddress for this chain.`,\n )\n }\n return {\n ...merged,\n name: merged.name ?? `chain ${chainId}`,\n } as EasChainDeployment\n}\n\n/** Build `{explorerUrl}/attestation/view/{uid}`, or undefined when the chain has no explorer. */\nexport function getEasAttestationExplorerUrl(\n deployment: Pick<EasChainDeployment, 'explorerUrl'>,\n uid: string,\n): string | undefined {\n if (!deployment.explorerUrl) return undefined\n return `${deployment.explorerUrl.replace(/\\/+$/, '')}/attestation/view/${uid}`\n}\n","import { DEFAULT_EAS_CHAIN_ID, EAS_CHAIN_DEPLOYMENTS, getEasChainDeployment } from './chains.js'\n\n/**\n * Which EAS chain / indexer the read side (sync, schema lookups) talks to.\n *\n * Three sources can set it, each in its own slot so init order does not matter:\n * - `sdk`: `SeedConfig.eas`\n * - `publish`: `PublishConfig.chain`\n * - `localDb`: the chain the SDK's local database already holds data from (lowest priority;\n * lets reads start on the right chain before publish is initialized)\n * Conflicting chain ids throw instead of silently reading one chain while writing another.\n * Below those, the `EAS_CHAIN_ID` / `NEXT_PUBLIC_EAS_CHAIN_ID` env var sets the chain for\n * processes without SDK or publish config (e.g. a feed server); the default is Optimism Sepolia.\n *\n * Indexer URL precedence: SDK `indexerUrl` > `EAS_ENDPOINT` / `NEXT_PUBLIC_EAS_ENDPOINT` env >\n * the configured chain's known indexer > Optimism Sepolia. An env URL that is another chain's\n * known indexer throws, so a leftover env var cannot make reads follow the wrong chain.\n */\nexport type EasReadChainSource = 'sdk' | 'publish' | 'localDb'\n\nexport interface EasReadChainSetting {\n chainId?: number\n /** EAS indexer GraphQL endpoint. Required for chains without a known indexer. */\n indexerUrl?: string\n}\n\nconst settings: Record<EasReadChainSource, EasReadChainSetting> = { sdk: {}, publish: {}, localDb: {} }\n/** Sources that have announced they will configure a chain (e.g. publish, at import). */\nconst expectedSources = new Set<EasReadChainSource>()\nconst settledListeners = new Set<() => void>()\nlet warnedEnvOverride = false\n\nfunction readEnvEndpoint(): string | undefined {\n try {\n if (typeof process !== 'undefined' && process.env) {\n const v = process.env.NEXT_PUBLIC_EAS_ENDPOINT || process.env.EAS_ENDPOINT\n if (v) return v\n }\n } catch {\n // process.env access can throw in some bundler shims\n }\n const windowEnv = (globalThis as { window?: { env?: Record<string, string | undefined> } }).window?.env\n return windowEnv?.NEXT_PUBLIC_EAS_ENDPOINT || windowEnv?.EAS_ENDPOINT || undefined\n}\n\nfunction readEnvChainId(): number | undefined {\n let raw: string | undefined\n try {\n if (typeof process !== 'undefined' && process.env) {\n raw = process.env.NEXT_PUBLIC_EAS_CHAIN_ID || process.env.EAS_CHAIN_ID\n }\n } catch {\n // process.env access can throw in some bundler shims\n }\n const parsed = Number(raw)\n return raw && Number.isInteger(parsed) && parsed > 0 ? parsed : undefined\n}\n\n/**\n * Set the EAS read chain for one source. Throws when the other source already set a\n * different chain id; the previous setting is kept in that case.\n */\nexport function configureEasReadChain(source: EasReadChainSource, setting: EasReadChainSetting): void {\n const chainId = setting.chainId\n if (chainId !== undefined) {\n for (const other of Object.keys(settings) as EasReadChainSource[]) {\n const otherId = settings[other].chainId\n if (other !== source && otherId !== undefined && otherId !== chainId) {\n throw new Error(chainMismatchMessage({ [source]: chainId, [other]: otherId }))\n }\n }\n }\n settings[source] = { ...setting }\n if (isEasReadChainSettled()) {\n for (const listener of [...settledListeners]) listener()\n }\n}\n\n/**\n * Announce that `source` will configure the chain later (e.g. `@seedprotocol/publish` calls\n * this when loaded, before `initPublish` runs). Until it does, {@link isEasReadChainSettled}\n * is false unless a chain is otherwise known, so EAS sync waits instead of reading the default.\n */\nexport function expectEasReadChain(source: EasReadChainSource): void {\n expectedSources.add(source)\n}\n\n/**\n * True when reads can start: a chain was set explicitly (SDK config, publish or `EAS_CHAIN_ID`),\n * the local DB recorded one, or no source that announced itself is still pending.\n */\nexport function isEasReadChainSettled(): boolean {\n if (isEasReadChainConfigured() || settings.localDb.chainId !== undefined) return true\n for (const source of expectedSources) {\n if (settings[source].chainId === undefined) return false\n }\n return true\n}\n\n/**\n * Resolves once {@link isEasReadChainSettled} is true. Resolves `false` after `timeoutMs`\n * when it never settles (the caller then proceeds on the current chain).\n */\nexport function whenEasReadChainSettled(timeoutMs: number): Promise<boolean> {\n if (isEasReadChainSettled()) return Promise.resolve(true)\n return new Promise((resolve) => {\n const done = (settled: boolean) => {\n clearTimeout(timer)\n settledListeners.delete(onSettled)\n resolve(settled)\n }\n const onSettled = () => done(true)\n const timer = setTimeout(() => done(false), timeoutMs)\n settledListeners.add(onSettled)\n })\n}\n\nfunction chainMismatchMessage(ids: Partial<Record<EasReadChainSource, number>>): string {\n if (ids.localDb !== undefined) {\n const configured = ids.sdk ?? ids.publish\n return `Seed Protocol chain mismatch: the local database holds attestations from chain ${ids.localDb}, but the app is configured for chain ${configured}. Use a separate database per chain (SeedConfig.filesDir / dbConfig), clear the local database, or configure chain ${ids.localDb} again.`\n }\n return `Seed Protocol chain mismatch: the SDK reads EAS on chain ${ids.sdk} but @seedprotocol/publish writes to chain ${ids.publish}. Use the same chain in SeedConfig.eas.chainId and PublishConfig.chain.`\n}\n\n/**\n * True when a chain id was chosen explicitly (SDK, publish or `EAS_CHAIN_ID`), as opposed to\n * the default or the local DB's recorded chain.\n */\nexport function isEasReadChainConfigured(): boolean {\n return (\n settings.sdk.chainId !== undefined ||\n settings.publish.chainId !== undefined ||\n readEnvChainId() !== undefined\n )\n}\n\n/** @internal Reset all sources (tests). */\nexport function resetEasReadChain(): void {\n settings.sdk = {}\n settings.publish = {}\n settings.localDb = {}\n expectedSources.clear()\n settledListeners.clear()\n warnedEnvOverride = false\n}\n\n/** Chain id the read side follows (defaults to Optimism Sepolia). */\nexport function getEasReadChainId(): number {\n return (\n settings.sdk.chainId ??\n settings.publish.chainId ??\n settings.localDb.chainId ??\n readEnvChainId() ??\n DEFAULT_EAS_CHAIN_ID\n )\n}\n\n/** Resolved EAS indexer GraphQL endpoint. Throws when the chain has no known indexer. */\nexport function getEasEndpoint(): string {\n if (settings.sdk.indexerUrl) return settings.sdk.indexerUrl\n\n const chainId = getEasReadChainId()\n const knownIndexer = getEasChainDeployment(chainId)?.indexerUrl\n const env = readEnvEndpoint()\n if (env) {\n const envChainId = chainIdOfKnownIndexer(env)\n if (envChainId !== undefined && envChainId !== chainId) {\n throw new Error(\n `Seed Protocol chain mismatch: EAS_ENDPOINT / NEXT_PUBLIC_EAS_ENDPOINT (${env}) is the indexer for chain ${envChainId}, but Seed reads EAS on chain ${chainId}. Unset it, point it at chain ${chainId}'s indexer, or set SeedConfig.eas.indexerUrl.`,\n )\n }\n if (knownIndexer && knownIndexer !== env && chainId !== DEFAULT_EAS_CHAIN_ID && !warnedEnvOverride) {\n warnedEnvOverride = true\n console.warn(\n `[Seed Protocol] EAS_ENDPOINT (${env}) overrides the indexer for chain ${chainId} (${knownIndexer}). Make sure it indexes chain ${chainId}, or set SeedConfig.eas.indexerUrl.`,\n )\n }\n return env\n }\n\n const url = knownIndexer ?? settings.publish.indexerUrl\n if (!url) {\n throw new Error(\n `No EAS indexer is known for chain ${chainId}. Set SeedConfig.eas.indexerUrl (or the EAS_ENDPOINT env var).`,\n )\n }\n return url\n}\n\nfunction normalizeUrl(url: string): string {\n return url.trim().replace(/\\/+$/, '').toLowerCase()\n}\n\n/** Chain whose known easscan indexer is `url`, if any. */\nfunction chainIdOfKnownIndexer(url: string): number | undefined {\n const target = normalizeUrl(url)\n for (const [id, deployment] of Object.entries(EAS_CHAIN_DEPLOYMENTS)) {\n if (deployment.indexerUrl && normalizeUrl(deployment.indexerUrl) === target) return Number(id)\n }\n return undefined\n}\n","import debug from 'debug'\nimport type { FetchQueryOptions, IQueryClient } from './QueryClient/IQueryClient.js'\n\n/**\n * Per-request EAS timings under `DEBUG=seedEas:timing`. Two kinds of line:\n *\n * - `request <operation> <filters> rows=<n> bytes=<n> <ms>ms`, one per indexer request, timed from\n * send until the response body is read and parsed. `<filters>` gives the length of each\n * `id: { in }` / `refUID: { in }` list in the `where`; `bytes` is the decoded body size.\n * - `fetchQuery <key> network|cache|deduped <ms>ms`, one per call of the api.ts helpers that go\n * through the query client: `network` when this call ran the request, `deduped` when it waited\n * on the same request already in flight, `cache` when the query client answered from its cache.\n */\nexport const easTimingLogger = debug('seedEas:timing')\n\nconst now = (): number => (typeof performance !== 'undefined' ? performance.now() : Date.now())\n\ntype FetchInit = Parameters<typeof fetch>[1]\n\nconst uidListLengths = (where: unknown, out: string[] = []): string[] => {\n if (Array.isArray(where)) {\n for (const entry of where) uidListLengths(entry, out)\n } else if (where && typeof where === 'object') {\n for (const [key, value] of Object.entries(where)) {\n const list = (value as { in?: unknown } | null)?.in\n if ((key === 'id' || key === 'refUID') && Array.isArray(list)) {\n out.push(`${key}.in=${list.length}`)\n } else {\n uidListLengths(value, out)\n }\n }\n }\n return out\n}\n\nconst describeRequestBody = (body: unknown): { operation: string; filters: string[] } => {\n if (typeof body !== 'string') return { operation: '(unnamed)', filters: [] }\n try {\n const parsed = JSON.parse(body) as { operationName?: string; variables?: { where?: unknown } }\n return { operation: parsed.operationName || '(unnamed)', filters: uidListLengths(parsed.variables?.where) }\n } catch {\n return { operation: '(unnamed)', filters: [] }\n }\n}\n\nconst countRows = (text: string): number | undefined => {\n try {\n const data = (JSON.parse(text) as { data?: Record<string, unknown> }).data\n if (!data) return undefined\n return Object.values(data).reduce<number>((sum, value) => sum + (Array.isArray(value) ? value.length : value ? 1 : 0), 0)\n } catch {\n return undefined\n }\n}\n\n/**\n * `fetch` that logs a request line when timing is on. The body is read here so the time covers\n * the whole response, then handed on as a new Response. When timing is off it is `doFetch`.\n */\nexport async function timedEasFetch(\n doFetch: () => Promise<Response>,\n init: FetchInit,\n): Promise<Response> {\n if (!easTimingLogger.enabled) return doFetch()\n const start = now()\n const { operation, filters } = describeRequestBody(init?.body)\n const label = ['request', operation, ...filters].join(' ')\n let response: Response\n try {\n response = await doFetch()\n } catch (error) {\n easTimingLogger(`${label} ${Math.round(now() - start)}ms (failed: ${(error as Error)?.name ?? 'error'})`)\n throw error\n }\n const text = await response.text()\n const rows = countRows(text)\n const bytes = new TextEncoder().encode(text).length\n const status = response.ok ? '' : ` status=${response.status}`\n easTimingLogger(`${label} rows=${rows ?? '?'} bytes=${bytes}${status} ${Math.round(now() - start)}ms`)\n return new Response(text, { status: response.status, statusText: response.statusText, headers: response.headers })\n}\n\n/** Keys of query functions started by `timedFetchQuery` and not yet settled. */\nconst inFlightKeys = new Map<string, number>()\n\n/**\n * `queryClient.fetchQuery(options)`, logging whether the result came from this call's request, a\n * request already in flight for the same key, or the query client's cache. When timing is off it\n * is `fetchQuery` unchanged.\n */\nexport async function timedFetchQuery<T>(queryClient: IQueryClient, options: FetchQueryOptions<T>): Promise<T> {\n if (!easTimingLogger.enabled) return queryClient.fetchQuery(options)\n const key = JSON.stringify(options.queryKey)\n const wasInFlight = inFlightKeys.has(key)\n let ran = false\n const queryFn = async () => {\n ran = true\n inFlightKeys.set(key, (inFlightKeys.get(key) ?? 0) + 1)\n try {\n return await options.queryFn()\n } finally {\n const left = (inFlightKeys.get(key) ?? 1) - 1\n if (left > 0) inFlightKeys.set(key, left)\n else inFlightKeys.delete(key)\n }\n }\n const start = now()\n let failed = false\n try {\n return await queryClient.fetchQuery({ ...options, queryFn })\n } catch (error) {\n failed = true\n throw error\n } finally {\n const source = ran ? 'network' : wasInFlight ? 'deduped' : 'cache'\n easTimingLogger(\n `fetchQuery ${String(options.queryKey[0])} ${source} ${Math.round(now() - start)}ms${failed ? ' (failed)' : ''}`,\n )\n }\n}\n","import { GraphQLClient } from 'graphql-request'\nimport { timedEasFetch } from '../easTiming.js'\n\n/**\n * How long one EAS indexer request may take before it is aborted. Without a limit a stalled\n * indexer holds every caller that awaits it (item creates and saves look up schemas) indefinitely.\n * Large sync queries stay well under this.\n */\nexport const EAS_REQUEST_TIMEOUT_MS = 30_000\n\ntype FetchInit = Parameters<typeof fetch>[1]\n\nfunction withTimeout(init: FetchInit, timeoutMs: number): FetchInit {\n if (typeof AbortSignal === 'undefined' || typeof AbortSignal.timeout !== 'function') return init\n const timeout = AbortSignal.timeout(timeoutMs)\n const callerSignal = init?.signal\n const signal =\n callerSignal && typeof AbortSignal.any === 'function' ? AbortSignal.any([callerSignal, timeout]) : callerSignal ?? timeout\n return { ...init, signal }\n}\n\nexport type EasGraphQLClientOptions = {\n /**\n * Passed to `fetch` as `dispatcher` on every request (Node's fetch takes an undici\n * `Dispatcher` there; other runtimes ignore it). `@seedprotocol/eas/node` sets one.\n */\n dispatcher?: unknown\n}\n\n/** A GraphQL client for the EAS indexer at `url` whose requests abort after `timeoutMs`. */\nexport function createEasGraphQLClient(\n url: string,\n timeoutMs = EAS_REQUEST_TIMEOUT_MS,\n { dispatcher }: EasGraphQLClientOptions = {},\n): GraphQLClient {\n return new GraphQLClient(url, {\n // Resolved per call, so a fetch replaced after construction (tests, polyfills) is used.\n fetch: (input: Parameters<typeof fetch>[0], init?: FetchInit) => {\n const timed = withTimeout(init, timeoutMs)\n const requestInit = dispatcher ? ({ ...timed, dispatcher } as FetchInit) : timed\n return timedEasFetch(() => fetch(input, requestInit), init)\n },\n })\n}\n","import type { IEasClient } from '../EasClient/IEasClient.js'\nimport { getEasEndpoint } from '../easEndpoint.js'\nimport type { GraphQLClient } from 'graphql-request'\nimport { createEasGraphQLClient, EAS_REQUEST_TIMEOUT_MS } from '../EasClient/createEasGraphQLClient.js'\n\n/** Fetch-based EAS GraphQL client; works in Node and browsers. Registering it is up to the caller. */\nexport class DefaultEasClient implements IEasClient {\n private easClient: { url: string; client: GraphQLClient } | undefined\n\n /** The `fetch` dispatcher for this client's requests; undefined uses fetch's default. */\n protected getDispatcher(): unknown {\n return undefined\n }\n\n /** Reads the endpoint per call so SDK / publish chain config applied after import takes effect. */\n getEasClient(): GraphQLClient {\n const url = getEasEndpoint()\n if (this.easClient?.url !== url) {\n this.easClient = { url, client: createEasGraphQLClient(url, EAS_REQUEST_TIMEOUT_MS, { dispatcher: this.getDispatcher() }) }\n }\n return this.easClient.client\n }\n}\n","import { QueryClient as TanStackQueryClient } from '@tanstack/query-core'\nimport { getEasEndpoint } from '../easEndpoint.js'\nimport type { FetchQueryOptions, IQueryClient } from '../QueryClient/IQueryClient.js'\nimport type { IQueryClientFactory } from '../QueryClient/IQueryClientFactory.js'\n\n/**\n * Keys are scoped to the EAS endpoint (the chain), so a process that switches chains never shares\n * a request or a result between them.\n */\nconst scopeKey = (queryKey: readonly unknown[]): unknown[] => {\n let endpoint = ''\n try {\n endpoint = getEasEndpoint()\n } catch {\n // Misconfigured chain: the request itself will fail.\n }\n return [endpoint, ...queryKey]\n}\n\n/**\n * TanStack Query client with no UI or browser dependencies (Node, workers, pages without the SDK).\n * Registering it is up to the caller. Concurrent requests with the same key share one fetch.\n *\n * Results are not kept once a request settles (gcTime 0) unless the caller passes a `staleTime`,\n * in which case they are kept and reused for that long: a server process sees many distinct keys\n * (e.g. change checks keyed by time), and EAS data is otherwise always read fresh. No retries\n * (TanStack's default for imperative queries), no structural sharing (nothing to share with), and\n * no online detection (`networkMode: 'always'`).\n */\nexport class DefaultQueryClient implements IQueryClientFactory {\n private queryClient: IQueryClient | undefined\n\n getQueryClient(): IQueryClient {\n if (this.queryClient) return this.queryClient\n\n const client = new TanStackQueryClient({\n defaultOptions: {\n queries: {\n gcTime: 0,\n networkMode: 'always',\n structuralSharing: false,\n },\n },\n })\n\n this.queryClient = {\n fetchQuery: <T>({ queryKey, queryFn, networkMode, staleTime }: FetchQueryOptions<T>) =>\n client.query({\n queryKey: scopeKey(queryKey),\n queryFn,\n // IQueryClient's 'onlineOnly' is TanStack v5's 'online'.\n ...(networkMode ? { networkMode: networkMode === 'onlineOnly' ? 'online' : networkMode } : {}),\n ...(staleTime ? { staleTime, gcTime: staleTime } : {}),\n }) as Promise<T>,\n getQueryData: (queryKey) => client.getQueryData(scopeKey(queryKey)),\n removeQueries: async ({ queryKey }) => {\n client.removeQueries({ queryKey: scopeKey(que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AAC;AACH;;;ACrCA,IAAa6B,IAAb,MAAoD;CAClD;CAGA,gBAAmC,CAEnC;CAGA,eAA8B;EAC5B,IAAMnD,IAAML,EAAe;EAI3B,OAHI,KAAK,WAAW,QAAQK,MAC1B,KAAK,YAAY;GAAE;GAAK,QAAQ6C,EAAuB7C,GAAKwC,GAAwB,EAAE,YAAY,KAAK,cAAc,EAAE,CAAC;EAAE,IAErH,KAAK,UAAU;CACxB;AACF,GCbMY,KAAY,MAA4C;CAC5D,IAAIC,IAAW;CACf,IAAI;EACF,IAAW1D,EAAe;CAC5B,QAAQ,CAER;CACA,OAAO,CAAC0D,GAAU,GAAGC,CAAQ;AAC/B,GAYaC,IAAb,MAA+D;CAC7D;CAEA,iBAA+B;EAC7B,IAAI,KAAK,aAAa,OAAO,KAAK;EAElC,IAAMC,IAAS,IAAI3H,EAAoB,EACrC,gBAAgB,EACd,SAAS;GACP,QAAQ;GACR,aAAa;GACb,mBAAmB;EACrB,EACF,EACF,CAAC;EAgBD,OAdA,KAAK,cAAc;GACjB,aAAgB,EAAE,aAAU,YAAS,gBAAa,mBAChD2H,EAAO,MAAM;IACX,UAAUJ,EAASE,CAAQ;IAC3B;IAEA,GAAII,IAAc,EAAE,aAAaA,MAAgB,eAAe,WAAWA,EAAY,IAAI,CAAC;IAC5F,GAAIC,IAAY;KAAE;KAAW,QAAQA;IAAU,IAAI,CAAC;GACtD,CAAC;GACH,eAAe,MAAaH,EAAO,aAAaJ,EAASE,CAAQ,CAAC;GAClE,eAAe,OAAO,EAAE,kBAAe;IACrC,EAAO,cAAc,EAAE,UAAUF,EAASE,CAAQ,EAAE,CAAC;GACvD;EACF,GACO,KAAK;CACd;AACF"}
|
package/dist/api.d.ts
CHANGED
|
@@ -27,16 +27,6 @@ export declare const getCanonicalItemPropertiesFromEas: ({ versionUids, excludeR
|
|
|
27
27
|
excludeRevoked?: boolean;
|
|
28
28
|
checkAttesters?: boolean;
|
|
29
29
|
}) => Promise<Attestation[]>;
|
|
30
|
-
/**
|
|
31
|
-
* UID of the first EAS schema whose definition ends with `schemaName`, or undefined when there is
|
|
32
|
-
* none or the EAS clients aren't configured. Throws when the request fails.
|
|
33
|
-
*/
|
|
34
|
-
export declare const fetchEasSchemaUidBySchemaName: ({ schemaName, }: {
|
|
35
|
-
schemaName: string;
|
|
36
|
-
}) => Promise<string | undefined>;
|
|
37
|
-
export declare const getEasSchemaUidBySchemaName: ({ schemaName, }: {
|
|
38
|
-
schemaName: string;
|
|
39
|
-
}) => Promise<string | undefined>;
|
|
40
30
|
export declare const getSeedsFromSchemaUids: ({ schemaUids, addresses, excludeRevoked, }: {
|
|
41
31
|
schemaUids: string[];
|
|
42
32
|
addresses: string[];
|
package/dist/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../src/api.ts"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAE3D,YAAY,EAAE,WAAW,EAAE,MAAM,IAAI,SAAS,EAAE,MAAM,0BAA0B,CAAA;AAEhF;;;;GAIG;AACH,eAAO,MAAM,sBAAsB,GAAU,+BAG1C;IACD,QAAQ,EAAE,MAAM,EAAE,CAAA;IAClB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,KAAG,OAAO,CAAC,WAAW,EAAE,CAgBxB,CAAA;AAED,eAAO,MAAM,wBAAwB,GAAU,kCAG5C;IACD,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,KAAG,OAAO,CAAC,WAAW,EAAE,CAiBxB,CAAA;AAED;;;;;;;;GAQG;AACH,eAAO,MAAM,iCAAiC,GAAU,kDAIrD;IACD,WAAW,EAAE,MAAM,EAAE,CAAA;IACrB,cAAc,CAAC,EAAE,OAAO,CAAA;IACx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sBAGnF,CAAA"}
|
|
@@ -3,6 +3,8 @@ import type { GraphQLClient } from 'graphql-request';
|
|
|
3
3
|
/** Fetch-based EAS GraphQL client; works in Node and browsers. Registering it is up to the caller. */
|
|
4
4
|
export declare class DefaultEasClient implements IEasClient {
|
|
5
5
|
private easClient;
|
|
6
|
+
/** The `fetch` dispatcher for this client's requests; undefined uses fetch's default. */
|
|
7
|
+
protected getDispatcher(): unknown;
|
|
6
8
|
/** Reads the endpoint per call so SDK / publish chain config applied after import takes effect. */
|
|
7
9
|
getEasClient(): GraphQLClient;
|
|
8
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EasClient.d.ts","sourceRoot":"","sources":["../../src/default/EasClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAGpD,sGAAsG;AACtG,qBAAa,gBAAiB,YAAW,UAAU;IACjD,OAAO,CAAC,SAAS,CAAoD;IAErE,mGAAmG;IACnG,YAAY,IAAI,aAAa;CAO9B"}
|
|
1
|
+
{"version":3,"file":"EasClient.d.ts","sourceRoot":"","sources":["../../src/default/EasClient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAGpD,sGAAsG;AACtG,qBAAa,gBAAiB,YAAW,UAAU;IACjD,OAAO,CAAC,SAAS,CAAoD;IAErE,yFAAyF;IACzF,SAAS,CAAC,aAAa,IAAI,OAAO;IAIlC,mGAAmG;IACnG,YAAY,IAAI,aAAa;CAO9B"}
|