frontpage-buy-ad

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

frontpage-buy-ad

frontpage-buy-ad

Use this skill when the user wants to buy an ad square on frontpage.sh — the perpetual auction with one large square (L), two medium (M1, M2), and five small (S1–S5). Every square is forever for sale.
Each buy is a one-shot flip: you pay the square's next price, the previous owner is refunded a multiple of what the slot was worth, and 80% of the remaining spread feeds the project pool (spent via the idea board — see
frontpage-vote
). Prices ratchet up per buy. The wallet that pays becomes the owner.
当用户想要在frontpage.sh上购买广告位时使用此技能——这是一个永久拍卖平台,包含1个大广告位(L)、2个中等广告位(M1、M2)和5个小广告位(S1–S5)。所有广告位始终处于可售卖状态。
每次购买都是一次性的所有权转移:你支付广告位的下一次定价,前所有者将获得该广告位价值数倍的退款,剩余差价的80%将注入项目池(可通过创意提案板使用——详见
frontpage-vote
)。每次购买后价格会逐步上涨,支付的钱包将成为新所有者。

Install

安装

bash
npx skills add DFectuoso/frontpage-sh-skills --copy                     # all frontpage skills
npx skills add DFectuoso/frontpage-sh-skills/frontpage-buy-ad --copy    # just this one
Testing against a dev box / Tempo testnet? Install the dev twin too:
npx skills add DFectuoso/frontpage-sh-skills-dev --copy
(gives you
frontpage-buy-ad-dev
, which overrides the base URL and network).
bash
npx skills add DFectuoso/frontpage-sh-skills --copy                     # 所有frontpage相关技能
npx skills add DFectuoso/frontpage-sh-skills/frontpage-buy-ad --copy    # 仅安装此技能
如果要在开发环境/Tempo测试网测试?也安装开发版:
npx skills add DFectuoso/frontpage-sh-skills-dev --copy
(会得到
frontpage-buy-ad-dev
,它会覆盖基础URL和网络配置)。

Pricing

定价

  • Base price: $0.01 (10,000 µUSDC)
  • Large (L): next price = current × 3.0 · previous owner refunded 1.5× current
  • Medium (M1, M2): × 2.0 · refund 1.3× current
  • Small (S1–S5): × 1.5 · refund 1.0× current (break-even)
  • Spread after refund splits 20% platform / 80% project pool
USDC on Tempo, 6 decimals; all API amounts are µUSDC integers. Don't reimplement the multipliers
GET /api/ads
returns
nextPriceMicros
per square, precomputed.
  • 基础价格:0.01美元(10,000 µUSDC)
  • 大广告位(L): 下一次购买价格 = 当前价格 × 3.0 · 前所有者将获得当前价格1.5倍的退款
  • 中等广告位(M1、M2): ×2.0 · 退款为当前价格的1.3倍
  • 小广告位(S1–S5): ×1.5 · 退款为当前价格的1.0倍(保本)
  • 退款后的差价分配为20%归平台 / 80%进入项目池
使用Tempo网络上的USDC,保留6位小数;所有API金额均为µUSDC整数。 请勿自行实现乘数逻辑 ——
GET /api/ads
接口会返回每个广告位预先计算好的
nextPriceMicros
值。

The flow (MPP — the only payment path)

流程(MPP —— 唯一支付路径)

Base URL:
https://frontpage.sh
· full machine-readable contract:
https://frontpage.sh/openapi.json
基础URL:
https://frontpage.sh
· 完整的机器可读契约:
https://frontpage.sh/openapi.json

1.
GET /api/ads
— squares, current prices, and what the next buy costs

1.
GET /api/ads
—— 获取广告位、当前价格及下一次购买成本

bash
curl https://frontpage.sh/api/ads
bash
curl https://frontpage.sh/api/ads

each ad includes: currentPrice, nextPriceMicros, tier, slot, ctaLabel/perk/promoCode, …

每个广告位信息包含:currentPrice、nextPriceMicros、tier、slot、ctaLabel/perk/promoCode等

undefined
undefined

2.
POST /api/preview
— mint a preview token ($0.10 MPP)

2.
POST /api/preview
—— 生成预览令牌(0.10美元MPP费用)

Locks your creative + the quoted price into a signed token (valid 10 minutes) and returns a shareable preview URL plus an exact
next
instruction for settling.
将你的创意内容+报价锁定到一个签名令牌中(有效期10分钟),并返回一个可分享的预览URL以及用于结算的精确
next
指令。

3.
POST /api/buy
— charges
nextPrice
exactly, flips the square

3.
POST /api/buy
—— 精确收取
nextPrice
,完成广告位所有权转移

ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({ methods: [tempo({ account: privateKeyToAccount('0x...') })] })

const res = await fetch('https://frontpage.sh/api/buy', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ previewToken: '<token from /api/preview>' }),
})
// { ok, transactionId, adId, slot, newOwnerWallet, newPrice, refundAmount, payment, payout, links }
MPP handles the 402 challenge automatically — the SDK signs the USDC transfer and retries with
Authorization: Payment …
.
  • 409 PRICE_CHANGED
    — the square flipped between preview and buy: re-mint the preview at the new price.
  • 409 SLOT_CONFLICT
    — you lost a concurrent race after paying: your charge is refunded automatically within ~1 minute.
ts
import { privateKeyToAccount } from 'viem/accounts'
import { Mppx, tempo } from 'mppx/client'

Mppx.create({ methods: [tempo({ account: privateKeyToAccount('0x...') })] })

const res = await fetch('https://frontpage.sh/api/buy', {
  method: 'POST',
  headers: { 'content-type': 'application/json' },
  body: JSON.stringify({ previewToken: '<token from /api/preview>' }),
})
// 返回结果示例:{ ok, transactionId, adId, slot, newOwnerWallet, newPrice, refundAmount, payment, payout, links }
MPP会自动处理402验证挑战——SDK会对USDC转账进行签名,并使用
Authorization: Payment …
头重试请求。
  • 409 PRICE_CHANGED
    —— 在预览和购买期间广告位已被他人购买:需重新生成新价格的预览令牌。
  • 409 SLOT_CONFLICT
    —— 支付后在并发竞争中失败:你的费用将在约1分钟内自动退款。

Payload shape (the preview body)

请求体格式(预览接口的请求体)

ts
{
  slot: "S1",            // L | M1 | M2 | S1..S5
  name: string,          // 1-64 chars
  tagline?: string,      // ≤140
  url: string,           // https://...
  monogram: string,      // 1-4 chars (e.g. "TS")
  logoColor: string,     // hex like "#0A0A09"
  logoBg: string,        // hex
  adBg: string,          // CSS background, e.g. "linear-gradient(135deg,#F1ED4A,#FFA850)"
  adHeadline: string,    // tier caps: large 48 / medium 56 / small 32 (use \n for line breaks; large renders BIG — keep it short)
  blurb?: string,        // ≤500
  ownerHandle: string,   // 1-30, single word, no spaces (e.g. "@fooofa") — your byline
  ownerEmail: string,    // REQUIRED — purchase receipt + "you've been outbid,
                         // refund wired" notice land here. Never public.

  // image: rendered as a COVER layer over adBg, at the square's true ratio.
  // ⚠ PNG or JPEG ONLY. webp, gif, svg and avif are REJECTED (HTTP 400
  //   IMAGE_UNSUPPORTED) — the server checks the actual bytes, not the
  //   filename/MIME, so re-encoding a webp as ".png" still fails. Convert to
  //   PNG or JPEG before sending. (Many models default to webp — do NOT.)
  image?: string,        // base64/data URL, PNG or JPEG only; max 1 MB per image
  imageUrl?: string,     // OR a public PNG/JPEG URL — we download & re-host it in
                         // our own store (no hot-linking). Must be publicly
                         // fetchable & ≤4 MB, else 400 (IMAGE_FETCH_FAILED /
                         // IMAGE_UNSUPPORTED). Prefer `image` if you have bytes.
  // recommended dimensions (2× display, true slot ratios):
  //   large 1712×944 (1.81:1) · medium 1136×464 (2.45:1) · small 560×464 (1.21:1)

  // richer creative (all optional; OMITTING THEM ON A BUY CLEARS THEM —
  // creatives never carry over from the previous owner):
  ctaLabel?: string,     // ≤24 — custom button text, e.g. "get the deal"
  perk?: string,         // ≤140 — offer line, shown prominently in the details view
  promoCode?: string,    // ≤24 — copyable code next to the perk
  xHandle?: string,      // optional X/Twitter handle (@handle, bare, or x.com URL)
                         // — @mentioned in the auto-tweet when the square flips
}
ts
{
  slot: "S1",            // 可选值:L | M1 | M2 | S1..S5
  name: string,          // 1-64个字符
  tagline?: string,      // 最多140个字符
  url: string,           // 格式为https://...
  monogram: string,      // 1-4个字符(例如:"TS")
  logoColor: string,     // 十六进制颜色值,如"#0A0A09"
  logoBg: string,        // 十六进制颜色值
  adBg: string,          // CSS背景样式,例如"linear-gradient(135deg,#F1ED4A,#FFA850)"
  adHeadline: string,    // 各层级字符限制:大广告位48 / 中等广告位56 / 小广告位32(使用\n换行;大广告位显示尺寸很大——请保持内容简短)
  blurb?: string,        // 最多500个字符
  ownerHandle: string,   // 1-30个字符,单个单词,无空格(例如"@fooofa")——你的署名
  ownerEmail: string,    // 必填项——购买收据以及"你已被出价更高者超越,退款已到账"的通知将发送至此邮箱。该信息绝不会公开。

  // image:作为覆盖层显示在adBg上方,匹配广告位的真实比例。
  // ⚠ 仅支持PNG或JPEG格式。webp、gif、svg和avif格式将被拒绝(HTTP 400
  //   IMAGE_UNSUPPORTED)——服务器会检查实际字节内容,而非文件名/MIME类型,因此将webp重命名为".png"仍然会失败。发送前请转换为
  //   PNG或JPEG格式。(许多模型默认输出webp——请勿使用)
  image?: string,        // base64/data URL格式,仅支持PNG或JPEG;单张图片最大1MB
  imageUrl?: string,     // 或公开的PNG/JPEG URL——我们会下载并重新托管到
                         // 自己的存储中(不支持热链接)。必须可公开访问且≤4MB,否则返回400错误(IMAGE_FETCH_FAILED /
                         // IMAGE_UNSUPPORTED)。如果已有图片字节数据,优先使用`image`字段。
  // 推荐尺寸(2倍显示分辨率,匹配广告位真实比例):
  //   大广告位1712×944(1.81:1)· 中等广告位1136×464(2.45:1)· 小广告位560×464(1.21:1)

  // 更丰富的创意内容(均为可选;购买时省略这些字段将清除原有内容——
  // 创意内容不会从上一所有者处继承):
  ctaLabel?: string,     // 最多24个字符——自定义按钮文本,例如"获取优惠"
  perk?: string,         // 最多140个字符——优惠说明,在详情视图中突出显示
  promoCode?: string,    // 最多24个字符——优惠说明旁的可复制代码
  xHandle?: string,      // 可选的X/Twitter账号(@handle、纯账号名或x.com URL)
                         // ——广告位所有权转移时,自动推文会@提及该账号
}

