Signet
Signet is an onchain advertising protocol on Base (Hunt Town Co-op). URLs compete for the spotlight slot, backed by HUNT tokens.
CLI Tool
Install and use the @signet-base/cli tool:
CODEBLOCK0
Commands
- - estimate — Get estimated USDC cost. Options:
--hours <0-24>, INLINECODE2 - list — List recent spotlight signatures. Options: INLINECODE3
- post — Place a URL on the spotlight via x402 payment. Options:
--url <url>, --hours <0-24>, --private-key <key>, INLINECODE7
The --simulate flag on post runs the full x402 flow (estimate, get 402 requirements, create payment) but stops before submitting. Use it to verify costs before committing.
API (Direct HTTP)
Base URL: INLINECODE10
Estimate Cost
CODEBLOCK1
Response:
CODEBLOCK2
INLINECODE11 (0-24): hours the spotlight is guaranteed. 0 = can be overtaken immediately.
List Signatures
CODEBLOCK3
Returns { signatures: [{ signatureIndex, url, huntAmount, viewCount, clickCount, metadata, timestamp, userWallet }] }.
Post Spotlight (x402)
CODEBLOCK4
The x402 payment flow:
- 1. Server returns 402 with
accepts array (USDC amount, payTo address, network) - Client signs a USDC payment (Permit2 on Base) using
@x402/core and INLINECODE15 - Client retries with payment header
- Server verifies via facilitator, executes onchain tx, settles payment
Signet
Signet 是基于 Base(Hunt Town Co-op)的链上广告协议。URL 通过 HUNT 代币支持,竞争聚光灯位置。
CLI 工具
安装并使用 @signet-base/cli 工具:
bash
估算聚光灯投放成本
npx @signet-base/cli estimate --hours 6
列出最近的签名
npx @signet-base/cli list --count 10
发布 URL(先模拟以检查成本)
npx @signet-base/cli post --url https://example.com --hours 6 --simulate
实际发布(需要 PRIVATE_KEY 环境变量或 --private-key 参数)
PRIVATE_KEY=0x... npx @signet-base/cli post --url https://example.com --hours 6
命令
- - estimate — 获取预估的 USDC 成本。选项:--hours <0-24>、--simulate
- list — 列出最近的聚光灯签名。选项:--count
- post — 通过 x402 支付将 URL 投放至聚光灯位置。选项:--url 、--hours <0-24>、--private-key 、--simulate
post 命令的 --simulate 标志会执行完整的 x402 流程(估算、获取 402 要求、创建支付),但在提交前停止。在正式提交前使用此标志验证成本。
API(直接 HTTP)
基础 URL:https://signet.sebayaki.com
估算成本
bash
curl https://signet.sebayaki.com/api/x402/estimate?guaranteeHours=0
响应:
json
{
guaranteeHours: 0,
estimatedUSDC: 12.28,
estimatedUSDCRaw: 12280000,
spotlightAvailable: true,
spotlightRemainingSeconds: 0
}
guaranteeHours(0-24):聚光灯保证展示的小时数。0 表示可立即被超越。
列出签名
bash
curl https://signet.sebayaki.com/api/signature/list?startIndex=0&endIndex=5
返回 { signatures: [{ signatureIndex, url, huntAmount, viewCount, clickCount, metadata, timestamp, userWallet }] }。
投放聚光灯(x402)
bash
步骤 1:不带支付进行 POST → 返回 402 及要求
curl -X POST https://signet.sebayaki.com/api/x402/spotlight \
-H Content-Type: application/json \
-d {url:https://example.com,guaranteeHours:0}
步骤 2:带支付头进行 POST → 返回 200
curl -X POST https://signet.sebayaki.com/api/x402/spotlight \
-H Content-Type: application/json \
-H X-402:
\
-d {url:https://example.com,guaranteeHours:0}
x402 支付流程:
- 1. 服务器返回 402,包含 accepts 数组(USDC 金额、收款地址、网络)
- 客户端使用 @x402/core 和 @x402/evm 签署 USDC 支付(基于 Base 的 Permit2)
- 客户端携带支付头重试
- 服务器通过协调器验证,执行链上交易,结算支付