Ethereum Attestation Service (EAS)
Integrating Ethereum Attestation Service (EAS) in your SettleMint dApp
About
The SettleMint EAS SDK provides a lightweight wrapper for the Ethereum Attestation Service (EAS), enabling developers to easily create, manage, and verify attestations within their applications. It simplifies the process of working with EAS by handling contract interactions, schema management, and The Graph integration, while ensuring proper integration with the SettleMint platform. This allows developers to quickly implement document verification, identity attestation, and other EAS-based features without manual setup.
API Reference
Functions
createEASClient()
createEASClient(
options
):object
Defined in: sdk/eas/src/eas.ts:36
Creates an EAS client for interacting with the Ethereum Attestation Service.
Parameters
Parameter | Type | Description |
---|---|---|
options | { accessToken : string ; attestationAddress : string ; chainId : string ; chainName : string ; rpcUrl : string ; schemaRegistryAddress : string ; } | Configuration options for the client |
options.accessToken | string | Access token for the RPC provider (must start with 'sm_aat_' or 'sm_pat_') |
options.attestationAddress | string | The address of the EAS Attestation contract |
options.chainId | string | The chain ID to connect to |
options.chainName | string | The name of the chain to connect to |
options.rpcUrl | string | The RPC URL to connect to (must be a valid URL) |
options.schemaRegistryAddress | string | The address of the EAS Schema Registry contract |
Returns
object
An object containing the EAS client instance
Name | Type | Defined in |
---|---|---|
getSchema() | (uid ) => Promise <string > | sdk/eas/src/eas.ts:96 |
registerSchema() | (options ) => Promise <string > | sdk/eas/src/eas.ts:95 |
Throws
Will throw an error if the options fail validation
Example
import { createEASClient } from '@settlemint/sdk-eas';
const client = createEASClient({
schemaRegistryAddress: "0x1234567890123456789012345678901234567890",
attestationAddress: "0x1234567890123456789012345678901234567890",
accessToken: "your-access-token",
chainId: "1",
chainName: "Ethereum",
rpcUrl: "http://localhost:8545"
});
Interfaces
RegisterSchemaOptions
Defined in: sdk/eas/src/types.ts:34
Options for registering a new schema in the EAS Schema Registry.
Properties
Property | Type | Description | Defined in |
---|---|---|---|
fields | SchemaField [] | Array of fields that make up the schema | sdk/eas/src/types.ts:36 |
resolverAddress | string | Address of the resolver contract that will handle attestations | sdk/eas/src/types.ts:38 |
revocable | boolean | Whether attestations using this schema can be revoked | sdk/eas/src/types.ts:40 |
SchemaField
Defined in: sdk/eas/src/types.ts:22
Represents a single field in an EAS schema.
Properties
Property | Type | Description | Defined in |
---|---|---|---|
description? | string | Optional description of the field's purpose | sdk/eas/src/types.ts:28 |
name | string | The name of the field | sdk/eas/src/types.ts:24 |
type | "string" | "address" | "bool" | "bytes" | "bytes32" | "int8" | "int256" | "uint8" | "uint256" | The Solidity type of the field | sdk/eas/src/types.ts:26 |
Type Aliases
ClientOptions
ClientOptions =
z.infer
<typeofClientOptionsSchema
>
Defined in: sdk/eas/src/client-options.schema.ts:28
Configuration options for creating an EAS client. Combines EAS-specific options with base Viem client options.
Variables
ClientOptionsSchema
const
ClientOptionsSchema:ZodObject
<{accessToken
:ZodString
;attestationAddress
:ZodString
;chainId
:ZodString
;chainName
:ZodString
;rpcUrl
:ZodString
;schemaRegistryAddress
:ZodString
; },$strip
>
Defined in: sdk/eas/src/client-options.schema.ts:9
Schema for validating EAS client configuration options. Extends the base Viem client options with EAS-specific requirements.
EAS_FIELD_TYPES
const
EAS_FIELD_TYPES:object
Defined in: sdk/eas/src/types.ts:5
Supported field types for EAS schema fields. Maps to the Solidity types that can be used in EAS schemas.
Type declaration
Name | Type | Default value | Defined in |
---|---|---|---|
address | "address" | "address" | sdk/eas/src/types.ts:7 |
bool | "bool" | "bool" | sdk/eas/src/types.ts:8 |
bytes | "bytes" | "bytes" | sdk/eas/src/types.ts:9 |
bytes32 | "bytes32" | "bytes32" | sdk/eas/src/types.ts:10 |
int256 | "int256" | "int256" | sdk/eas/src/types.ts:12 |
int8 | "int8" | "int8" | sdk/eas/src/types.ts:14 |
string | "string" | "string" | sdk/eas/src/types.ts:6 |
uint256 | "uint256" | "uint256" | sdk/eas/src/types.ts:11 |
uint8 | "uint8" | "uint8" | sdk/eas/src/types.ts:13 |
Contributing
We welcome contributions from the community! Please check out our Contributing guide to learn how you can help improve the SettleMint SDK through bug reports, feature requests, documentation updates, or code contributions.
License
The SettleMint SDK is released under the FSL Software License. See the LICENSE file for more details.