跳到主要内容

常用示例

这些例子展示了用户可以如何与 AI Agent 对话,以及 UKey Wallet skills 在背后应该如何处理请求。

查看钱包状态

用户:

Show my wallet balance and receiving address.

预期流程:

ukey wallet auth status
ukey wallet get-address
ukey wallet balance --chain eth

好的回答形态:

Active wallet: 0x...
Ethereum balance: ...
Receiving address: 0x...
Next: I can show history, quote a swap, or prepare a transfer.

买入前先研究

用户:

What Solana tokens are trending, and is BONK worth a closer look?

预期流程:

ukey wallet token trending --chain sol
ukey wallet token search --query BONK --chain sol
ukey wallet token info --chain sol --token BONK

Agent 应先返回市场上下文和研究结果。除非用户在后续明确要求交易,否则不应直接进入 swap 流程。

报价、确认、执行

用户:

Swap 1 ETH to USDC, but show me the quote before execution.

预期流程:

ukey wallet balance --chain eth
ukey wallet swap quote --chain eth --from ETH --to USDC --amount 1
ukey wallet security audit --chain eth --token USDC
ukey wallet swap build --chain eth --from ETH --to USDC --amount 1

确认信息应至少包含:

字段示例
ActionSwap
RouteETH -> USDC on Ethereum
Amount1 ETH
Estimated output来自 quote 结果
Fees可用时来自 quote / build 结果
RiskAudit 或 simulation 状态
Next stepProceed? (yes/no)

只有在用户确认后才执行:

ukey wallet swap execute --chain eth --order <orderId>

使用 UKey Wallet 硬件钱包转账

用户:

Use my UKey Wallet hardware wallet to send 50 USDC to 0x...

预期流程:

ukey wallet device search
ukey wallet auth login --hardware
ukey wallet auth status
ukey wallet balance --chain eth --token USDC
ukey wallet transfer --to 0x... --amount 50 --token USDC --chain eth

转账确认里必须明确说明设备确认步骤。如果设备锁定、断开连接、要求 PIN / Passphrase,或用户拒绝请求,Agent 应停止并报告当前状态。

BTC Sign-Only PSBT

用户:

Swap 0.01 BTC to USDC using taproot and sign only.

预期流程:

ukey wallet address --chain btc --address-type taproot
ukey wallet swap quote --chain btc --from BTC --to USDC --amount 0.01
ukey wallet swap build --chain btc --from BTC --to USDC --amount 0.01
ukey wallet swap execute --chain btc --order <orderId> --from-address-type taproot --sign-only

最终返回结果应是 signed 或 preview-ready 的 PSBT,而不是已经广播出去的交易哈希。