/**
 * On-ramp provider abstraction — common interface for fiat-to-crypto providers.
 *
 * Each provider implements this interface to produce a widget URL
 * that the frontend can embed in an iframe for card purchases.
 */

export type OnrampProviderId = 'transak' | 'coinbase' | 'ramp';

export interface OnrampSessionRequest {
	walletAddress: string;
	email: string;
	fiatAmount: number;
	fiatCurrency: string;
	sessionId: string;
	returnUrl?: string;
	hostname?: string;
}

export interface OnrampSessionResult {
	widgetUrl: string;
	provider: OnrampProviderId;
}

export interface OnrampProvider {
	id: OnrampProviderId;
	name: string;
	isAvailable(): boolean;
	createSession(req: OnrampSessionRequest): Promise<OnrampSessionResult>;
}
