@seedprotocol/eas 0.7.0 → 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/api.d.ts +42 -1
- package/dist/api.d.ts.map +1 -1
- package/dist/easEndpoint-BYyoBW_s.js.map +1 -1
- package/dist/graphql/fragments/Attestation.d.ts.map +1 -1
- package/dist/graphql/gql/gql.d.ts +12 -2
- package/dist/graphql/gql/gql.d.ts.map +1 -1
- package/dist/graphql/gql/graphql.d.ts +35 -7
- package/dist/graphql/gql/graphql.d.ts.map +1 -1
- package/dist/index.js +511 -302
- package/dist/index.js.map +1 -1
- package/dist/node/QueryClient.d.ts +10 -0
- package/dist/node/QueryClient.d.ts.map +1 -1
- package/dist/node.js +38 -14
- package/dist/node.js.map +1 -1
- package/dist/queries.d.ts +12 -0
- package/dist/queries.d.ts.map +1 -1
- package/package.json +8 -2
package/dist/api.d.ts
CHANGED
|
@@ -27,6 +27,47 @@ export declare const getSeedsFromSchemaUids: ({ schemaUids, addresses, excludeRe
|
|
|
27
27
|
addresses: string[];
|
|
28
28
|
excludeRevoked?: boolean;
|
|
29
29
|
}) => Promise<Attestation[]>;
|
|
30
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Seeds of the schema named `schemaName`, newest first, revoked ones left out. With `uidPrefix`,
|
|
32
|
+
* only seeds whose UID starts with it; easscan matches it case-sensitively, so pass it lowercase
|
|
33
|
+
* with `0x`.
|
|
34
|
+
*/
|
|
35
|
+
export declare const getSeedsBySchemaName: (schemaName: string, limit?: number, skip?: number, options?: {
|
|
36
|
+
uidPrefix?: string;
|
|
37
|
+
}) => Promise<Attestation[]>;
|
|
38
|
+
/** Clears the schema-name cache of getSchemaNamesBySchemaUids. For tests. */
|
|
39
|
+
export declare const resetSchemaNamesCache: () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Names of each EAS schema in `schemaUids`, in EAS order, keyed by the UID as given. Schemas with
|
|
42
|
+
* no name are left out. Found names are cached for the process; schemas without one are asked
|
|
43
|
+
* again next time.
|
|
44
|
+
*/
|
|
45
|
+
export declare const getSchemaNamesBySchemaUids: (schemaUids: string[]) => Promise<Map<string, string[]>>;
|
|
46
|
+
/**
|
|
47
|
+
* Seed attestations whose UID is in `uids`, newest first, with `schema.schemaNames` attached from
|
|
48
|
+
* their `schemaId` (the seeds themselves are fetched without that join, which is slow on easscan).
|
|
49
|
+
*/
|
|
50
|
+
export declare const getSeedsByUidsFromEas: ({ uids, excludeRevoked, }: {
|
|
51
|
+
uids: string[];
|
|
52
|
+
excludeRevoked?: boolean;
|
|
53
|
+
}) => Promise<Attestation[]>;
|
|
54
|
+
export type AttestationChange = {
|
|
55
|
+
id: string;
|
|
56
|
+
refUID: string;
|
|
57
|
+
timeCreated: number;
|
|
58
|
+
/** Unix seconds; 0 when not revoked. */
|
|
59
|
+
revocationTime: number;
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Attestations created or revoked after `since` (unix seconds) that either reference one of
|
|
63
|
+
* `refUIDs` (new or revoked Versions of a Seed, properties of a Version) or are one of `ids`
|
|
64
|
+
* (a revoked Seed). Revoked ones are included: a revocation is a change. Large lists are split
|
|
65
|
+
* over several requests, run concurrently.
|
|
66
|
+
*/
|
|
67
|
+
export declare const getAttestationChangesSince: ({ refUIDs, ids, since, }: {
|
|
68
|
+
refUIDs: string[];
|
|
69
|
+
ids: string[];
|
|
70
|
+
since: number;
|
|
71
|
+
}) => Promise<AttestationChange[]>;
|
|
31
72
|
export declare const getSeedUidsBySchemaName: (schemaName: string, limit?: number) => Promise<string[]>;
|
|
32
73
|
//# sourceMappingURL=api.d.ts.map
|
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":"AAc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eAAO,MAAM,qBAAqB,QAAO,IAExC,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,0BAA0B,GACrC,YAAY,MAAM,EAAE,KACnB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CA6B/B,CAAA;AAED;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAAU,2BAGzC;IACD,IAAI,EAAE,MAAM,EAAE,CAAA;IACd,cAAc,CAAC,EAAE,OAAO,CAAA;CACzB,KAAG,OAAO,CAAC,WAAW,EAAE,CAcxB,CAAA;AAED,MAAM,MAAM,iBAAiB,GAAG;IAC9B,EAAE,EAAE,MAAM,CAAA;IACV,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,wCAAwC;IACxC,cAAc,EAAE,MAAM,CAAA;CACvB,CAAA;AAKD;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B,GAAU,0BAI9C;IACD,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,GAAG,EAAE,MAAM,EAAE,CAAA;IACb,KAAK,EAAE,MAAM,CAAA;CACd,KAAG,OAAO,CAAC,iBAAiB,EAAE,CA8B9B,CAAA;AAED,eAAO,MAAM,uBAAuB,GAAU,YAAY,MAAM,EAAE,QAAO,MAAW,sBAGnF,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"easEndpoint-BYyoBW_s.js","names":[],"sources":["../src/EasClient/BaseEasClient.ts","../src/QueryClient/BaseQueryClient.ts","../src/chains.ts","../src/easEndpoint.ts"],"sourcesContent":["import type { Attestation } from '../graphql/gql/graphql.js'\nimport type { GraphQLClient } from 'graphql-request'\nimport type { IEasClient } from './IEasClient.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 }\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'\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 }\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"],"mappings":";AAIA,IAAsB,IAAtB,MAAsB,EAAc;CAClC,OAAe,QAA2B;CAE1C,OAAO,UAAU,GAAwB;EACvC,IAAI,CAAC,GACH,MAAU,MACR,gHACF;EAEF,EAAc,QAAQ;CACxB;CAEA,OAAe,cAA0B;EACvC,IAAI,CAAC,EAAc,OACjB,MAAU,MACR,2IACF;EAEF,OAAO,EAAc;CACvB;CAEA,OAAO,eAA8B;EACnC,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,MAAU,MACR,qCAAqC,EAAQ,+DAC/C;CAEF,OAAO;AACT;AAEA,SAAS,EAAa,GAAqB;CACzC,OAAO,EAAI,KAAK,CAAC,CAAC,QAAQ,QAAQ,EAAE,CAAC,CAAC,YAAY;AACpD;AAGA,SAAS,EAAsB,GAAiC;CAC9D,IAAM,IAAS,EAAa,CAAG;CAC/B,KAAK,IAAM,CAAC,GAAI,MAAe,OAAO,QAAQ,CAAqB,GACjE,IAAI,EAAW,cAAc,EAAa,EAAW,UAAU,MAAM,GAAQ,OAAO,OAAO,CAAE;AAGjG"}
|
|
1
|
+
{"version":3,"file":"easEndpoint-BYyoBW_s.js","names":["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"],"sources":["../src/EasClient/BaseEasClient.ts","../src/QueryClient/BaseQueryClient.ts","../src/chains.ts","../src/easEndpoint.ts"],"sourcesContent":["import type { Attestation } from '../graphql/gql/graphql.js'\nimport type { GraphQLClient } from 'graphql-request'\nimport type { IEasClient } from './IEasClient.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 }\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'\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 }\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"],"mappings":";AAIA,IAAsBA,IAAtB,MAAsBA,EAAc;CAClC,OAAe,QAA2B;CAE1C,OAAO,UAAU,GAAwB;EACvC,IAAI,CAACC,GACH,MAAU,MACR,gHACF;EAEF,EAAc,QAAQA;CACxB;CAEA,OAAe,cAA0B;EACvC,IAAI,CAACD,EAAc,OACjB,MAAU,MACR,2IAC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,EAAW,gCAAgC3C,EAAQ,gCAAgCA,EAAQ,8CACxM;EAQF,OANIyC,KAAgBA,MAAiBC,KAAO1C,MAAA,YAAoC,CAACa,MAC/E,IAAoB,IACpB,QAAQ,KACN,iCAAiC6B,EAAI,oCAAoC1C,EAAQ,IAAIyC,EAAa,gCAAgCzC,EAAQ,oCAC5I,IAEK0C;CACT;CAEA,IAAMG,IAAMJ,KAAgB/B,EAAS,QAAQ;CAC7C,IAAI,CAACmC,GACH,MAAU,MACR,qCAAqC7C,EAAQ,+DAC/C;CAEF,OAAO6C;AACT;AAEA,SAASC,EAAa,GAAqB;CACzC,OAAOD,EAAI,KAAK,CAAC,CAAC,QAAQ,QAAQ,EAAE,CAAC,CAAC,YAAY;AACpD;AAGA,SAASD,EAAsB,GAAiC;CAC9D,IAAMG,IAASD,EAAaD,CAAG;CAC/B,KAAK,IAAM,CAACG,GAAIxC,MAAe,OAAO,QAAQX,CAAqB,GACjE,IAAIW,EAAW,cAAcsC,EAAatC,EAAW,UAAU,MAAMuC,GAAQ,OAAO,OAAOC,CAAE;AAGjG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Attestation.d.ts","sourceRoot":"","sources":["../../../src/graphql/fragments/Attestation.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Attestation.d.ts","sourceRoot":"","sources":["../../../src/graphql/fragments/Attestation.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,kBAAkB,4HAc5B,CAAA"}
|
|
@@ -12,11 +12,12 @@ import type { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-
|
|
|
12
12
|
* Learn more about it here: https://the-guild.dev/graphql/codegen/plugins/presets/preset-client#reducing-bundle-size
|
|
13
13
|
*/
|
|
14
14
|
type Documents = {
|
|
15
|
-
"\n fragment attestationFields on Attestation {\n id\n decodedDataJson\n attester\n
|
|
15
|
+
"\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": typeof types.AttestationFieldsFragmentDoc;
|
|
16
16
|
"\n fragment schemaFields on Schema {\n id\n resolver\n revocable\n schema\n index\n schemaNames {\n name\n }\n time\n txid\n creator\n }\n": typeof types.SchemaFieldsFragmentDoc;
|
|
17
17
|
"\n query GetSchemas($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n": typeof types.GetSchemasDocument;
|
|
18
18
|
"\n query GetSchemaByName($where: SchemaWhereInput!) {\n schemas: schemata(where: $where) {\n id\n schema\n schemaNames {\n name\n }\n }\n }\n": typeof types.GetSchemaByNameDocument;
|
|
19
19
|
"\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": typeof types.GetSeedsDocument;
|
|
20
|
+
"\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": typeof types.GetSeedsLeanDocument;
|
|
20
21
|
"\n query GetSeedIds($where: AttestationWhereInput!) {\n itemSeedIds: attestations(where: $where, orderBy: [{ timeCreated: desc }]) {\n id\n }\n }\n": typeof types.GetSeedIdsDocument;
|
|
21
22
|
"\n query GetStorageTransactionId($where: AttestationWhereInput!) {\n storageTransactionId: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n id\n decodedDataJson\n }\n }\n": typeof types.GetStorageTransactionIdDocument;
|
|
22
23
|
"\n query GetVersions($where: AttestationWhereInput!) {\n itemVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n": typeof types.GetVersionsDocument;
|
|
@@ -25,6 +26,7 @@ type Documents = {
|
|
|
25
26
|
"\n query GetFilesMetadata($where: AttestationWhereInput!) {\n filesMetadata: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n": typeof types.GetFilesMetadataDocument;
|
|
26
27
|
"\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": typeof types.GetImageSeedsDocument;
|
|
27
28
|
"\n query GetImageVersions($where: AttestationWhereInput!) {\n imageVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n": typeof types.GetImageVersionsDocument;
|
|
29
|
+
"\n query GetAttestationChanges($where: AttestationWhereInput!) {\n changes: attestations(where: $where) {\n id\n refUID\n timeCreated\n revocationTime\n }\n }\n": typeof types.GetAttestationChangesDocument;
|
|
28
30
|
};
|
|
29
31
|
declare const documents: Documents;
|
|
30
32
|
/**
|
|
@@ -43,7 +45,7 @@ export declare function graphql(source: string): unknown;
|
|
|
43
45
|
/**
|
|
44
46
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
45
47
|
*/
|
|
46
|
-
export declare function graphql(source: "\n fragment attestationFields on Attestation {\n id\n decodedDataJson\n attester\n
|
|
48
|
+
export declare function graphql(source: "\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"): (typeof documents)["\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"];
|
|
47
49
|
/**
|
|
48
50
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
49
51
|
*/
|
|
@@ -60,6 +62,10 @@ export declare function graphql(source: "\n query GetSchemaByName($where: Schem
|
|
|
60
62
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
61
63
|
*/
|
|
62
64
|
export declare function graphql(source: "\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"): (typeof documents)["\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"];
|
|
65
|
+
/**
|
|
66
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
67
|
+
*/
|
|
68
|
+
export declare function graphql(source: "\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"): (typeof documents)["\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"];
|
|
63
69
|
/**
|
|
64
70
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
65
71
|
*/
|
|
@@ -92,6 +98,10 @@ export declare function graphql(source: "\n query GetImageSeeds($where: Attesta
|
|
|
92
98
|
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
93
99
|
*/
|
|
94
100
|
export declare function graphql(source: "\n query GetImageVersions($where: AttestationWhereInput!) {\n imageVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"): (typeof documents)["\n query GetImageVersions($where: AttestationWhereInput!) {\n imageVersions: attestations(\n where: $where\n orderBy: [{ timeCreated: desc }]\n ) {\n ...attestationFields\n }\n }\n"];
|
|
101
|
+
/**
|
|
102
|
+
* The graphql function is used to parse GraphQL queries into a document that can be used by GraphQL clients.
|
|
103
|
+
*/
|
|
104
|
+
export declare function graphql(source: "\n query GetAttestationChanges($where: AttestationWhereInput!) {\n changes: attestations(where: $where) {\n id\n refUID\n timeCreated\n revocationTime\n }\n }\n"): (typeof documents)["\n query GetAttestationChanges($where: AttestationWhereInput!) {\n changes: attestations(where: $where) {\n id\n refUID\n timeCreated\n revocationTime\n }\n }\n"];
|
|
95
105
|
export type DocumentType<TDocumentNode extends DocumentNode<any, any>> = TDocumentNode extends DocumentNode<infer TType, any> ? TType : never;
|
|
96
106
|
export {};
|
|
97
107
|
//# sourceMappingURL=gql.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../../src/graphql/gql/gql.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,iBAAiB,IAAI,YAAY,EAAE,MAAM,mCAAmC,CAAC;AAE3F;;;;;;;;;;GAUG;AACH,KAAK,SAAS,GAAG;IACb,
|
|
1
|
+
{"version":3,"file":"gql.d.ts","sourceRoot":"","sources":["../../../src/graphql/gql/gql.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,KAAK,MAAM,WAAW,CAAC;AACnC,OAAO,KAAK,EAAE,iBAAiB,IAAI,YAAY,EAAE,MA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GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,gYAAgY,CAAC,CAAC;AACxzB;;GAEG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,gNAAgN,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,gNAAgN,CAAC,CAAC;AACxd;;GAEG;AACH,wBAAgB,OAAO,CAAC,MAAM,EAAE,8LAA8L,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,8LAA8L,CAAC,CAAC;AAMpb,MAAM,MAAM,YAAY,CAAC,aAAa,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,aAAa,SAAS,YAAY,CAAG,MAAM,KAAK,EAAG,GAAG,CAAC,GAAI,KAAK,GAAI,KAAK,CAAC"}
|
|
@@ -2472,13 +2472,6 @@ export type AttestationFieldsFragment = {
|
|
|
2472
2472
|
timeCreated: number;
|
|
2473
2473
|
time: number;
|
|
2474
2474
|
isOffchain: boolean;
|
|
2475
|
-
schema: {
|
|
2476
|
-
__typename?: 'Schema';
|
|
2477
|
-
schemaNames: Array<{
|
|
2478
|
-
__typename?: 'SchemaName';
|
|
2479
|
-
name: string;
|
|
2480
|
-
}>;
|
|
2481
|
-
};
|
|
2482
2475
|
} & {
|
|
2483
2476
|
' $fragmentName'?: 'AttestationFieldsFragment';
|
|
2484
2477
|
};
|
|
@@ -2556,6 +2549,26 @@ export type GetSeedsQuery = {
|
|
|
2556
2549
|
};
|
|
2557
2550
|
}>;
|
|
2558
2551
|
};
|
|
2552
|
+
export type GetSeedsLeanQueryVariables = Exact<{
|
|
2553
|
+
where: AttestationWhereInput;
|
|
2554
|
+
take?: InputMaybe<Scalars['Int']['input']>;
|
|
2555
|
+
skip?: InputMaybe<Scalars['Int']['input']>;
|
|
2556
|
+
}>;
|
|
2557
|
+
export type GetSeedsLeanQuery = {
|
|
2558
|
+
__typename?: 'Query';
|
|
2559
|
+
itemSeeds: Array<{
|
|
2560
|
+
__typename?: 'Attestation';
|
|
2561
|
+
id: string;
|
|
2562
|
+
decodedDataJson: string;
|
|
2563
|
+
attester: string;
|
|
2564
|
+
refUID: string;
|
|
2565
|
+
revoked: boolean;
|
|
2566
|
+
revocationTime: number;
|
|
2567
|
+
schemaId: string;
|
|
2568
|
+
timeCreated: number;
|
|
2569
|
+
isOffchain: boolean;
|
|
2570
|
+
}>;
|
|
2571
|
+
};
|
|
2559
2572
|
export type GetSeedIdsQueryVariables = Exact<{
|
|
2560
2573
|
where: AttestationWhereInput;
|
|
2561
2574
|
}>;
|
|
@@ -2668,11 +2681,25 @@ export type GetImageVersionsQuery = {
|
|
|
2668
2681
|
};
|
|
2669
2682
|
})>;
|
|
2670
2683
|
};
|
|
2684
|
+
export type GetAttestationChangesQueryVariables = Exact<{
|
|
2685
|
+
where: AttestationWhereInput;
|
|
2686
|
+
}>;
|
|
2687
|
+
export type GetAttestationChangesQuery = {
|
|
2688
|
+
__typename?: 'Query';
|
|
2689
|
+
changes: Array<{
|
|
2690
|
+
__typename?: 'Attestation';
|
|
2691
|
+
id: string;
|
|
2692
|
+
refUID: string;
|
|
2693
|
+
timeCreated: number;
|
|
2694
|
+
revocationTime: number;
|
|
2695
|
+
}>;
|
|
2696
|
+
};
|
|
2671
2697
|
export declare const AttestationFieldsFragmentDoc: DocumentNode<AttestationFieldsFragment, unknown>;
|
|
2672
2698
|
export declare const SchemaFieldsFragmentDoc: DocumentNode<SchemaFieldsFragment, unknown>;
|
|
2673
2699
|
export declare const GetSchemasDocument: DocumentNode<GetSchemasQuery, GetSchemasQueryVariables>;
|
|
2674
2700
|
export declare const GetSchemaByNameDocument: DocumentNode<GetSchemaByNameQuery, GetSchemaByNameQueryVariables>;
|
|
2675
2701
|
export declare const GetSeedsDocument: DocumentNode<GetSeedsQuery, GetSeedsQueryVariables>;
|
|
2702
|
+
export declare const GetSeedsLeanDocument: DocumentNode<GetSeedsLeanQuery, GetSeedsLeanQueryVariables>;
|
|
2676
2703
|
export declare const GetSeedIdsDocument: DocumentNode<GetSeedIdsQuery, GetSeedIdsQueryVariables>;
|
|
2677
2704
|
export declare const GetStorageTransactionIdDocument: DocumentNode<GetStorageTransactionIdQuery, GetStorageTransactionIdQueryVariables>;
|
|
2678
2705
|
export declare const GetVersionsDocument: DocumentNode<GetVersionsQuery, GetVersionsQueryVariables>;
|
|
@@ -2681,4 +2708,5 @@ export declare const GetAllPropertiesForAllVersionsDocument: DocumentNode<GetAll
|
|
|
2681
2708
|
export declare const GetFilesMetadataDocument: DocumentNode<GetFilesMetadataQuery, GetFilesMetadataQueryVariables>;
|
|
2682
2709
|
export declare const GetImageSeedsDocument: DocumentNode<GetImageSeedsQuery, GetImageSeedsQueryVariables>;
|
|
2683
2710
|
export declare const GetImageVersionsDocument: DocumentNode<GetImageVersionsQuery, GetImageVersionsQueryVariables>;
|
|
2711
|
+
export declare const GetAttestationChangesDocument: DocumentNode<GetAttestationChangesQuery, GetAttestationChangesQueryVariables>;
|
|
2684
2712
|
//# sourceMappingURL=graphql.d.ts.map
|