Test wallet helper for simulating user signing in Builder mode.
UserClient holds a private key and can sign EIP-712 typed data and order hashes. It is a testing utility -- in production, users sign with their own wallets (MetaMask, WalletConnect, etc.).
Create a Random Test Wallet
import{UserClient}from'@opinion-labs/opinion-clob-sdk';constuser=UserClient.createRandom();console.log(user.address);// Random EOA address
// Save to file
user.saveToFile('.test_user.json');
// Load from file
const user = UserClient.loadFromFile('.test_user.json');
// Load or create (creates new if file doesn't exist)
const user = UserClient.loadOrCreate('.test_user.json');