The following documents the method to work with EAS attestations via Ethereum Account Abstraction.
Generates 12 words phrase (BIP39) for wallet creation.
static generateMnemonic(): string[]
Derives the private key from the 12-word mnemonic.
static getPrivateKeyFromMnemonic(mnemonic: string[]): string
Derives the Ethereum address from the provided private key.
static getAddressFromPrivateKey(privateKey: string): string
Publish an EAS schema to an address.
async registerSchema(): Promise<void>
For more details, refer to the register-schema.js example.
Publish data to the EAS attestation contract.
attest(data: object): Promise<string>
For more details, refer to the attest.js example.
Get the balance of an Ethereum address.
getBalance(address: string): Promise<string>
For more details, refer to the check-balance.js example.
Fund an Ethereum address with some ethers.
fundAddress(recipientAddress: string, amount: string): Promise<string>
For more details, refer to the fund-address.js example.
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