
Research
Two Malicious Rust Crates Impersonate Popular Logger to Steal Wallet Keys
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
@settlemint/sdk-eas
Advanced tools
✨ https://settlemint.com ✨
Integrate SettleMint into your application with ease.
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.
buildSchemaString(
fields
):string
Defined in: schema.ts:166
Builds an EAS schema string from an array of fields.
Parameter | Type | Description |
---|---|---|
fields | SchemaField [] | The fields to include in the schema |
string
The EAS-compatible schema string
Error if any field is invalid
import { buildSchemaString, SchemaField } from '@settlemint/sdk-eas';
const fields: SchemaField[] = [
{ name: "userAddress", type: "address" },
{ name: "age", type: "uint8" },
{ name: "isActive", type: "bool" }
];
const schemaString = buildSchemaString(fields);
// Result: "address userAddress, uint8 age, bool isActive"
registerSchema(
options
):Promise
<string
>
Defined in: schema.ts:246
Registers a new schema with EAS.
Parameter | Type | Description |
---|---|---|
options | RegisterSchemaOptions | The schema registration options |
Promise
<string
>
A promise that resolves to the schema UID
Error if the schema registration fails
import { registerSchema, SchemaField } from '@settlemint/sdk-eas';
const fields: SchemaField[] = [
{ name: "userAddress", type: "address" },
{ name: "age", type: "uint8" }
];
const schemaUID = await registerSchema({
fields,
resolverAddress: "0x1234567890123456789012345678901234567890",
revocable: true
});
console.log(`Schema registered with UID: ${schemaUID}`);
validateEthereumAddress(
address
):void
Defined in: schema.ts:214
Validates an Ethereum address.
Parameter | Type | Description |
---|---|---|
address | string | The address to validate |
void
Error if the address is invalid
import { validateEthereumAddress } from '@settlemint/sdk-eas';
// Valid address
validateEthereumAddress("0x1234567890123456789012345678901234567890"); // OK
// Invalid addresses
validateEthereumAddress("0x123"); // Throws: "Invalid Ethereum address format"
validateEthereumAddress(""); // Throws: "Resolver address cannot be empty"
validateFieldName(
name
):void
Defined in: schema.ts:71
Validates a schema field name.
Parameter | Type | Description |
---|---|---|
name | string | The field name to validate |
void
Error if the name is invalid
import { validateFieldName } from '@settlemint/sdk-eas';
// Valid names
validateFieldName("userAddress"); // OK
validateFieldName("user_address"); // OK
// Invalid names
validateFieldName("user address"); // Throws: "Field name cannot contain spaces"
validateFieldName("123user"); // Throws: "Field name must start with a letter or underscore"
validateFieldType(
type
): asserts type is "string" | "address" | "bool" | "bytes" | "bytes32" | "uint256" | "int256" | "uint8" | "int8"
Defined in: schema.ts:101
Validates a schema field type.
Parameter | Type | Description |
---|---|---|
type | string | The field type to validate |
asserts type is "string" | "address" | "bool" | "bytes" | "bytes32" | "uint256" | "int256" | "uint8" | "int8"
Error if the type is invalid
import { validateFieldType } from '@settlemint/sdk-eas';
// Valid types
validateFieldType("string"); // OK
validateFieldType("address"); // OK
// Invalid types
validateFieldType("invalidType"); // Throws: "Invalid field type: invalidType"
validateSchemaFields(
fields
):void
Defined in: schema.ts:130
Validates an array of schema fields.
Parameter | Type | Description |
---|---|---|
fields | SchemaField [] | The fields to validate |
void
Error if any field is invalid
import { validateSchemaFields, SchemaField } from '@settlemint/sdk-eas';
const fields: SchemaField[] = [
{ name: "userAddress", type: "address" },
{ name: "age", type: "uint8" }
];
validateSchemaFields(fields); // OK
// Invalid fields
validateSchemaFields([]); // Throws: "Schema must have at least one field"
validateSchemaFields([
{ name: "userAddress", type: "address" },
{ name: "userAddress", type: "uint8" }
]); // Throws: "Duplicate field name: userAddress"
Defined in: schema.ts:187
Options for registering a schema.
import { RegisterSchemaOptions, SchemaField } from '@settlemint/sdk-eas';
const options: RegisterSchemaOptions = {
fields: [
{ name: "userAddress", type: "address" },
{ name: "age", type: "uint8" }
],
resolverAddress: "0x1234567890123456789012345678901234567890",
revocable: true
};
Property | Type | Description | Defined in |
---|---|---|---|
fields | SchemaField [] | The fields that make up the schema | schema.ts:189 |
resolverAddress | string | The Ethereum address of the resolver | schema.ts:191 |
revocable | boolean | Whether attestations using this schema can be revoked | schema.ts:193 |
Defined in: schema.ts:45
Interface for defining a schema field.
import { SchemaField } from '@settlemint/sdk-eas';
const field: SchemaField = {
name: "userAddress",
type: "address",
description: "The Ethereum address of the user"
};
Property | Type | Description | Defined in |
---|---|---|---|
description? | string | Optional description of the field | schema.ts:51 |
name | string | The name of the field | schema.ts:47 |
type | "string" | "address" | "bool" | "bytes" | "bytes32" | "uint256" | "int256" | "uint8" | "int8" | The type of the field | schema.ts:49 |
EASFieldType = keyof typeof
EAS_FIELD_TYPES
Defined in: schema.ts:30
Type representing all valid EAS field types.
const
EAS_FIELD_TYPES:object
Defined in: schema.ts:15
Supported EAS schema field types. Maps user-friendly type names to EAS-compatible type strings.
Name | Type | Default value | Defined in |
---|---|---|---|
address | "address" | "address" | schema.ts:17 |
bool | "bool" | "bool" | schema.ts:18 |
bytes | "bytes" | "bytes" | schema.ts:19 |
bytes32 | "bytes32" | "bytes32" | schema.ts:20 |
int256 | "int256" | "int256" | schema.ts:22 |
int8 | "int8" | "int8" | schema.ts:24 |
string | "string" | "string" | schema.ts:16 |
uint256 | "uint256" | "uint256" | schema.ts:21 |
uint8 | "uint8" | "uint8" | schema.ts:23 |
import { EAS_FIELD_TYPES } from '@settlemint/sdk-eas';
// Use in type definitions
type MyFieldType = keyof typeof EAS_FIELD_TYPES;
// Check if a type is supported
const isValidType = "string" in EAS_FIELD_TYPES;
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.
The SettleMint SDK is released under the FSL Software License. See the LICENSE file for more details.
FAQs
Ethereum Attestation Service (EAS) integration for SettleMint SDK
The npm package @settlemint/sdk-eas receives a total of 2,000 weekly downloads. As such, @settlemint/sdk-eas popularity was classified as popular.
We found that @settlemint/sdk-eas demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Socket uncovers malicious Rust crates impersonating fast_log to steal Solana and Ethereum wallet keys from source code.
Research
A malicious package uses a QR code as steganography in an innovative technique.
Research
/Security News
Socket identified 80 fake candidates targeting engineering roles, including suspected North Korean operators, exposing the new reality of hiring as a security function.