Averer Wallet
The Averer Wallet is the foundational layer of the Averer Web SDK. It is an embedded identity and blockchain wallet that is automatically created and managed for each user when they authenticate through the SDK.
Every feature in the SDK (verification, proof generation, on-chain interactions) is built on top of this wallet layer.
What the wallet provides
- Embedded wallet creation: when a user logs in via email or social account, the SDK creates a blockchain wallet on their behalf. No browser extension, seed phrase, or manual setup required.
- Gas abstraction: the Averer Issuer funds the user's embedded wallet address so they never need to hold native tokens to pay for transaction fees. Blockchain interactions are invisible to the user.
- Account abstraction: smart wallet capabilities simplify transaction flows and enable features like batched transactions.
- Blockchain read and write access: the wallet exposes standard Viem clients (Public Client and Wallet Client) for reading blockchain data and sending transactions.
- Message signing: users can sign arbitrary messages with their embedded wallet's private key.
Accessing the wallet
The SDK exports a useAvererWallet hook that gives you access to the wallet instance within any component rendered inside AvererSdkProvider.
import { useAvererWallet } from '@averer/averer-websdk';
const MyComponent = () => {
const wallet = useAvererWallet();
if (!wallet) {
return <p>Wallet not connected</p>;
}
return <p>Wallet address: {wallet.address}</p>;
};
The wallet object provides:
address: the user's blockchain addressonChainIdentityAddress: the optional ONCHAINID contract address created after KYC/KYBgetPublicClient(): returns a Viem Public Client for read-only blockchain operationsgetWalletClient(): returns a Viem Wallet Client for signing transactionsgetBalance(): returns the wallet's token balancesignMessage(message): signs an arbitrary message stringensureMfaForSigning(): prompts for MFA if required before signing or sending a transactiongetUserOperationReceipt(userOpHash): one-shot lookup for a ZeroDev user operation (returnsnullwhile pending)waitForUserOperationReceipt(userOpHash): polls until the user operation is confirmed or times out
For receipt examples, see Usage — Account abstraction receipts.
logout(): signs the user out and resets the SDK to the eligibility screen
onChainIdentityAddress is read from Dynamic user metadata using the connected wallet address as the lookup key. It is non-blocking and may be empty while the issuer is still creating the user's ONCHAINID or before the SDK finishes syncing it into Dynamic metadata.
For code examples covering each of these, see Usage.