@settlemint/sdk-eas 2.3.5-prf7f294ed → 2.3.5-prfb2ed7df
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 +132 -334
- package/dist/browser/eas.d.ts +53 -4199
- package/dist/browser/eas.js +10319 -407
- package/dist/browser/eas.js.map +1 -1
- package/dist/eas.cjs +10321 -419
- package/dist/eas.cjs.map +1 -1
- package/dist/eas.d.cts +53 -4199
- package/dist/eas.d.ts +53 -4199
- package/dist/eas.js +10320 -407
- package/dist/eas.js.map +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,389 +1,187 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
{ name: "score", type: "uint256", description: "Reputation score" },
|
|
48
|
-
{ name: "verified", type: "bool", description: "Verification status" },
|
|
49
|
-
],
|
|
50
|
-
resolver: "0x0000000000000000000000000000000000000000",
|
|
51
|
-
revocable: true,
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
// Create an attestation
|
|
55
|
-
const attestationResult = await client.attest({
|
|
56
|
-
schema: schemaResult.hash,
|
|
57
|
-
data: {
|
|
58
|
-
recipient: "0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6",
|
|
59
|
-
expirationTime: BigInt(0),
|
|
60
|
-
revocable: true,
|
|
61
|
-
refUID: "0x0000000000000000000000000000000000000000000000000000000000000000",
|
|
62
|
-
data: "0x", // Encoded attestation data
|
|
63
|
-
value: BigInt(0),
|
|
64
|
-
},
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
console.log("Attestation created:", attestationResult.hash);
|
|
68
|
-
```
|
|
69
|
-
|
|
70
|
-
## Portal GraphQL Integration
|
|
71
|
-
|
|
72
|
-
This package integrates with SettleMint's Portal GraphQL API, providing access to all EAS operations:
|
|
73
|
-
|
|
74
|
-
### Available Mutations
|
|
75
|
-
|
|
76
|
-
- `EasSchemaRegistryRegister` - Register new schemas
|
|
77
|
-
- `EasDeploymentAttest` - Create single attestation
|
|
78
|
-
- `EasDeploymentAttestByDelegation` - Create delegated attestation
|
|
79
|
-
- `EasDeploymentMultiAttest` - Create multiple attestations
|
|
80
|
-
- `EasDeploymentMultiAttestByDelegation` - Create multiple delegated attestations
|
|
81
|
-
- `EasDeploymentRevoke` - Revoke single attestation
|
|
82
|
-
- `EasDeploymentRevokeByDelegation` - Revoke by delegation
|
|
83
|
-
- `EasDeploymentMultiRevoke` - Revoke multiple attestations
|
|
84
|
-
- `EasDeploymentMultiRevokeByDelegation` - Revoke multiple by delegation
|
|
85
|
-
- `EasDeploymentRevokeOffchain` - Revoke offchain attestation
|
|
86
|
-
- `EasDeploymentMultiRevokeOffchain` - Revoke multiple offchain
|
|
87
|
-
- `EasDeploymentTimestamp` - Timestamp operation
|
|
88
|
-
- `EasDeploymentMultiTimestamp` - Timestamp multiple operations
|
|
89
|
-
- `EasDeploymentIncreaseNonce` - Increase nonce for delegations
|
|
90
|
-
|
|
91
|
-
### Available Queries
|
|
92
|
-
|
|
93
|
-
- Contract deployment status and addresses
|
|
94
|
-
- Schema retrieval and validation
|
|
95
|
-
- Attestation lookup and verification
|
|
96
|
-
- Transaction monitoring and history
|
|
1
|
+
<p align="center">
|
|
2
|
+
<img src="https://github.com/settlemint/sdk/blob/main/logo.svg" width="200px" align="center" alt="SettleMint logo" />
|
|
3
|
+
<h1 align="center">SettleMint SDK</h1>
|
|
4
|
+
<p align="center">
|
|
5
|
+
✨ <a href="https://settlemint.com">https://settlemint.com</a> ✨
|
|
6
|
+
<br/>
|
|
7
|
+
Integrate SettleMint into your application with ease.
|
|
8
|
+
</p>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
<p align="center">
|
|
12
|
+
<a href="https://github.com/settlemint/sdk/actions?query=branch%3Amain"><img src="https://github.com/settlemint/sdk/actions/workflows/build.yml/badge.svg?event=push&branch=main" alt="CI status" /></a>
|
|
13
|
+
<a href="https://fsl.software" rel="nofollow"><img src="https://img.shields.io/npm/l/@settlemint/sdk-eas" alt="License"></a>
|
|
14
|
+
<a href="https://www.npmjs.com/package/@settlemint/sdk-eas" rel="nofollow"><img src="https://img.shields.io/npm/dw/@settlemint/sdk-eas" alt="npm"></a>
|
|
15
|
+
<a href="https://github.com/settlemint/sdk" rel="nofollow"><img src="https://img.shields.io/github/stars/settlemint/sdk" alt="stars"></a>
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<div align="center">
|
|
19
|
+
<a href="https://console.settlemint.com/documentation">Documentation</a>
|
|
20
|
+
<span> • </span>
|
|
21
|
+
<a href="https://www.npmjs.com/package/@settlemint/sdk-eas">NPM</a>
|
|
22
|
+
<span> • </span>
|
|
23
|
+
<a href="https://github.com/settlemint/sdk/issues">Issues</a>
|
|
24
|
+
<br />
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
## Table of Contents
|
|
28
|
+
|
|
29
|
+
- [About](#about)
|
|
30
|
+
- [API Reference](#api-reference)
|
|
31
|
+
- [Functions](#functions)
|
|
32
|
+
- [createEASClient()](#createeasclient)
|
|
33
|
+
- [Interfaces](#interfaces)
|
|
34
|
+
- [RegisterSchemaOptions](#registerschemaoptions)
|
|
35
|
+
- [SchemaField](#schemafield)
|
|
36
|
+
- [Type Aliases](#type-aliases)
|
|
37
|
+
- [ClientOptions](#clientoptions)
|
|
38
|
+
- [Variables](#variables)
|
|
39
|
+
- [ClientOptionsSchema](#clientoptionsschema)
|
|
40
|
+
- [EAS\_FIELD\_TYPES](#eas_field_types)
|
|
41
|
+
- [Contributing](#contributing)
|
|
42
|
+
- [License](#license)
|
|
43
|
+
|
|
44
|
+
## About
|
|
45
|
+
|
|
46
|
+
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.
|
|
97
47
|
|
|
98
48
|
## API Reference
|
|
99
49
|
|
|
100
|
-
###
|
|
50
|
+
### Functions
|
|
101
51
|
|
|
102
|
-
|
|
52
|
+
#### createEASClient()
|
|
103
53
|
|
|
104
|
-
|
|
54
|
+
> **createEASClient**(`options`): `object`
|
|
105
55
|
|
|
106
|
-
|
|
107
|
-
interface EASClientOptions {
|
|
108
|
-
instance: string; // Portal GraphQL endpoint
|
|
109
|
-
accessToken: string; // Portal access token
|
|
110
|
-
easContractAddress?: Address; // Optional: EAS contract address
|
|
111
|
-
schemaRegistryContractAddress?: Address; // Optional: Schema registry address
|
|
112
|
-
debug?: boolean; // Optional: Enable debug logging
|
|
113
|
-
}
|
|
114
|
-
```
|
|
56
|
+
Defined in: [sdk/eas/src/eas.ts:36](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/eas.ts#L36)
|
|
115
57
|
|
|
116
|
-
|
|
58
|
+
Creates an EAS client for interacting with the Ethereum Attestation Service.
|
|
117
59
|
|
|
118
|
-
|
|
119
|
-
- `registerSchema(request)` - Register new schema
|
|
120
|
-
- `attest(request)` - Create attestation
|
|
121
|
-
- `multiAttest(requests)` - Create multiple attestations
|
|
122
|
-
- `revoke(uid, value?)` - Revoke attestation
|
|
123
|
-
- `getSchema(uid)` - Get schema by UID
|
|
124
|
-
- `getSchemas(options?)` - Get all schemas (paginated)
|
|
125
|
-
- `getAttestation(uid)` - Get attestation by UID
|
|
126
|
-
- `getAttestations(options?)` - Get all attestations (paginated)
|
|
127
|
-
- `isValidAttestation(uid)` - Check attestation validity
|
|
128
|
-
- `getTimestamp()` - Get contract timestamp
|
|
129
|
-
- `getOptions()` - Get client configuration
|
|
130
|
-
- `getPortalClient()` - Get Portal client instance
|
|
131
|
-
- `getContractAddresses()` - Get current contract addresses
|
|
60
|
+
##### Parameters
|
|
132
61
|
|
|
133
|
-
|
|
62
|
+
| Parameter | Type | Description |
|
|
63
|
+
| ------ | ------ | ------ |
|
|
64
|
+
| `options` | \{ `accessToken`: `string`; `attestationAddress`: `string`; `chainId`: `string`; `chainName`: `string`; `rpcUrl`: `string`; `schemaRegistryAddress`: `string`; \} | Configuration options for the client |
|
|
65
|
+
| `options.accessToken` | `string` | Access token for the RPC provider (must start with 'sm_aat_' or 'sm_pat_') |
|
|
66
|
+
| `options.attestationAddress` | `string` | The address of the EAS Attestation contract |
|
|
67
|
+
| `options.chainId` | `string` | The chain ID to connect to |
|
|
68
|
+
| `options.chainName` | `string` | The name of the chain to connect to |
|
|
69
|
+
| `options.rpcUrl` | `string` | The RPC URL to connect to (must be a valid URL) |
|
|
70
|
+
| `options.schemaRegistryAddress` | `string` | The address of the EAS Schema Registry contract |
|
|
134
71
|
|
|
135
|
-
|
|
72
|
+
##### Returns
|
|
136
73
|
|
|
137
|
-
|
|
138
|
-
- Real-world attestation scenarios
|
|
139
|
-
- Schema design patterns
|
|
140
|
-
- Multi-attestation operations
|
|
74
|
+
`object`
|
|
141
75
|
|
|
142
|
-
|
|
76
|
+
An object containing the EAS client instance
|
|
143
77
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
- ✅ **Testing**: Complete test suite
|
|
149
|
-
- ✅ **Documentation**: Full API documentation
|
|
150
|
-
- 🔄 **Real Portal Access**: Requires valid EAS Portal access token
|
|
78
|
+
| Name | Type | Defined in |
|
|
79
|
+
| ------ | ------ | ------ |
|
|
80
|
+
| `getSchema()` | (`uid`) => `Promise`\<`string`\> | [sdk/eas/src/eas.ts:96](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/eas.ts#L96) |
|
|
81
|
+
| `registerSchema()` | (`options`) => `Promise`\<`string`\> | [sdk/eas/src/eas.ts:95](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/eas.ts#L95) |
|
|
151
82
|
|
|
152
|
-
|
|
83
|
+
##### Throws
|
|
153
84
|
|
|
154
|
-
|
|
155
|
-
- Valid SettleMint Portal access token
|
|
156
|
-
- Access to EAS Portal instance
|
|
85
|
+
Will throw an error if the options fail validation
|
|
157
86
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
FSL-1.1-MIT
|
|
161
|
-
|
|
162
|
-
# EAS Portal SDK
|
|
163
|
-
|
|
164
|
-
A TypeScript SDK for interacting with Ethereum Attestation Service (EAS) via SettleMint Portal.
|
|
165
|
-
|
|
166
|
-
## Features
|
|
167
|
-
|
|
168
|
-
- **Portal Integration**: Direct integration with SettleMint Portal GraphQL API
|
|
169
|
-
- **Type Safety**: Full TypeScript support with proper type definitions
|
|
170
|
-
- **Contract Management**: Deploy or connect to existing EAS contracts
|
|
171
|
-
- **Schema Management**: Register and retrieve attestation schemas
|
|
172
|
-
- **Attestation Operations**: Create, retrieve, and validate attestations
|
|
173
|
-
- **Configurable**: No hardcoded values - all addresses and references are configurable
|
|
87
|
+
##### Example
|
|
174
88
|
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
```bash
|
|
178
|
-
npm install @settlemint/sdk-eas
|
|
179
|
-
# or
|
|
180
|
-
bun add @settlemint/sdk-eas
|
|
181
|
-
```
|
|
182
|
-
|
|
183
|
-
## Quick Start
|
|
184
|
-
|
|
185
|
-
```typescript
|
|
186
|
-
import { createEASClient, ZERO_ADDRESS, ZERO_BYTES32 } from "@settlemint/sdk-eas";
|
|
89
|
+
```ts
|
|
90
|
+
import { createEASClient } from '@settlemint/sdk-eas';
|
|
187
91
|
|
|
188
92
|
const client = createEASClient({
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
93
|
+
schemaRegistryAddress: "0x1234567890123456789012345678901234567890",
|
|
94
|
+
attestationAddress: "0x1234567890123456789012345678901234567890",
|
|
95
|
+
accessToken: "your-access-token",
|
|
96
|
+
chainId: "1",
|
|
97
|
+
chainName: "Ethereum",
|
|
98
|
+
rpcUrl: "http://localhost:8545"
|
|
192
99
|
});
|
|
193
|
-
|
|
194
|
-
// Deploy contracts
|
|
195
|
-
const deployment = await client.deploy("0x742d35Cc6634C0532925a3b8D4C9db96C4b4d8b6");
|
|
196
|
-
|
|
197
|
-
// Register schema
|
|
198
|
-
const schema = await client.registerSchema({
|
|
199
|
-
fields: [
|
|
200
|
-
{ name: "user", type: "address" },
|
|
201
|
-
{ name: "score", type: "uint256" },
|
|
202
|
-
],
|
|
203
|
-
resolver: ZERO_ADDRESS, // No resolver
|
|
204
|
-
revocable: true,
|
|
205
|
-
}, "0x8ba1f109551bD432803012645Hac136c22C177ec");
|
|
206
|
-
|
|
207
|
-
// Create attestation
|
|
208
|
-
const attestation = await client.attest({
|
|
209
|
-
schema: schema.hash,
|
|
210
|
-
data: {
|
|
211
|
-
recipient: "0x9876543210987654321098765432109876543210",
|
|
212
|
-
expirationTime: BigInt(0), // No expiration
|
|
213
|
-
revocable: true,
|
|
214
|
-
refUID: ZERO_BYTES32, // No reference
|
|
215
|
-
data: "0x1234",
|
|
216
|
-
value: BigInt(0),
|
|
217
|
-
},
|
|
218
|
-
}, "0x8ba1f109551bD432803012645Hac136c22C177ec");
|
|
219
100
|
```
|
|
220
101
|
|
|
221
|
-
|
|
102
|
+
### Interfaces
|
|
222
103
|
|
|
223
|
-
|
|
104
|
+
#### RegisterSchemaOptions
|
|
224
105
|
|
|
225
|
-
|
|
106
|
+
Defined in: [sdk/eas/src/types.ts:34](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L34)
|
|
226
107
|
|
|
227
|
-
|
|
228
|
-
import { ZERO_ADDRESS, ZERO_BYTES32 } from "@settlemint/sdk-eas";
|
|
108
|
+
Options for registering a new schema in the EAS Schema Registry.
|
|
229
109
|
|
|
230
|
-
|
|
231
|
-
ZERO_ADDRESS // "0x0000000000000000000000000000000000000000"
|
|
110
|
+
##### Properties
|
|
232
111
|
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
112
|
+
| Property | Type | Description | Defined in |
|
|
113
|
+
| ------ | ------ | ------ | ------ |
|
|
114
|
+
| <a id="fields"></a> `fields` | [`SchemaField`](#schemafield)[] | Array of fields that make up the schema | [sdk/eas/src/types.ts:36](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L36) |
|
|
115
|
+
| <a id="resolveraddress"></a> `resolverAddress` | `string` | Address of the resolver contract that will handle attestations | [sdk/eas/src/types.ts:38](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L38) |
|
|
116
|
+
| <a id="revocable"></a> `revocable` | `boolean` | Whether attestations using this schema can be revoked | [sdk/eas/src/types.ts:40](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L40) |
|
|
236
117
|
|
|
237
|
-
|
|
118
|
+
***
|
|
238
119
|
|
|
239
|
-
####
|
|
120
|
+
#### SchemaField
|
|
240
121
|
|
|
241
|
-
|
|
242
|
-
// Option 1: No meta-transaction forwarder (default)
|
|
243
|
-
await client.deploy(deployerAddress); // Uses ZERO_ADDRESS
|
|
122
|
+
Defined in: [sdk/eas/src/types.ts:22](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L22)
|
|
244
123
|
|
|
245
|
-
|
|
246
|
-
await client.deploy(deployerAddress, "0x1234567890123456789012345678901234567890");
|
|
247
|
-
```
|
|
124
|
+
Represents a single field in an EAS schema.
|
|
248
125
|
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
```typescript
|
|
252
|
-
// Option 1: No resolver (most common)
|
|
253
|
-
await client.registerSchema({
|
|
254
|
-
fields: [...],
|
|
255
|
-
resolver: ZERO_ADDRESS, // No custom validation
|
|
256
|
-
revocable: true,
|
|
257
|
-
}, fromAddress);
|
|
258
|
-
|
|
259
|
-
// Option 2: Custom resolver contract
|
|
260
|
-
await client.registerSchema({
|
|
261
|
-
fields: [...],
|
|
262
|
-
resolver: "0x5678901234567890123456789012345678901234", // Custom validation
|
|
263
|
-
revocable: true,
|
|
264
|
-
}, fromAddress);
|
|
265
|
-
```
|
|
126
|
+
##### Properties
|
|
266
127
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
schema: schemaUID,
|
|
273
|
-
data: {
|
|
274
|
-
recipient: recipientAddress,
|
|
275
|
-
refUID: ZERO_BYTES32, // No reference to other attestations
|
|
276
|
-
// ... other fields
|
|
277
|
-
},
|
|
278
|
-
}, fromAddress);
|
|
279
|
-
|
|
280
|
-
// Option 2: Reference another attestation
|
|
281
|
-
await client.attest({
|
|
282
|
-
schema: schemaUID,
|
|
283
|
-
data: {
|
|
284
|
-
recipient: recipientAddress,
|
|
285
|
-
refUID: "0x1234567890123456789012345678901234567890123456789012345678901234", // Links to parent
|
|
286
|
-
// ... other fields
|
|
287
|
-
},
|
|
288
|
-
}, fromAddress);
|
|
289
|
-
```
|
|
128
|
+
| Property | Type | Description | Defined in |
|
|
129
|
+
| ------ | ------ | ------ | ------ |
|
|
130
|
+
| <a id="description"></a> `description?` | `string` | Optional description of the field's purpose | [sdk/eas/src/types.ts:28](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L28) |
|
|
131
|
+
| <a id="name"></a> `name` | `string` | The name of the field | [sdk/eas/src/types.ts:24](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L24) |
|
|
132
|
+
| <a id="type"></a> `type` | `"string"` \| `"address"` \| `"bool"` \| `"bytes"` \| `"bytes32"` \| `"int8"` \| `"int256"` \| `"uint8"` \| `"uint256"` | The Solidity type of the field | [sdk/eas/src/types.ts:26](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L26) |
|
|
290
133
|
|
|
291
|
-
|
|
134
|
+
### Type Aliases
|
|
292
135
|
|
|
293
|
-
|
|
294
|
-
// Option 1: No expiration (permanent)
|
|
295
|
-
expirationTime: BigInt(0)
|
|
136
|
+
#### ClientOptions
|
|
296
137
|
|
|
297
|
-
|
|
298
|
-
expirationTime: BigInt(Math.floor(Date.now() / 1000) + 86400)
|
|
138
|
+
> **ClientOptions** = `z.infer`\<*typeof* [`ClientOptionsSchema`](#clientoptionsschema)\>
|
|
299
139
|
|
|
300
|
-
|
|
301
|
-
expirationTime: BigInt(1735689600) // January 1, 2025
|
|
302
|
-
```
|
|
140
|
+
Defined in: [sdk/eas/src/client-options.schema.ts:28](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/client-options.schema.ts#L28)
|
|
303
141
|
|
|
304
|
-
|
|
142
|
+
Configuration options for creating an EAS client.
|
|
143
|
+
Combines EAS-specific options with base Viem client options.
|
|
305
144
|
|
|
306
|
-
|
|
307
|
-
// Option 1: No ETH sent (most common)
|
|
308
|
-
value: BigInt(0)
|
|
145
|
+
### Variables
|
|
309
146
|
|
|
310
|
-
|
|
311
|
-
value: BigInt("1000000000000000000") // 1 ETH in wei
|
|
312
|
-
```
|
|
147
|
+
#### ClientOptionsSchema
|
|
313
148
|
|
|
314
|
-
|
|
149
|
+
> `const` **ClientOptionsSchema**: `ZodObject`\<\{ `accessToken`: `ZodString`; `attestationAddress`: `ZodString`; `chainId`: `ZodString`; `chainName`: `ZodString`; `rpcUrl`: `ZodString`; `schemaRegistryAddress`: `ZodString`; \}, `$strip`\>
|
|
315
150
|
|
|
316
|
-
|
|
151
|
+
Defined in: [sdk/eas/src/client-options.schema.ts:9](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/client-options.schema.ts#L9)
|
|
317
152
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
instance: string; // Portal GraphQL endpoint
|
|
321
|
-
accessToken: string; // Portal access token
|
|
322
|
-
easContractAddress?: Address; // Optional: existing EAS contract
|
|
323
|
-
schemaRegistryContractAddress?: Address; // Optional: existing Schema Registry
|
|
324
|
-
debug?: boolean; // Optional: enable debug logging
|
|
325
|
-
}
|
|
326
|
-
```
|
|
153
|
+
Schema for validating EAS client configuration options.
|
|
154
|
+
Extends the base Viem client options with EAS-specific requirements.
|
|
327
155
|
|
|
328
|
-
|
|
156
|
+
***
|
|
329
157
|
|
|
330
|
-
|
|
331
|
-
async deploy(
|
|
332
|
-
deployerAddress: Address,
|
|
333
|
-
forwarderAddress?: Address, // Optional: defaults to ZERO_ADDRESS
|
|
334
|
-
gasLimit?: string // Optional: defaults to "0x3d0900"
|
|
335
|
-
): Promise<DeploymentResult>
|
|
336
|
-
```
|
|
158
|
+
#### EAS\_FIELD\_TYPES
|
|
337
159
|
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
```typescript
|
|
341
|
-
interface SchemaRequest {
|
|
342
|
-
fields?: SchemaField[]; // Alternative to schema string
|
|
343
|
-
schema?: string; // Alternative to fields
|
|
344
|
-
resolver: Address; // Use ZERO_ADDRESS for no resolver
|
|
345
|
-
revocable: boolean; // Whether attestations can be revoked
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
async registerSchema(
|
|
349
|
-
request: SchemaRequest,
|
|
350
|
-
fromAddress: Address,
|
|
351
|
-
gasLimit?: string
|
|
352
|
-
): Promise<TransactionResult>
|
|
353
|
-
```
|
|
160
|
+
> `const` **EAS\_FIELD\_TYPES**: `object`
|
|
354
161
|
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
```typescript
|
|
358
|
-
interface AttestationData {
|
|
359
|
-
recipient: Address; // Who receives the attestation
|
|
360
|
-
expirationTime: bigint; // Use 0 for no expiration
|
|
361
|
-
revocable: boolean; // Whether this can be revoked
|
|
362
|
-
refUID: Hex; // Use ZERO_BYTES32 for no reference
|
|
363
|
-
data: Hex; // Encoded attestation data
|
|
364
|
-
value: bigint; // ETH amount to send (usually 0)
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
async attest(
|
|
368
|
-
request: AttestationRequest,
|
|
369
|
-
fromAddress: Address,
|
|
370
|
-
gasLimit?: string
|
|
371
|
-
): Promise<TransactionResult>
|
|
372
|
-
```
|
|
162
|
+
Defined in: [sdk/eas/src/types.ts:5](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L5)
|
|
373
163
|
|
|
374
|
-
|
|
164
|
+
Supported field types for EAS schema fields.
|
|
165
|
+
Maps to the Solidity types that can be used in EAS schemas.
|
|
375
166
|
|
|
376
|
-
|
|
167
|
+
##### Type declaration
|
|
377
168
|
|
|
378
|
-
|
|
379
|
-
|
|
169
|
+
| Name | Type | Default value | Defined in |
|
|
170
|
+
| ------ | ------ | ------ | ------ |
|
|
171
|
+
| <a id="address"></a> `address` | `"address"` | `"address"` | [sdk/eas/src/types.ts:7](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L7) |
|
|
172
|
+
| <a id="bool"></a> `bool` | `"bool"` | `"bool"` | [sdk/eas/src/types.ts:8](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L8) |
|
|
173
|
+
| <a id="bytes"></a> `bytes` | `"bytes"` | `"bytes"` | [sdk/eas/src/types.ts:9](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L9) |
|
|
174
|
+
| <a id="bytes32"></a> `bytes32` | `"bytes32"` | `"bytes32"` | [sdk/eas/src/types.ts:10](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L10) |
|
|
175
|
+
| <a id="int256"></a> `int256` | `"int256"` | `"int256"` | [sdk/eas/src/types.ts:12](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L12) |
|
|
176
|
+
| <a id="int8"></a> `int8` | `"int8"` | `"int8"` | [sdk/eas/src/types.ts:14](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L14) |
|
|
177
|
+
| <a id="string"></a> `string` | `"string"` | `"string"` | [sdk/eas/src/types.ts:6](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L6) |
|
|
178
|
+
| <a id="uint256"></a> `uint256` | `"uint256"` | `"uint256"` | [sdk/eas/src/types.ts:11](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L11) |
|
|
179
|
+
| <a id="uint8"></a> `uint8` | `"uint8"` | `"uint8"` | [sdk/eas/src/types.ts:13](https://github.com/settlemint/sdk/blob/v2.3.5/sdk/eas/src/types.ts#L13) |
|
|
380
180
|
|
|
381
|
-
##
|
|
181
|
+
## Contributing
|
|
382
182
|
|
|
383
|
-
|
|
384
|
-
bun test
|
|
385
|
-
```
|
|
183
|
+
We welcome contributions from the community! Please check out our [Contributing](https://github.com/settlemint/sdk/blob/main/.github/CONTRIBUTING.md) guide to learn how you can help improve the SettleMint SDK through bug reports, feature requests, documentation updates, or code contributions.
|
|
386
184
|
|
|
387
185
|
## License
|
|
388
186
|
|
|
389
|
-
|
|
187
|
+
The SettleMint SDK is released under the [FSL Software License](https://fsl.software). See the [LICENSE](https://github.com/settlemint/sdk/blob/main/LICENSE) file for more details.
|