Frontend
Wallet Integration
RainbowKit + Wagmi v2 for connect, viem for low-level calls, custom helpers for gas + EIP-712 auth refresh.
A working manual,
edited & set
by Ezra Nahumury
RainbowKit Setup
The provider is configured with a light theme that matches the docs site. Locale is forced to English so the modal copy stays consistent.
── tsx ──
<RainbowKitProvider
locale="en-US"
theme={lightTheme({
accentColor: "#18181b",
accentColorForeground: "white",
borderRadius: "large",
fontStack: "system",
overlayBlur: "small",
})}
showRecentTransactions
>
{children}
</RainbowKitProvider>Gas Overrides
Some wallets (notably Vibe wallet) compute gas fees below the current Arbitrum baseFee. We supply explicit overrides on every write call so the wallet can't under-bid the chain.
── ts ──
// fe-stealthgive/lib/gas.ts
import {parseGwei} from "viem";
export const arbSepoliaGas = {
maxFeePerGas: parseGwei("1"),
maxPriorityFeePerGas: 0n,
} as const;
// Usage:
await writeContractAsync({
address: ADDR.cSGD,
abi: confidentialSGDAbi,
functionName: "wrap",
args: [donor, amount],
...arbSepoliaGas,
});EIP-712 Auth
The Nox SDK issues a short-lived auth token after the first EIP-712 signature. When that token expires the SDK starts returning 401. Our useHandleClient() wraps the SDK with a refresh helper that drops the cached client and re-signs.
── ts ──
// fe-stealthgive/lib/nox.ts
const {client, refresh} = useHandleClient();
try {
await client?.decrypt(handle);
} catch (err) {
if (isAuthError(err)) {
const fresh = await refresh();
await fresh?.decrypt(handle);
}
}