Heuristics for agents

面向Agent的启发式建议

  • Read
    nextPriceMicros
    from
    /api/ads
    — no tier math needed; it's exactly what
    /api/buy
    will charge.
  • Bring a perk. Squares with a perk + promo code give viewers a reason to click through — that's the conversion the slot is for.
  • Pass the brand's
    xHandle
    .
    Every buy auto-posts to @frontpagesh; with
    xHandle
    set, that post @mentions the brand (notifies them, invites a retweet — free reach).
  • Images must be PNG or JPEG — never webp. The server validates the actual bytes and returns
    400 IMAGE_UNSUPPORTED
    for webp/gif/svg/avif (and for a webp renamed
    .png
    ). If your source is webp, convert it to PNG or JPEG first.
  • Design for the real ratio. Your image cover-crops to the slot's shape (and tighter crops on mobile) — keep the message in the center.
  • Moderation runs server-side (OpenAI omni-moderation) over every text field AND the creative image. Sexual / hateful / harassing / violent / self-harm / illicit content →
    400 MODERATION_FAILED
    (charged, since moderation runs post-payment).
  • The flip is instant. The previous owner's refund settles inline or via the retry worker; read
    payout.status
    on the receipt.
  • /api/ads
    接口读取
    nextPriceMicros
    ——无需自行计算层级价格;该值即为
    /api/buy
    接口将收取的精确金额。
  • **提供优惠福利。**带有优惠福利+促销代码的广告位能给用户点击的理由——这正是广告位的转化目的。
  • **传入品牌的
    xHandle
    。**每次购买都会自动发布推文至@frontpagesh;设置
    xHandle
    后,推文会@提及该品牌(通知品牌方,邀请转发——免费获得曝光)。
  • **图片必须为PNG或JPEG格式——绝不能是webp。**服务器会验证实际字节内容,webp/gif/svg/avif格式(包括重命名为
    .png
    的webp)会返回
    400 IMAGE_UNSUPPORTED
    错误。如果你的源图片是webp格式,请先转换为PNG或JPEG。
  • **按照真实比例设计。**你的图片会按广告位形状进行封面裁剪(移动端裁剪更紧凑)——请将核心信息放在中间位置。
  • 服务器端会进行内容审核(OpenAI全量审核),覆盖所有文本字段和创意图片。包含色情/仇恨/骚扰/暴力/自残/非法内容的请求会返回
    400 MODERATION_FAILED
    错误(由于审核在支付后进行,费用仍会被收取)。
  • **所有权转移即时完成。**前所有者的退款会即时到账或通过重试处理完成;可在收据中查看
    payout.status
    字段了解状态。