Out-of-band transaction confirm
typescriptServer-side pattern: require a second channel for high-value actions.
type Tx = { id: string; amount: number; to: string };
export async function confirmTransfer(
tx: Tx,
otpFromPhone: string,
): Promise<boolean> {
const expected = await lookupOtp(tx.id);
if (otpFromPhone !== expected) return false;
await settle(tx);
return true;
}
// MitB can rewrite a form; OOB confirm still sees the real intent.