feat(release): prepare 1.1.0 candidate
This commit is contained in:
parent
5a34f66981
commit
5205dcdfa9
736 changed files with 115667 additions and 12203 deletions
|
|
@ -1,61 +1,12 @@
|
|||
// apps/desktop/src/main/services/ads/PlaywireAdapter.ts
|
||||
// Playwire Desktop Application Programmatic Header Bidding Adapter
|
||||
import { UnavailableAdAdapter } from './UnavailableAdAdapter'
|
||||
|
||||
import type {
|
||||
AdNetworkId,
|
||||
AdFormat,
|
||||
AdMediationAuctionRequest,
|
||||
AdCreativePayload,
|
||||
} from '@d3ro/core/types'
|
||||
import type { IAdNetworkAdapter, AdBidResponse } from './BaseAdAdapter'
|
||||
|
||||
export class PlaywireAdapter implements IAdNetworkAdapter {
|
||||
readonly networkId: AdNetworkId = 'playwire'
|
||||
readonly networkName = 'Playwire RAMP (Desktop Header Bidding)'
|
||||
readonly supportedFormats: AdFormat[] = ['banner_dock', 'rewarded_video', 'export_sponsor']
|
||||
readonly defaultFloorEcpm = 4.5
|
||||
|
||||
async init(): Promise<void> {
|
||||
// Initialize Playwire RAMP desktop runtime
|
||||
}
|
||||
|
||||
async requestBid(request: AdMediationAuctionRequest): Promise<AdBidResponse> {
|
||||
const startTime = Date.now()
|
||||
if (!this.supportedFormats.includes(request.format)) {
|
||||
return { hasBid: false, bidEcpm: 0, latencyMs: 5 }
|
||||
}
|
||||
|
||||
// Playwire high-tier programmatic bidding: $4.50 - $11.00 eCPM
|
||||
const baseEcpm = request.format === 'rewarded_video' ? 8.5 : 4.8
|
||||
const ecpm = baseEcpm + Math.random() * 3.5
|
||||
|
||||
const creative: AdCreativePayload = {
|
||||
id: `playwire_${Date.now()}_${Math.random().toString(36).slice(2, 7)}`,
|
||||
networkId: this.networkId,
|
||||
networkName: this.networkName,
|
||||
title: 'AWS Cloud — Scalable AI & Machine Learning Infrastructure',
|
||||
description: 'Train models and deploy high-performance applications on AWS Bedrock.',
|
||||
ctaText: 'Start Free Trial',
|
||||
clickUrl: 'https://aws.amazon.com/free/?utm_source=playwire',
|
||||
sponsorTag: 'Playwire Programmatic',
|
||||
advertiserName: 'Amazon Web Services',
|
||||
bidEcpm: parseFloat(ecpm.toFixed(2)),
|
||||
format: request.format,
|
||||
rewardTokens: request.format === 'rewarded_video' ? 50 : undefined,
|
||||
durationSeconds: request.format === 'rewarded_video' ? 15 : undefined,
|
||||
}
|
||||
|
||||
return {
|
||||
hasBid: true,
|
||||
bidEcpm: creative.bidEcpm,
|
||||
creative,
|
||||
latencyMs: Date.now() - startTime + 68,
|
||||
}
|
||||
}
|
||||
|
||||
async reportImpression(adId: string): Promise<void> {}
|
||||
async reportClick(adId: string): Promise<void> {}
|
||||
async reportRewardCompletion(adId: string): Promise<{ success: boolean; tokenReward: number }> {
|
||||
return { success: true, tokenReward: 50 }
|
||||
export class PlaywireAdapter extends UnavailableAdAdapter {
|
||||
constructor() {
|
||||
super(
|
||||
'playwire',
|
||||
'Playwire RAMP',
|
||||
['banner_dock', 'rewarded_video', 'export_sponsor'],
|
||||
4.5,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue