Skip to content

Latest commit

 

History

History
89 lines (54 loc) · 1.74 KB

README.md

File metadata and controls

89 lines (54 loc) · 1.74 KB

EAS Library Documentation

Intro

The following documents the method to work with EAS attestations via Ethereum Account Abstraction.

Methods

generate12Words

Generates 12 words phrase (BIP39) for wallet creation.

static generateMnemonic(): string[]

derivePrivateKeyFrom12Words

Derives the private key from the 12-word mnemonic.

static getPrivateKeyFromMnemonic(mnemonic: string[]): string

derivePublicKeyAndAddress

Derives the Ethereum address from the provided private key.

static getAddressFromPrivateKey(privateKey: string): string

registerSchema

Publish an EAS schema to an address.

async registerSchema(): Promise<void>

For more details, refer to the register-schema.js example.

attest

Publish data to the EAS attestation contract.

attest(data: object): Promise<string>

For more details, refer to the attest.js example.

getBalance

Get the balance of an Ethereum address.

getBalance(address: string): Promise<string>

For more details, refer to the check-balance.js example.

fundAddress

Fund an Ethereum address with some ethers.

fundAddress(recipientAddress: string, amount: string): Promise<string>

For more details, refer to the fund-address.js example.

Scripts

Register Schema

You can use the following bash script to register a schema.

Create a schema file and name it schema with the following example content:

uint256 eventId, string[] weights, string comment

The run the following commmand to register it:

./register-schema.js -p ./schema