@seedprotocol/eas 0.6.7 → 0.6.9

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.
@@ -2,6 +2,7 @@ import type { IEasClient } from '../EasClient/IEasClient.js';
2
2
  import { GraphQLClient } from 'graphql-request';
3
3
  export declare class NodeEasClient implements IEasClient {
4
4
  private easClient;
5
+ /** Reads the endpoint per call so SDK / publish chain config applied after import takes effect. */
5
6
  getEasClient(): GraphQLClient;
6
7
  }
7
8
  /** @deprecated Prefer NodeEasClient */
@@ -1 +1 @@
1
- {"version":3,"file":"EasClient.d.ts","sourceRoot":"","sources":["../../src/node/EasClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,qBAAa,aAAc,YAAW,UAAU;IAC9C,OAAO,CAAC,SAAS,CAA2B;IAE5C,YAAY,IAAI,aAAa;CAM9B;AAED,uCAAuC;AACvC,eAAO,MAAM,SAAS,sBAAgB,CAAA"}
1
+ {"version":3,"file":"EasClient.d.ts","sourceRoot":"","sources":["../../src/node/EasClient.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAA;AAE5D,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAE/C,qBAAa,aAAc,YAAW,UAAU;IAC9C,OAAO,CAAC,SAAS,CAAoD;IAErE,mGAAmG;IACnG,YAAY,IAAI,aAAa;CAO9B;AAED,uCAAuC;AACvC,eAAO,MAAM,SAAS,sBAAgB,CAAA"}
package/dist/node.js CHANGED
@@ -1,13 +1,17 @@
1
- import { a as e, o as t, t as n } from "./constants-Ch1B4W2F.js";
1
+ import { _ as e, g as t, r as n } from "./easEndpoint-BYyoBW_s.js";
2
2
  import { GraphQLClient as r } from "graphql-request";
3
3
  //#region src/node/EasClient.ts
4
4
  var i = class {
5
5
  easClient;
6
6
  getEasClient() {
7
- return this.easClient ||= new r(n), this.easClient;
7
+ let e = n();
8
+ return this.easClient?.url !== e && (this.easClient = {
9
+ url: e,
10
+ client: new r(e)
11
+ }), this.easClient.client;
8
12
  }
9
13
  }, a = i;
10
- t.configure(new i()), new i();
14
+ e.configure(new i()), new i();
11
15
  //#endregion
12
16
  //#region src/node/QueryClient.ts
13
17
  var o = class {
@@ -19,11 +23,11 @@ var o = class {
19
23
  };
20
24
  }
21
25
  }, s = o;
22
- e.configure(new o()), new o();
26
+ t.configure(new o()), new o();
23
27
  //#endregion
24
28
  //#region src/node/index.ts
25
29
  function c() {
26
- t.configure(new i()), e.configure(new o());
30
+ e.configure(new i()), t.configure(new o());
27
31
  }
28
32
  //#endregion
29
33
  export { a as EasClient, i as NodeEasClient, o as NodeQueryClient, s as QueryClient, c as registerNodeEasPlatform };
package/dist/node.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"node.js","names":[],"sources":["../src/node/EasClient.ts","../src/node/QueryClient.ts","../src/node/index.ts"],"sourcesContent":["import { BaseEasClient } from '../EasClient/BaseEasClient.js'\nimport type { IEasClient } from '../EasClient/IEasClient.js'\nimport { EAS_ENDPOINT } from '../constants.js'\nimport { GraphQLClient } from 'graphql-request'\n\nexport class NodeEasClient implements IEasClient {\n private easClient: GraphQLClient | undefined\n\n getEasClient(): GraphQLClient {\n if (!this.easClient) {\n this.easClient = new GraphQLClient(EAS_ENDPOINT)\n }\n return this.easClient\n }\n}\n\n/** @deprecated Prefer NodeEasClient */\nexport const EasClient = NodeEasClient\n\nBaseEasClient.configure(new NodeEasClient())\n\nconst _check: IEasClient = new NodeEasClient()\nvoid _check\n","import { BaseQueryClient } from '../QueryClient/BaseQueryClient.js'\nimport type { FetchQueryOptions, IQueryClient } from '../QueryClient/IQueryClient.js'\nimport type { IQueryClientFactory } from '../QueryClient/IQueryClientFactory.js'\n\nexport class NodeQueryClient implements IQueryClientFactory {\n getQueryClient(): IQueryClient {\n return {\n fetchQuery: async <T>({ queryFn }: FetchQueryOptions<T>): Promise<T> => queryFn(),\n getQueryData: () => undefined,\n removeQueries: async () => {},\n }\n }\n}\n\n/** @deprecated Prefer NodeQueryClient */\nexport const QueryClient = NodeQueryClient\n\nBaseQueryClient.configure(new NodeQueryClient())\n\nconst _check: IQueryClientFactory = new NodeQueryClient()\nvoid _check\n","import { NodeEasClient } from './EasClient.js'\nimport { NodeQueryClient } from './QueryClient.js'\nimport { BaseEasClient } from '../EasClient/BaseEasClient.js'\nimport { BaseQueryClient } from '../QueryClient/BaseQueryClient.js'\n\nexport { EasClient, NodeEasClient } from './EasClient.js'\nexport { QueryClient, NodeQueryClient } from './QueryClient.js'\n\n/** Register Node.js EAS + query client implementations. */\nexport function registerNodeEasPlatform(): void {\n BaseEasClient.configure(new NodeEasClient())\n BaseQueryClient.configure(new NodeQueryClient())\n}\n"],"mappings":";;;AAKA,IAAa,IAAb,MAAiD;CAC/C;CAEA,eAA8B;EAI5B,OAHA,AACE,KAAK,cAAY,IAAI,EAAc,CAAY,GAE1C,KAAK;CACd;AACF,GAGa,IAAY;AAEzB,EAAc,UAAU,IAAI,EAAc,CAAC,GAEhB,IAAI,EAAc;;;ACjB7C,IAAa,IAAb,MAA4D;CAC1D,iBAA+B;EAC7B,OAAO;GACL,YAAY,OAAU,EAAE,iBAAgD,EAAQ;GAChF,oBAAoB,KAAA;GACpB,eAAe,YAAY,CAAC;EAC9B;CACF;AACF,GAGa,IAAc;AAE3B,EAAgB,UAAU,IAAI,EAAgB,CAAC,GAEX,IAAI,EAAgB;;;ACVxD,SAAgB,IAAgC;CAE9C,AADA,EAAc,UAAU,IAAI,EAAc,CAAC,GAC3C,EAAgB,UAAU,IAAI,EAAgB,CAAC;AACjD"}
1
+ {"version":3,"file":"node.js","names":[],"sources":["../src/node/EasClient.ts","../src/node/QueryClient.ts","../src/node/index.ts"],"sourcesContent":["import { BaseEasClient } from '../EasClient/BaseEasClient.js'\nimport type { IEasClient } from '../EasClient/IEasClient.js'\nimport { getEasEndpoint } from '../easEndpoint.js'\nimport { GraphQLClient } from 'graphql-request'\n\nexport class NodeEasClient implements IEasClient {\n private easClient: { url: string; client: GraphQLClient } | undefined\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: new GraphQLClient(url) }\n }\n return this.easClient.client\n }\n}\n\n/** @deprecated Prefer NodeEasClient */\nexport const EasClient = NodeEasClient\n\nBaseEasClient.configure(new NodeEasClient())\n\nconst _check: IEasClient = new NodeEasClient()\nvoid _check\n","import { BaseQueryClient } from '../QueryClient/BaseQueryClient.js'\nimport type { FetchQueryOptions, IQueryClient } from '../QueryClient/IQueryClient.js'\nimport type { IQueryClientFactory } from '../QueryClient/IQueryClientFactory.js'\n\nexport class NodeQueryClient implements IQueryClientFactory {\n getQueryClient(): IQueryClient {\n return {\n fetchQuery: async <T>({ queryFn }: FetchQueryOptions<T>): Promise<T> => queryFn(),\n getQueryData: () => undefined,\n removeQueries: async () => {},\n }\n }\n}\n\n/** @deprecated Prefer NodeQueryClient */\nexport const QueryClient = NodeQueryClient\n\nBaseQueryClient.configure(new NodeQueryClient())\n\nconst _check: IQueryClientFactory = new NodeQueryClient()\nvoid _check\n","import { NodeEasClient } from './EasClient.js'\nimport { NodeQueryClient } from './QueryClient.js'\nimport { BaseEasClient } from '../EasClient/BaseEasClient.js'\nimport { BaseQueryClient } from '../QueryClient/BaseQueryClient.js'\n\nexport { EasClient, NodeEasClient } from './EasClient.js'\nexport { QueryClient, NodeQueryClient } from './QueryClient.js'\n\n/** Register Node.js EAS + query client implementations. */\nexport function registerNodeEasPlatform(): void {\n BaseEasClient.configure(new NodeEasClient())\n BaseQueryClient.configure(new NodeQueryClient())\n}\n"],"mappings":";;;AAKA,IAAa,IAAb,MAAiD;CAC/C;CAGA,eAA8B;EAC5B,IAAM,IAAM,EAAe;EAI3B,OAHI,KAAK,WAAW,QAAQ,MAC1B,KAAK,YAAY;GAAE;GAAK,QAAQ,IAAI,EAAc,CAAG;EAAE,IAElD,KAAK,UAAU;CACxB;AACF,GAGa,IAAY;AAEzB,EAAc,UAAU,IAAI,EAAc,CAAC,GAEhB,IAAI,EAAc;;;ACnB7C,IAAa,IAAb,MAA4D;CAC1D,iBAA+B;EAC7B,OAAO;GACL,YAAY,OAAU,EAAE,iBAAgD,EAAQ;GAChF,oBAAoB,KAAA;GACpB,eAAe,YAAY,CAAC;EAC9B;CACF;AACF,GAGa,IAAc;AAE3B,EAAgB,UAAU,IAAI,EAAgB,CAAC,GAEX,IAAI,EAAgB;;;ACVxD,SAAgB,IAAgC;CAE9C,AADA,EAAc,UAAU,IAAI,EAAc,CAAC,GAC3C,EAAgB,UAAU,IAAI,EAAgB,CAAC;AACjD"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seedprotocol/eas",
3
- "version": "0.6.7",
3
+ "version": "0.6.9",
4
4
  "description": "EAS GraphQL read client and helpers for Seed Protocol",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -1,35 +0,0 @@
1
- //#region src/EasClient/BaseEasClient.ts
2
- var e = class e {
3
- static _impl = null;
4
- static configure(t) {
5
- if (!t) throw Error("Cannot configure EasClient with undefined or null. Ensure the platform-specific EasClient is properly created.");
6
- e._impl = t;
7
- }
8
- static requireImpl() {
9
- if (!e._impl) throw Error("EasClient not configured. Import from @seedprotocol/eas/node to register the Node.js implementation, or ensure SDK platform init has run.");
10
- return e._impl;
11
- }
12
- static getEasClient() {
13
- return e.requireImpl().getEasClient();
14
- }
15
- static async getSeedsBySchemaName(e) {
16
- throw Error("BaseEasClient.getSeedsBySchemaName is not implemented. Use getSeedsBySchemaName from @seedprotocol/eas instead.");
17
- }
18
- }, t = class e {
19
- static _impl = null;
20
- static configure(t) {
21
- if (!t) throw Error("Cannot configure QueryClient with undefined or null. Ensure the platform-specific QueryClient is properly created.");
22
- e._impl = t;
23
- }
24
- static requireImpl() {
25
- if (!e._impl) throw Error("QueryClient not configured. Import from @seedprotocol/eas/node to register the Node.js implementation.");
26
- return e._impl;
27
- }
28
- static getQueryClient() {
29
- return e.requireImpl().getQueryClient();
30
- }
31
- }, n = "0x0000000000000000000000000000000000000000", r = "0x", i = "0x0000000000000000000000000000000000000000000000000000000000000000", a = typeof process < "u" && process.env?.NEXT_PUBLIC_EAS_ENDPOINT || typeof process < "u" && process.env?.EAS_ENDPOINT || "https://optimism-sepolia.easscan.org/graphql";
32
- //#endregion
33
- export { t as a, i, n, e as o, r, a as t };
34
-
35
- //# sourceMappingURL=constants-Ch1B4W2F.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"constants-Ch1B4W2F.js","names":[],"sources":["../src/EasClient/BaseEasClient.ts","../src/QueryClient/BaseQueryClient.ts","../src/constants.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","export const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000'\nexport const ZERO_BYTES = '0x'\nexport const ZERO_BYTES32 =\n '0x0000000000000000000000000000000000000000000000000000000000000000'\n\nexport const EAS_ENDPOINT =\n (typeof process !== 'undefined' && process.env?.NEXT_PUBLIC_EAS_ENDPOINT) ||\n (typeof process !== 'undefined' && process.env?.EAS_ENDPOINT) ||\n 'https://optimism-sepolia.easscan.org/graphql'\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,OAAO,EAAc,YAAY,CAAC,CAAC,aAAa;CAClD;CAMA,aAAa,qBAAqB,GAA6C;EAC7E,MAAU,MACR,iHACF;CACF;AACF,GCnCsB,IAAtB,MAAsB,EAAgB;CACpC,OAAe,QAAoC;CAEnD,OAAO,UAAU,GAAiC;EAChD,IAAI,CAAC,GACH,MAAU,MACR,oHACF;EAEF,EAAgB,QAAQ;CAC1B;CAEA,OAAe,cAAmC;EAChD,IAAI,CAAC,EAAgB,OACnB,MAAU,MACR,wGACF;EAEF,OAAO,EAAgB;CACzB;CAEA,OAAO,iBAA+B;EACpC,OAAO,EAAgB,YAAY,CAAC,CAAC,eAAe;CACtD;AACF,GC3Ba,IAAe,8CACf,IAAa,MACb,IACX,sEAEW,IACV,OAAO,UAAY,OAAe,QAAQ,KAAK,4BAC/C,OAAO,UAAY,OAAe,QAAQ,KAAK,gBAChD"}