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.
getAddress()
Section titled “getAddress()”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}getWalletInfo()
Section titled “getWalletInfo()”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.
WalletInfo type
Section titled “WalletInfo type”interface WalletInfo { address: `0x${string}`; // The EOA address controlled by KMS email: string; // The user's registered email}OxGasClient getters
Section titled “OxGasClient getters”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 upclient.hasSmartAccount
// Chain ID configured for this clientclient.chainIdExample: displaying wallet info
Section titled “Example: displaying wallet info”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);