Skip to content

Wallet Info

After a successful login, the SDK holds the user’s wallet information in memory. You can read it at any time without triggering the widget again.

Returns the user’s KMS-backed EOA address as a 0x-prefixed hex string.

const address = auth.getAddress();
// "0x1234...abcd"

Throws NotConnectedError if the user is not logged in. Check isConnected() first if you’re not sure.

if (auth.isConnected()) {
const address = auth.getAddress();
// Safe to use
}

Returns the full WalletInfo object, or null if the user is not logged in.

const wallet = auth.getWalletInfo();
if (wallet) {
console.log('Address:', wallet.address);
console.log('Email:', wallet.email);
}

This never throws. It’s the safe way to access wallet info when you’re not sure about the auth state.

interface WalletInfo {
address: `0x${string}`; // The EOA address controlled by KMS
email: string; // The user's registered email
}

When using OxGasClient, you also have access to the smart account address and some convenience getters:

// EOA address (null if not logged in)
client.eoaAddress
// Smart account address (null until setupSmartAccount() is called)
client.smartAccountAddress
// Whether a smart account has been set up
client.hasSmartAccount
// Chain ID configured for this client
client.chainId
const wallet = auth.getWalletInfo();
if (!wallet) {
showLoginButton();
return;
}
// Shorten address for display: "0x1234...abcd"
const shortAddress = wallet.address.slice(0, 6) + '...' + wallet.address.slice(-4);
displayWalletUI(shortAddress, wallet.email);