// apps/desktop/src/main/services/ads/InMobiAdapter.ts // InMobi Programmatic Demand & Mobile/Hybrid Adapter import type { AdNetworkId, AdFormat, AdMediationAuctionRequest, AdCreativePayload, } from '@d3ro/core/types' import type { IAdNetworkAdapter, AdBidResponse } from './BaseAdAdapter' export class InMobiAdapter implements IAdNetworkAdapter { readonly networkId: AdNetworkId = 'inmobi' readonly networkName = 'InMobi (Programmatic Exchange)' readonly supportedFormats: AdFormat[] = ['banner_dock', 'rewarded_video'] readonly defaultFloorEcpm = 2.8 async init(): Promise {} async requestBid(request: AdMediationAuctionRequest): Promise { const startTime = Date.now() if (!this.supportedFormats.includes(request.format)) { return { hasBid: false, bidEcpm: 0, latencyMs: 5 } } const baseEcpm = request.format === 'rewarded_video' ? 6.8 : 3.4 const ecpm = baseEcpm + Math.random() * 2.2 const creative: AdCreativePayload = { id: `inmobi_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`, networkId: this.networkId, networkName: this.networkName, title: 'NordVPN — Secure Your Data with Next-Gen Encryption', description: 'Ultra-fast VPN protection across all your desktop and mobile devices.', ctaText: 'Get 70% Off', clickUrl: 'https://nordvpn.com?utm_source=inmobi', sponsorTag: 'InMobi Exchange', advertiserName: 'Nord Security', bidEcpm: parseFloat(ecpm.toFixed(2)), format: request.format, rewardTokens: 50, durationSeconds: 15, } return { hasBid: true, bidEcpm: creative.bidEcpm, creative, latencyMs: Date.now() - startTime + 50, } } async reportImpression(adId: string): Promise {} async reportClick(adId: string): Promise {} async reportRewardCompletion(adId: string): Promise<{ success: boolean; tokenReward: number }> { return { success: true, tokenReward: 50 } } }