@settlemint/sdk-eas 2.3.2-pr3dad35bd → 2.3.2-pr472d8b55

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.
@@ -0,0 +1,97 @@
1
+ import { z } from "zod/v4";
2
+
3
+ //#region src/client-options.schema.d.ts
4
+ /**
5
+ * Schema for validating EAS client configuration options.
6
+ * Extends the base Viem client options with EAS-specific requirements.
7
+ */
8
+ /**
9
+ * Schema for validating EAS client configuration options.
10
+ * Extends the base Viem client options with EAS-specific requirements.
11
+ */
12
+ declare const ClientOptionsSchema: z.ZodObject<{
13
+ schemaRegistryAddress: z.ZodString;
14
+ attestationAddress: z.ZodString;
15
+ accessToken: z.ZodString;
16
+ chainId: z.ZodString;
17
+ chainName: z.ZodString;
18
+ rpcUrl: z.ZodString;
19
+ }, z.core.$strip>;
20
+ /**
21
+ * Configuration options for creating an EAS client.
22
+ * Combines EAS-specific options with base Viem client options.
23
+ */
24
+ type ClientOptions = z.infer<typeof ClientOptionsSchema>;
25
+
26
+ //#endregion
27
+ //#region src/types.d.ts
28
+ /**
29
+ * Supported field types for EAS schema fields.
30
+ * Maps to the Solidity types that can be used in EAS schemas.
31
+ */
32
+ declare const EAS_FIELD_TYPES: {
33
+ readonly string: "string";
34
+ readonly address: "address";
35
+ readonly bool: "bool";
36
+ readonly bytes: "bytes";
37
+ readonly bytes32: "bytes32";
38
+ readonly uint256: "uint256";
39
+ readonly int256: "int256";
40
+ readonly uint8: "uint8";
41
+ readonly int8: "int8";
42
+ };
43
+ type EASFieldType = keyof typeof EAS_FIELD_TYPES;
44
+ /**
45
+ * Represents a single field in an EAS schema.
46
+ */
47
+ interface SchemaField {
48
+ /** The name of the field */
49
+ name: string;
50
+ /** The Solidity type of the field */
51
+ type: EASFieldType;
52
+ /** Optional description of the field's purpose */
53
+ description?: string;
54
+ }
55
+ /**
56
+ * Options for registering a new schema in the EAS Schema Registry.
57
+ */
58
+ interface RegisterSchemaOptions {
59
+ /** Array of fields that make up the schema */
60
+ fields: SchemaField[];
61
+ /** Address of the resolver contract that will handle attestations */
62
+ resolverAddress: string;
63
+ /** Whether attestations using this schema can be revoked */
64
+ revocable: boolean;
65
+ }
66
+
67
+ //#endregion
68
+ //#region src/eas.d.ts
69
+ /**
70
+ * Creates an EAS client for interacting with the Ethereum Attestation Service.
71
+ *
72
+ * @param options - Configuration options for the client
73
+ * @returns An object containing the EAS client instance
74
+ * @throws Will throw an error if the options fail validation
75
+ *
76
+ * @example
77
+ * ```ts
78
+ * import { createEASClient } from '@settlemint/sdk-eas';
79
+ *
80
+ * const client = createEASClient({
81
+ * schemaRegistryAddress: "0x1234567890123456789012345678901234567890",
82
+ * attestationAddress: "0x1234567890123456789012345678901234567890",
83
+ * accessToken: "your-access-token",
84
+ * chainId: "1",
85
+ * chainName: "Ethereum",
86
+ * rpcUrl: "http://localhost:8545"
87
+ * });
88
+ * ```
89
+ */
90
+ declare function createEASClient(options: ClientOptions): {
91
+ registerSchema: (options: RegisterSchemaOptions) => Promise<string>;
92
+ getSchema: (uid: string) => Promise<string>;
93
+ };
94
+
95
+ //#endregion
96
+ export { ClientOptions, ClientOptionsSchema, EASFieldType, EAS_FIELD_TYPES, RegisterSchemaOptions, SchemaField, createEASClient };
97
+ //# sourceMappingURL=eas.d.ts.map