okx-a2a-payment

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Onchain OS A2A Payment

Onchain OS A2A 支付

Wrap the
onchainos payment a2a-pay
CLI surface end-to-end for both seller and buyer roles. Buyer-side trust is delegated to the upstream caller — when invoked with a
paymentId
, the skill fetches the on-server challenge, TEE-signs it as-is, submits the credential, and auto-polls payment status to a terminal state.
为卖方和买方角色端到端封装
onchainos payment a2a-pay
CLI接口。买方侧的信任委托给上游调用方——当传入
paymentId
调用本技能时,它会获取服务器端的挑战内容,直接进行TEE签名,提交凭证,并自动轮询支付状态直至进入终态。

Skill Routing

技能路由

This skill only covers internal a2a payments issued via
onchainos payment a2a-pay
. If the request fits one of the intents below, route to the corresponding skill instead:
IntentUse skill
External HTTP 402 payment-gated resource (any non-onchainos URL)
okx-x402-payment
Wallet balance / transfer / login
okx-agentic-wallet
Task publish / accept / deliver / verify (business layer) — payment sub-step calls back into this skill via the Workflow A contractupstream task / agent skill (out of repo)
Internal
onchainos payment a2a-pay
payment link
this skill
本技能仅覆盖通过
onchainos payment a2a-pay
发起的内部a2a支付。如果请求符合以下任一意图,请路由至对应技能:
意图使用技能
外部HTTP 402支付 gated资源(任何非onchainos URL)
okx-x402-payment
钱包余额/转账/登录
okx-agentic-wallet
任务发布/接受/交付/验证(业务层)——支付子步骤通过Workflow A合约回调至本技能上游任务/Agent技能(不在本仓库内)
内部
onchainos payment a2a-pay
支付链接
本技能

Triggers

触发条件

Skill activates on user intents that match any of:
  • "create payment link", "create a2a payment", "generate payment", "create payment authorization"
  • "pay paymentId", "pay a2a_...", "pay this link", "settle this payment"
  • "payment status", "a2a payment status", "check payment status", "where is my payment"
当用户意图匹配以下任意内容时,技能激活:
  • "create payment link", "create a2a payment", "generate payment", "create payment authorization"
  • "pay paymentId", "pay a2a_...", "pay this link", "settle this payment"
  • "payment status", "a2a payment status", "check payment status", "where is my payment"

Pre-flight Checks

预检查

Both seller (
create
) and buyer (
pay
) require an authenticated wallet session. The CLI calls
ensure_tokens_refreshed
internally and bails on
not logged in
.
Before invoking
create
or
pay
:
bash
onchainos wallet status
  • Logged in → proceed.
  • Not logged in → ask the user to log in via
    onchainos wallet login
    (AK login, no email) or
    onchainos wallet login <email>
    (OTP login). Do NOT attempt to sign without a live session.
status
does not require additional pre-flight beyond what the CLI itself enforces.
卖方(
create
)和买方(
pay
)操作均需要已认证的钱包会话。CLI会在内部调用
ensure_tokens_refreshed
,若未登录则终止操作。
在调用
create
pay
之前:
bash
onchainos wallet status
  • 已登录 → 继续执行。
  • 未登录 → 提示用户通过
    onchainos wallet login
    (AK登录,无需邮箱)或
    onchainos wallet login <email>
    (OTP登录)进行登录。请勿在无有效会话的情况下尝试签名。
status
操作除CLI自身的限制外,无需额外预检查。

Operation Flow

操作流程

Seller — Create a Payment Link (
a2a-pay create
)

