docs.attest.sh Open in urlscan Pro
149.28.224.130  Public Scan

URL: https://docs.attest.sh/docs/developer-tools/sdk-wagmi
Submission: On March 26 via api from US — Scanned from DE

Form analysis 0 forms found in the DOM

Text Content

Skip to main content

Ethereum Attestation Service
EAS ExplorerEAS WebsiteGitHub

Search...


 * Welcome to EAS
 * Purpose
 * Quick Start
 * Core Concepts
 * Developer Tools
   * EAS SDK
   * GraphQL API
   * Using SDK with viem/wagmi
   * Verify Offchain Attestation
   * Batch Timestamping
   * Hash Any File
   * EAS MetaMask Snap
 * Tutorials
 * The Explorer
 * Ideas to Build

 * 
 * Developer Tools
 * Using SDK with viem/wagmi

On this page


SDK WITH WAGMI

Since wagmi now no longer uses ethers and instead uses a new library called
viem, users need to convert the viem style publicClient and walletClient to
ethers style provider and signer to use the eas-sdk.


USING USESIGNER AND USEPROVIDER HOOKS

The two hooks, useSigner and useProvider, make this conversion easy for you. You
don't need to install a whole separate library to do this conversion, simply add
these hooks to your project.

USESIGNER HOOK

The useSigner hook gets the walletClient and returns a signer compatible with
ethers.

Usage:

const signer = useSigner();




USEPROVIDER HOOK

The useProvider hook gets the publicClient and returns a provider compatible
with ethers.

Usage:

const signer = useProvider();





CODE IMPLEMENTATION

You can find the code for the useSigner and useProvider hooks here.

This code imports necessary types from wagmi and viem, and defines two
conversion functions (publicClientToProvider and walletClientToSigner) along
with the two hooks.

Edit this page

Previous
GraphQL API
Next
Verify Offchain Attestation
 * Using useSigner and useProvider Hooks
 * Code Implementation

Docs
 * Welcome to EAS
 * Learn
 * Getting Started
 * Tutorials
 * Developer Tools

Community
 * Twitter
 * Github
 * Warpcast

More
 * Mirror Articles

Copyright © 2024 Ethereum Attestation Service. Built by the Ethereum Community.