卖方——创建支付链接(
a2a-pay create

Inputs:
  • Required:
    --amount
    (decimal token amount, e.g.
    "0.01"
    ),
    --symbol
    (e.g.
    "USDT"
    ),
    --recipient
    (0x... EVM address — seller wallet)
  • Optional:
    --description
    ,
    --realm
    ,
    --expires-in
    (seconds, default 1800)
Steps:
  1. Run pre-flight (see above) — the CLI requires a live session.
  2. Shell out:
    bash
    onchainos payment a2a-pay create \
      --amount <amount> --symbol <symbol> --recipient <recipient> \
      [--description <text> --realm <domain> --expires-in <seconds>]
  3. Parse the response — only
    payment_id
    and
    deliveries.url
    (optional) are present. The CLI no longer returns
    amount
    /
    currency
    ; the skill echoes the seller's input args back for display.
  4. Display to the user:
    Payment link created. • paymentId:
    <id>
    • Amount:
    <amount input> <symbol input>
    (decimal as you submitted) • Recipient:
    <recipient input>
    • Share with buyer:
    <deliveries.url>
    (if returned by the server) or
    paymentId=<id>
  5. Suggest next: poll status anytime with
    onchainos payment a2a-pay status --payment-id <id>
    once the buyer is expected to have paid.
输入
  • 必填
    --amount
    (代币小数金额,例如
    "0.01"
    )、
    --symbol
    (例如
    "USDT"
    )、
    --recipient
    (0x...格式的EVM地址——卖方钱包)
  • 可选
    --description
    --realm
    --expires-in
    (秒数,默认1800)
步骤
  1. 执行预检查(见上文)——CLI需要有效会话。
  2. 执行Shell命令:
    bash
    onchainos payment a2a-pay create \
      --amount <amount> --symbol <symbol> --recipient <recipient> \
      [--description <text> --realm <domain> --expires-in <seconds>]
  3. 解析响应——仅返回
    payment_id
    和可选的
    deliveries.url
    。CLI不再返回
    amount
    /
    currency
    ;技能会回显卖方输入的参数用于展示。
  4. 向用户展示:
    支付链接已创建。 • paymentId:
    <id>
    • 金额:
    <amount input> <symbol input>
    (与您提交的小数格式一致) • 收款方:
    <recipient input>
    • 分享给买方:
    <deliveries.url>
    (若服务器返回)或
    paymentId=<id>
  5. 后续建议:当预计买方已完成支付后,可随时通过
    onchainos payment a2a-pay status --payment-id <id>
    查询状态。

Buyer — Pay a Payment Link (
a2a-pay pay
)

买方——支付链接(
a2a-pay pay

Required input:
paymentId
only. The CLI fetches the seller-issued challenge from the server and signs whatever amount / currency / recipient the challenge declares.
Trust model: the buyer signs the seller's challenge as-is. Verifying that the challenge matches what the buyer agreed to pay is the upstream caller's responsibility: the user (or the upstream skill) MUST cross-check the seller's
paymentId
/
deliveries.url
against their out-of-band agreement (chat, task spec, prior negotiation) before calling this skill. Once the skill is invoked, it will sign the on-server challenge.
必填输入:仅
paymentId
。CLI会从服务器获取卖方发起的挑战内容,并对挑战中声明的金额/币种/收款方进行签名。
信任模型:买方直接对卖方的挑战内容进行签名。验证挑战内容是否与买方约定的支付内容一致是上游调用方的责任:用户(或上游技能)必须在调用本技能之前,将卖方提供的
paymentId
/
deliveries.url
与线下约定(聊天、任务说明、前期协商)进行交叉核对。一旦调用本技能,它将对服务器端的挑战内容进行签名。

Step 1 — Sign and Submit

步骤1——签名并提交

The skill does not run its own preview / yes-no gate; trust is delegated to the upstream caller (see the trust-model note above). Shell out directly:
bash
onchainos payment a2a-pay pay --payment-id <paymentId>
The CLI fetches the on-server challenge, TEE-signs the EIP-3009 authorization, and submits the credential. The successful response shape:
json
{
  "payment_id": "a2a_xxx",
  "status": "<status>",
  "tx_hash": "<hash or null>",
  "valid_after": 0,
  "valid_before": 1746000000,
  "signature": "0x..."
}
本技能不执行预览/确认环节;信任委托给上游调用方(见上述信任模型说明)。直接执行Shell命令:
bash
onchainos payment a2a-pay pay --payment-id <paymentId>
CLI会获取服务器端的挑战内容,对EIP-3009授权进行TEE签名,并提交凭证。成功响应格式如下:
json
{
  "payment_id": "a2a_xxx",
  "status": "<status>",
  "tx_hash": "<hash or null>",
  "valid_after": 0,
  "valid_before": 1746000000,
  "signature": "0x..."
}

Step 2 — Auto-poll Status to Terminal

步骤2——自动轮询状态至终态

Status classification:
  • Non-terminal (poll):
    pending
    ,
    settling
  • Terminal (stop):
    completed
    ,
    failed
    ,
    expired
    ,
    cancelled
If
status
is already terminal → render the result (see table below) and stop.
If non-terminal → poll every 3 seconds, up to a 60-second total budget:
bash
onchainos payment a2a-pay status --payment-id <paymentId>
  • As soon as a terminal status is observed → render full result (status + tx_hash + block_number) and stop.
  • If 60 seconds elapse and the status is still non-terminal → return the current
    status
    plus the paymentId, and tell the user: "Status is still
    <status>
    after 60s; you can run
    status
    again later."
Terminal display strings:
statusDisplay
completed
"✅ Payment confirmed on-chain. tx_hash:
<tx_hash>
block:
<block_number>
"
failed
"❌ Payment failed. (include the server-provided reason if any)"
expired
"⌛ Payment link expired before settlement. Ask the seller for a new one."
cancelled
"🚫 Seller cancelled this payment."
状态分类:
  • 非终态(需轮询):
    pending
    settling
  • 终态(停止轮询):
    completed
    failed
    expired
    cancelled
如果
status
已为终态→展示结果(见下表)并停止。
如果为非终态→每3秒轮询一次,总时长不超过60秒
bash
onchainos payment a2a-pay status --payment-id <paymentId>
  • 一旦观测到终态→展示完整结果(状态+tx_hash+block_number)并停止。
  • 若60秒后仍为非终态→返回当前
    status
    及paymentId,并告知用户:“60秒后状态仍为
    <status>
    ;您可稍后再次运行
    status
    查询。”
终态展示文案
状态展示内容
completed
"✅ 支付已上链确认。tx_hash:
<tx_hash>
区块:
<block_number>
"
failed
"❌ 支付失败。(若服务器提供原因则包含该原因)"
expired
"⌛ 支付链接在结算前已过期。请联系卖方获取新链接。"
cancelled
"🚫 卖方已取消该支付。"

Status — Query Payment State (
a2a-pay status
)

状态——查询支付状态(
a2a-pay status

Input:
paymentId
.
Steps:
  1. Run:
    bash
    onchainos payment a2a-pay status --payment-id <paymentId>
  2. Map the returned
    status
    to a human-readable line:
    statusMeaningDisplay
    pending
    Awaiting buyer signature"⏳ Awaiting buyer signature."
    settling
    Credential received, settling on-chain"🔄 Settling on-chain (credential submitted, awaiting confirmation)."
    completed
    Confirmed on-chain"✅ Confirmed on-chain. tx_hash:
    <tx_hash>
    block:
    <block_number>
    fee:
    <fee_decimal> <fee_symbol>
    "
    failed
    Payment failed"❌ Failed. (include the server-provided reason if any)"
    expired
    Expired before settlement"⌛ Expired before settlement."
    cancelled
    Seller cancelled"🚫 Cancelled by seller."
  3. Rendering the fee. The CLI returns
    fee_amount
    as a top-level string in minimal units (and
    fee_bps
    as the basis-points used). To compute
    <fee_decimal>
    , look up the token decimals in the table under "Amount Display Rules". For
    <fee_symbol>
    , reuse the
    --symbol
    the seller passed to
    create
    for the same
    paymentId
    — the upstream caller (or the seller flow that issued the link) is the source of truth for the token symbol; the
    status
    response itself does not echo it back. If neither is available, display
    fee_amount
    minimal units as-is.
  4. Suggest next:
    • pending
      /
      settling
      → "Check again in a few moments" or wait briefly and re-run
      status
      .
    • completed
      → recommend
      okx-agentic-wallet
      to verify the buyer's post-payment balance delta.
    • failed
      → recommend checking buyer balance via
      okx-agentic-wallet
      , and if
      tx_hash
      is present, inspect it via
      okx-security tx-scan
      .
输入
paymentId
步骤
  1. 执行命令:
    bash
    onchainos payment a2a-pay status --payment-id <paymentId>
  2. 将返回的
    status
    映射为易读文案:
    状态含义展示内容
    pending
    等待买方签名"⏳ 等待买方签名。"
    settling
    已收到凭证,正在链上结算"🔄 正在链上结算(凭证已提交,等待确认)。"
    completed
    已上链确认"✅ 已上链确认。tx_hash:
    <tx_hash>
    区块:
    <block_number>
    手续费:
    <fee_decimal> <fee_symbol>
    "
    failed
    支付失败"❌ 支付失败。(若服务器提供原因则包含该原因)"
    expired
    结算前已过期"⌛ 结算前已过期。"
    cancelled
    卖方已取消"🚫 卖方已取消。"
  3. 手续费展示。CLI返回的
    fee_amount
    为顶层字符串,以最小单位表示(
    fee_bps
    为使用的基点)。计算
    <fee_decimal>
    时,请参考“金额展示规则”表格中的代币小数位数。
    <fee_symbol>
    复用卖方创建该
    paymentId
    时传入的
    --symbol
    ——上游调用方(或发起链接的卖方流程)是代币符号的可信来源;
    status
    响应本身不会回显该符号。若无法获取,则直接展示
    fee_amount
    的最小单位。
  4. 后续建议:
    • pending
      /
      settling
      → "请稍后再次查询"或短暂等待后重新运行
      status
    • completed
      → 推荐使用
      okx-agentic-wallet
      验证买方支付后的余额变化。
    • failed
      → 推荐通过
      okx-agentic-wallet
      检查买方余额;若存在
      tx_hash
      ,可通过
      okx-security tx-scan
      查看详情。

Cross-Skill Workflows

跨技能工作流

Workflow A — Sub-skill called from an upstream agent flow (most common)

工作流A——被上游Agent流程调用的子技能(最常见)

Applicable upstream callers: any agent-to-agent task / chat / agent flow that holds the seller-issued payment information.
Contract — upstream MUST hand off
paymentId
(skill stops and asks the user if missing). Upstream is also responsible for confirming, before invoking this skill, that the
paymentId
matches the buyer's agreed terms — once invoked, the skill signs whatever the on-server challenge declares.
1. <upstream caller>     verifies paymentId matches the buyer's agreed terms → hands off paymentId
2. okx-a2a-payment (this skill)  onchainos payment a2a-pay pay → auto-poll status → display terminal state
3. okx-agentic-wallet    optional: onchainos wallet balance to see post-payment delta
适用上游调用方:任何持有卖方支付信息的Agent-to-Agent任务/聊天/Agent流程。
约定——上游必须传递
paymentId
(若缺失,技能将停止并询问用户)。上游还需在调用本技能之前确认
paymentId
与买方约定的条款一致——一旦调用,技能将对服务器端的挑战内容进行签名。
1. <上游调用方>     验证paymentId与买方约定条款一致 → 传递paymentId
2. okx-a2a-payment(本技能)  执行onchainos payment a2a-pay pay → 自动轮询状态 → 展示终态
3. okx-agentic-wallet    可选:执行onchainos wallet balance查看支付后的余额变化

Workflow B — Seller manually creates a payment link

工作流B——卖方手动创建支付链接

1. okx-a2a-payment create   → paymentId + deliveries.url
2. Seller shares paymentId (and optionally deliveries.url) with the buyer out-of-band (chat / QR / message)
3. Buyer cross-checks the paymentId / deliveries.url against the seller's quoted terms, then runs Workflow A starting from step 2 with the received paymentId
1. okx-a2a-payment create   → 返回paymentId + deliveries.url
2. 卖方向买方线下分享paymentId(可选deliveries.url)(聊天/QR码/消息)
3. 买方核对paymentId/deliveries.url与卖方报价一致后,从工作流A的步骤2开始,使用收到的paymentId执行操作

Workflow C — Payment failure triage

工作流C——支付失败排查

1. okx-a2a-payment status                 → expired / failed / cancelled
2. Branch on terminal state:
   - expired   → ask seller to create a new link
   - failed    → check buyer balance via okx-agentic-wallet; inspect tx_hash via okx-security tx-scan if present
   - cancelled → contact seller out-of-band
1. okx-a2a-payment status                 → 返回expired/failed/cancelled
2. 根据终态分支处理:
   - expired   → 请卖方创建新链接
   - failed    → 通过okx-agentic-wallet检查买方余额;若存在tx_hash,通过okx-security tx-scan查看详情
   - cancelled → 线下联系卖方

Upstream Routing — Avoiding
create
Loops

上游路由——避免
create
循环

This skill is stateless per call and has no view of the conversation. If the upstream seller agent routes by surface keywords alone (e.g. matches
付款
/
pay
/
payment
and always calls
create
), it will loop:
buyer: "I want to pay"        → seller create → returns paymentId_A
buyer pays via this skill, then sends:
buyer: "payment successful"   → seller matches "payment" → create AGAIN → paymentId_B (wrong)
The skill cannot break this loop — the fix lives in the upstream caller's intent router. When you wire this skill into a seller-side agent, enforce the following before calling
create
:
  1. Detect existing paymentId in the incoming message. If the buyer's message contains an
    a2a_...
    id (or a
    deliveries.url
    you previously issued), route to
    okx-a2a-payment status
    for that id. Do NOT call
    create
    .
  2. Disambiguate intent beyond keywords. Map upstream intents to commands:
    Buyer saysIntentRoute to
    "I want to pay" / "请付款" / "怎么付" / "give me a link"request-invoice
    create
    "paid" / "payment successful" / "已付" / "已转账" / contains a paymentId or tx hashpayment-receipt
    status
    (or no-op if already terminal)
    "cancel" / "refund"cancel/refundout of scope for this skill
    Plain keyword matching on
    付款
    /
    pay
    /
    payment
    is not enough — both request-invoice and payment-receipt utterances contain those tokens.
  3. Track per-conversation order state upstream. Once
    create
    issues a paymentId for a given (buyer, order) context, the upstream agent must remember that paymentId in its own conversation / order state and mark the order as "awaiting payment". Subsequent buyer messages in that context default to
    status
    against the remembered paymentId until either the payment reaches a terminal state or the user explicitly asks for a new order.
  4. Idempotency on
    create
    .
    Before issuing a new
    create
    , the upstream agent must check its own state: if a non-terminal paymentId already exists for the same buyer / order context, reuse it instead of creating a new one.
This guidance is advisory for upstream agent authors — this skill itself will still execute whichever command you call. Routing correctness is the upstream caller's job.
本技能每次调用都是无状态的,无法查看对话上下文。如果上游卖方Agent仅通过表面关键词路由(例如匹配
付款
/
pay
/
payment
就调用
create
),会出现循环:
买方: "I want to pay"        → 卖方调用create → 返回paymentId_A
买方通过本技能完成支付后发送:
买方: "payment successful"   → 卖方匹配到"payment" → 再次调用create → 返回paymentId_B(错误)
本技能无法打破该循环——修复需在调用方的意图路由中实现。将本技能接入卖方Agent时,调用
create
前需执行以下检查:
  1. 检测消息中是否存在已有的paymentId。如果买方消息包含
    a2a_...
    格式的ID(或您之前发送的
    deliveries.url
    ),路由至
    okx-a2a-payment status
    查询该ID的状态。请勿调用
    create
  2. 除关键词外,明确区分意图。将上游意图映射至命令:
    买方表述意图路由至
    "I want to pay" / "请付款" / "怎么付" / "give me a link"请求账单
    create
    "paid" / "payment successful" / "已付" / "已转账" / 包含paymentId或交易哈希支付回执
    status
    (若已为终态则无需操作)
    "cancel" / "refund"取消/退款超出本技能范围
    仅匹配
    付款
    /
    pay
    /
    payment
    等关键词是不够的——请求账单和支付回执的表述中都可能包含这些词汇。
  3. 在上下游跟踪对话订单状态。一旦
    create
    为特定(买方,订单)上下文生成paymentId,上游Agent必须在自身对话/订单状态中记录该paymentId,并将订单标记为“等待支付”。该上下文后续的买方消息默认使用记录的paymentId查询
    status
    ,直到支付进入终态或用户明确要求新订单。
  4. create
    操作的幂等性
    。在发起新的
    create
    之前,上游Agent需检查自身状态:如果同一买方/订单上下文已存在非终态的paymentId,应复用该ID而非创建新的。
以上是对上游Agent开发者的建议——本技能仍会执行您调用的任何命令。路由正确性由上游调用方负责。

Amount Display Rules

金额展示规则

When converting
amount
(or
fee_amount
) from minimal units to a decimal display, use the hardcoded decimals table:
TokenDecimals"1000000" minimal renders as
USDC61.00 USDC
USDT61.00 USDT
USDG61.00 USDG
ETH18(
1e18
minimal = 1.00 ETH)
For any symbol not in the table: render
<minimal> <symbol>
and append the warning
unknown decimals — please double-check the seller-provided amount
. Do not block the flow.
amount
(或
fee_amount
)从最小单位转换为小数展示时,请使用以下硬编码的小数位数表:
代币小数位数"1000000"最小单位展示为
USDC61.00 USDC
USDT61.00 USDT
USDG61.00 USDG
ETH18(
1e18
最小单位 = 1.00 ETH)
对于表格中未列出的代币:展示
<minimal> <symbol>
并附加提示
未知小数位数——请仔细核对卖方提供的金额
请勿阻塞流程

Edge Cases

边缘场景

ScenarioHandling
onchainos wallet status
reports not logged in
Prompt the user to run
onchainos wallet login
. Never attempt to sign without a live session.
User provides no
paymentId
STOP and ask the user for the seller-issued paymentId.
CLI reports
payment ... not payable
/ expired challenge / unsupported intent
Relay the error verbatim and surface it as a terminal failure — do NOT retry signing.
paymentId
not found / 404 from server
Relay the error and ask the user to confirm the paymentId with the seller or upstream caller.
pay
succeeded but status is still
pending
/
settling
after the 60s poll budget
Return the current status (verbatim) + paymentId; tell the user
Status is still <status> after 60s; you can run status again later
.
Server returns a 5xxSurface the status code and any
errorMessage
verbatim. Do not auto-retry
pay
— every retry produces a fresh EIP-3009 nonce + signature; let the upstream caller decide whether to re-invoke.
status
is read-only and safe to retry manually.
--symbol
is not in the hardcoded decimals table
Apply the unknown-decimals fallback (see Amount Display Rules). Do not block.
--expires-in
was set too short and the link is now past its window
status
returns
expired
; ask the seller to create a new link.
场景处理方式
onchainos wallet status
显示未登录
提示用户执行
onchainos wallet login
。请勿在无有效会话的情况下尝试签名。
用户未提供
paymentId
停止操作并询问用户获取卖方提供的paymentId。
CLI返回
payment ... not payable
/过期挑战/不支持的意图
直接转发错误信息并标记为终态失败——请勿重试签名。
paymentId
未找到/服务器返回404
转发错误信息并请用户与卖方或上游调用方确认paymentId。
pay
成功但60秒轮询后状态仍为
pending
/
settling
返回当前状态(原样)+paymentId;告知用户
60秒后状态仍为<status>;您可稍后再次运行status查询
服务器返回5xx错误展示状态码及
errorMessage
(若有)。请勿自动重试
pay
——每次重试都会生成新的EIP-3009随机数+签名;由上游调用方决定是否重新调用。
status
为只读操作,可手动安全重试。
--symbol
不在硬编码小数位数表中
应用未知小数位数的 fallback(见金额展示规则)。请勿阻塞流程。
--expires-in
设置过短导致链接已过期
status
返回
expired
;请卖方创建新链接。

Command Index

命令索引

#CommandRolePurpose
1
onchainos payment a2a-pay create
SellerCreate a payment link, returns paymentId + deliveries
2
onchainos payment a2a-pay pay
BuyerFetch challenge → TEE-sign EIP-3009 → submit credential
3
onchainos payment a2a-pay status
EitherQuery current status (pending / settling / completed / failed / expired / cancelled)
#命令角色用途
1
onchainos payment a2a-pay create
卖方创建支付链接,返回paymentId + delivery信息
2
onchainos payment a2a-pay pay
买方获取挑战内容→TEE签名EIP-3009→提交凭证
3
onchainos payment a2a-pay status
任意角色查询当前状态(pending/settling/completed/failed/expired/cancelled)

CLI Command Reference

CLI命令参考

1.
onchainos payment a2a-pay create

1.
onchainos payment a2a-pay create

bash
onchainos payment a2a-pay create \
  --amount <decimal> --symbol <symbol> --recipient <address> \
  [--description <text>] [--realm <domain>] [--expires-in <seconds>]
ParamRequiredDefaultDescription
--amount
Yes-Decimal token amount (e.g.
"50"
or
"0.01"
)
--symbol
Yes-ERC-20 token symbol (e.g.
"USDT"
)
--recipient
Yes-Seller wallet address (= EIP-3009
to
)
--description
No-Human-readable description shown to the buyer
--realm
No-Seller / provider domain (e.g.
provider.example.com
)
--expires-in
No1800Payment-link expiration window in seconds
Return fields:
payment_id
,
deliveries
(object containing
url
when issued by the server).
bash
onchainos payment a2a-pay create \
  --amount <decimal> --symbol <symbol> --recipient <address> \
  [--description <text>] [--realm <domain>] [--expires-in <seconds>]
参数必填默认值描述
--amount
-代币小数金额(例如
"50"
"0.01"
--symbol
-ERC-20代币符号(例如
"USDT"
--recipient
-卖方钱包地址(=EIP-3009中的
to
--description
-展示给买方的可读描述
--realm
-卖方/服务商域名(例如
provider.example.com
--expires-in
1800支付链接过期时间窗口(秒)
返回字段
payment_id
deliveries
(包含服务器返回的
url
的对象)。

2.
onchainos payment a2a-pay pay

2.
onchainos payment a2a-pay pay

bash
onchainos payment a2a-pay pay --payment-id <id>
ParamRequiredDefaultDescription
--payment-id
Yes-Seller-issued paymentId
Return fields:
payment_id
,
status
,
tx_hash
(optional),
valid_after
,
valid_before
,
signature
.
bash
onchainos payment a2a-pay pay --payment-id <id>
参数必填默认值描述
--payment-id
-卖方提供的paymentId
返回字段
payment_id
status
tx_hash
(可选)、
valid_after
valid_before
signature

3.
onchainos payment a2a-pay status

3.
onchainos payment a2a-pay status

bash
onchainos payment a2a-pay status --payment-id <id>
ParamRequiredDefaultDescription
--payment-id
Yes-The paymentId to query
Return fields:
payment_id
,
status
,
tx_hash
(optional),
block_number
(optional),
block_timestamp
(optional),
fee_amount
(optional, minimal units),
fee_bps
(optional).
bash
onchainos payment a2a-pay status --payment-id <id>
参数必填默认值描述
--payment-id
-要查询的paymentId
返回字段
payment_id
status
tx_hash
(可选)、
block_number
(可选)、
block_timestamp
(可选)、
fee_amount
(可选,最小单位)、
fee_bps
(可选)。

Quickstart

快速开始

bash
undefined
bash
undefined

Seller — create a payment link

卖方——创建支付链接

onchainos payment a2a-pay create
--amount 0.01 --symbol USDT
--recipient 0xSellerWalletAddress
onchainos payment a2a-pay create
--amount 0.01 --symbol USDT
--recipient 0xSellerWalletAddress

→ { "payment_id": "a2a_xxx", "deliveries": { "url": "..." } }

→ { "payment_id": "a2a_xxx", "deliveries": { "url": "..." } }

Buyer — pay (signs the on-server challenge as-is; trust delegated to upstream)

买方——支付(直接对服务器端挑战内容签名;信任委托给上游)

onchainos payment a2a-pay pay --payment-id a2a_xxx
onchainos payment a2a-pay pay --payment-id a2a_xxx

Either side — query status (skill auto-polls this for ~60s after pay if non-terminal)

任意角色——查询状态(支付后若为非终态,技能会自动轮询约60秒)

onchainos payment a2a-pay status --payment-id a2a_xxx
undefined
onchainos payment a2a-pay status --payment-id a2a_xxx
undefined