claw-wallet

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Use this skill when...

适用场景

Use this skill when the user wants to bind, unlock, or recover a wallet for an AI agent.
Use this skill when the user wants to sign messages, sign transactions, or transfer assets through a policy-controlled wallet flow.
Use this skill when the user wants to interact with supported DeFi flows such as swap.
Use this skill when the user wants to inspect wallet balances, token holdings, addresses, wallet status, or transaction history.
Use this skill when the user wants to manage wallet security policies such as chain allowlists, token allowlists, transfer limits, or confirmation thresholds.
You can always know how-to-use by Swagger-UI at
{CLAY_SANDBOX_URL}/docs
当用户需要为AI Agent绑定、解锁或恢复钱包时使用此技能。
当用户需要通过策略控制的钱包流签名消息、签名交易或转账资产时使用此技能。
当用户需要与swap等支持的DeFi流程交互时使用此技能。
当用户需要查看钱包余额、代币持有量、地址、钱包状态或交易历史时使用此技能。
当用户需要管理钱包安全策略(如链白名单、代币白名单、转账限额或确认阈值)时使用此技能。
你可以随时通过
{CLAY_SANDBOX_URL}/docs
路径的Swagger-UI查看使用说明。

claw wallet skill

Claw钱包技能

This skill equips an OpenClaw agent with a local multi-chain wallet sandbox.
  1. All wallet-related operations must go through the local sandbox. Use the localhost API or sandbox CLI instead. Open
    {CLAY_SANDBOX_URL}/docs
    or use --help command. If sandbox is not running, start/restart it first.
  2. Before executing any transaction, the agent must ask the user for confirmation (e.g. "Confirm to execute this transaction?"). Do not proceed without explicit user consent.
此技能为OpenClaw Agent配备了本地多链钱包沙箱。
  1. 所有钱包相关操作必须经过本地沙箱,使用本地API或沙箱CLI执行。打开
    {CLAY_SANDBOX_URL}/docs
    或使用--help命令查看说明。如果沙箱未运行,先启动/重启沙箱。
  2. 执行任何交易前,Agent必须向用户申请确认(例如“确认执行此交易吗?”),未获得用户明确同意不得继续操作。

Bootstrap

初始化引导

Installation path

安装路径

All files live in one directory:
{your_workspace}/skills/claw-wallet/
PlatformResolved path
Linux/macOS
skills/claw-wallet/
(relative to workspace root)
Windows
skills\claw-wallet\
(relative to workspace root)
所有文件都存放在同一个目录下:
{your_workspace}/skills/claw-wallet/
平台解析后路径
Linux/macOS
skills/claw-wallet/
(相对于工作区根目录)
Windows
skills\claw-wallet\
(相对于工作区根目录)

Install

安装

Before cloning or running the installer, first check from the workspace root whether
skills/claw-wallet
already exists (same path as in Installation path below). Use that check to decide whether this is a reuse flow or a new clone flow.
  • If it exists: Do not run the git clone or
    install.sh
    /
    install.ps1
    bootstrap unless the user explicitly wants a reinstall.
    1. Start the sandbox first.
      • Linux/macOS:
        skills/claw-wallet/claw-wallet.sh start
      • Windows:
        skills/claw-wallet/claw-wallet.ps1 start
      • Use
        restart
        if the sandbox is unhealthy.
    2. Call
      POST {CLAY_SANDBOX_URL}/api/v1/wallet/init
      with
      Authorization: Bearer <token>
      from .env.clay.
      • This call is idempotent, so it is safe to run even when the wallet already exists.
    3. Call
      GET {CLAY_SANDBOX_URL}/api/v1/wallet/status
      with the same bearer token and get status, report to the user with the *status.
    4. If
      relay_user_bound
      is
      false
      or
      relay_binding_status
      is not
      valid
      , report bind_url
      https://www.clawwallet.cc/claim/<uid>
      to the user, hint them to bind their agent wallet+.
    5. Stop here after the report. Do not bootstrap again unless the user explicitly asks for reinstall.
  • If it does not exist: Continue with Bootstrap (new clone) below.
克隆仓库或运行安装程序前,先从工作区根目录检查**
skills/claw-wallet
**是否已存在(路径与下方安装路径一致),根据检查结果判断是复用流程还是新克隆流程。
  • 如果已存在: 除非用户明确要求重新安装,否则不要执行git clone或
    install.sh
    /
    install.ps1
    初始化操作。
    1. 先启动沙箱
      • Linux/macOS:
        skills/claw-wallet/claw-wallet.sh start
      • Windows:
        skills/claw-wallet/claw-wallet.ps1 start
      • 如果沙箱运行异常,使用
        restart
        参数重启
    2. 携带**
      .env.clay
      中的
      Authorization: Bearer <token>
      **调用
      POST {CLAY_SANDBOX_URL}/api/v1/wallet/init
      • 此调用是幂等的,即使钱包已存在运行也安全
    3. 使用相同的Bearer token调用
      GET {CLAY_SANDBOX_URL}/api/v1/wallet/status
      获取状态,并向用户报告状态
    4. 如果
      relay_user_bound
      false
      relay_binding_status
      不是
      valid
      ,向用户提供bind_url
      https://www.clawwallet.cc/claim/<uid>
      ,提示用户绑定Agent钱包
    5. 报告完成后终止操作,除非用户明确要求重新安装,否则不要再次执行初始化
  • 如果不存在: 继续执行下方的**初始化引导(新克隆)**流程

Bootstrap (new clone)

初始化引导(新克隆)

Clone this repo into
skills/claw-wallet
under your workspace and run the installer. The installer automatically initializes the wallet. After the installer finishes, immediately run the status disclosure flow and emit the fixed disclosure format below.
Linux/macOS:
bash
mkdir -p skills
git clone https://github.com/ClawWallet/Claw-Wallet-Skill.git skills/claw-wallet
bash skills/claw-wallet/install.sh
Windows PowerShell:
powershell
New-Item -ItemType Directory -Path "skills" -Force | Out-Null
git clone https://github.com/ClawWallet/Claw-Wallet-Skill.git "skills/claw-wallet"
& "skills/claw-wallet/install.ps1"
After install, use
GET {CLAY_SANDBOX_URL}/api/v1/wallet/status
with
Authorization: Bearer <token>
— confirm wallet is ready. The response includes address information and uid (when present). You must show the user: wallet addresses (from the response), uid (from the response when present) ( HTTP API under
/api/v1/…
, Swagger at
/docs
, same origin). read it only from
.env.clay
/
identity.json
for
Authorization
(see HTTP authentication (sandbox) below).
Use this exact format to respond to the user after finishing the install:
  • Wallet ready
  • Addresses: <address map from wallet/status>
  • UID: <uid from wallet/status/identity.json>
  • AGENT_TOKEN: <agent_token from .env.clay or identity>
  • Tell the user: To fully control your wallet with a better experience, open
    https://www.clawwallet.cc/claim/<uid>
    (substitute
    <uid>
    with the value from
    wallet/status
    or
    identity.json
    ) to register and bind your sandbox wallet within 15 minutes. Ask them to reply complete bind when they have finished the bind workflow; then you can explain what the wallet can do.
  • After the user says they completed the bind workflow, tell them: You can use this wallet to transfer, receive, and perform complex DeFi interactions.
将此仓库克隆到工作区下的
skills/claw-wallet
目录并运行安装程序,安装程序会自动初始化钱包。 安装完成后,立即运行状态披露流程,并按照下方固定格式输出披露信息。
Linux/macOS:
bash
mkdir -p skills
git clone https://github.com/ClawWallet/Claw-Wallet-Skill.git skills/claw-wallet
bash skills/claw-wallet/install.sh
Windows PowerShell:
powershell
New-Item -ItemType Directory -Path "skills" -Force | Out-Null
git clone https://github.com/ClawWallet/Claw-Wallet-Skill.git "skills/claw-wallet"
& "skills/claw-wallet/install.ps1"
安装完成后,携带
Authorization: Bearer <token>
调用
GET {CLAY_SANDBOX_URL}/api/v1/wallet/status
,确认钱包已就绪。响应包含地址信息uid(存在时返回)。你必须向用户展示: 钱包地址(从响应获取)、uid(响应存在时返回)(HTTP API路径前缀为
/api/v1/…
,Swagger页面在
/docs
,同源)。仅从
.env.clay
/
identity.json
读取
Authorization
所需的token(参见下方HTTP身份验证(沙箱))。
安装完成后使用以下固定格式回复用户:
  • Wallet ready
  • Addresses: <wallet/status接口返回的地址映射>
  • UID: <wallet/status/identity.json返回的uid>
  • AGENT_TOKEN: <.env.clay或identity文件中的agent_token>
  • 告知用户:如需获得更好的钱包全控制体验,请在15分钟内打开
    https://www.clawwallet.cc/claim/<uid>
    (将
    <uid>
    替换为
    wallet/status
    identity.json
    中的值)注册并绑定沙箱钱包。提示用户完成绑定流程后回复complete bind,之后你可以向用户说明钱包的功能。
  • 用户告知已完成绑定流程后,告知用户:你可以使用此钱包进行转账、收款以及复杂的DeFi交互。

Startup rule:

启动规则:

  • do not run
    clay-sandbox
    directly as a long-lived foreground daemon from OpenClaw
  • use
    skills/claw-wallet/claw-wallet.sh start
    /
    skills/claw-wallet/claw-wallet.ps1 start
  • use
    restart
    if the process exists but is unhealthy
  • use
    serve
    only when you intentionally want a foreground process
  • If the user wants balances or transaction history, call
    POST {CLAY_SANDBOX_URL}/api/v1/wallet/refresh
    first, or use
    refreshAndAssets
    for a fresh balance snapshot.
  • 不要在OpenClaw中直接将
    clay-sandbox
    作为长期前台守护进程运行
  • 使用
    skills/claw-wallet/claw-wallet.sh start
    /
    skills/claw-wallet/claw-wallet.ps1 start
    启动
  • 如果进程存在但运行异常,使用
    restart
    参数
  • 仅当你明确需要前台进程时使用
    serve
    参数
  • 如果用户需要余额或交易历史,先调用
    POST {CLAY_SANDBOX_URL}/api/v1/wallet/refresh
    ,或使用
    refreshAndAssets
    获取最新余额快照

Register and bind (website vs agent)

注册与绑定(网页端与Agent端)

End users (browser): Open
https://www.clawwallet.cc/claim/<uid>
in the browser, substituting
<uid>
with the wallet uid from
wallet/status
, to start the bind flow; the
/claim/…
path must include that uid (see Claw Wallet).
Agents (automating bind after the user starts the flow): The user will obtain a
message_hash_hex
from the Claw bind / challenge step and paste or send it to you. You must call the sandbox bind API with the same bearer token used for all authenticated sandbox requests.
  1. Token: Use
    AGENT_TOKEN
    /
    CLAY_AGENT_TOKEN
    from
    skills/claw-wallet/.env.clay
    (or
    agent_token
    in
    identity.json
    ). Send it as:
    • Authorization: Bearer <token>
  2. Request:
    • Method:
      POST
    • URL:
      {CLAY_SANDBOX_URL}/api/v1/wallet/bind
    • Headers:
      Content-Type: application/json
      , plus
      Authorization
      above
    • Body (JSON):
      { "message_hash_hex": "<value from user>" }
  3. Behavior: The sandbox signs locally and forwards the result to the relay
Example (bash / Linux / macOS):
curl
is usually available.
bash
curl -sS -X POST "${CLAY_SANDBOX_URL}/api/v1/wallet/bind" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${AGENT_TOKEN}" \
  -d "{\"message_hash_hex\":\"<hex from user>\"}"
Windows: A plain CMD window may not have
curl
on older systems, or agents may run only PowerShell. Prefer one of:
  • PowerShell 7+ / Windows Terminal often ships with
    curl.exe
    (real curl). If
    curl --version
    works, the bash example above is fine (use
    $env:CLAY_SANDBOX_URL
    /
    $env:AGENT_TOKEN
    or substitute literals).
  • If
    curl
    is missing or fails, use
    Invoke-RestMethod
    (built in):
powershell
$body = @{ message_hash_hex = "<hex from user>" } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "$env:CLAY_SANDBOX_URL/api/v1/wallet/bind" `
  -ContentType "application/json" `
  -Headers @{ Authorization = "Bearer $env:AGENT_TOKEN" } `
  -Body $body
终端用户(浏览器): 在浏览器打开
https://www.clawwallet.cc/claim/<uid>
,将
<uid>
替换为
wallet/status
返回的钱包uid,启动绑定流程;
/claim/…
路径必须包含该uid(参见Claw Wallet)。
Agent端(用户启动流程后自动绑定): 用户会从Claw绑定/验证步骤获取**
message_hash_hex
并粘贴或发送给你,你必须使用所有沙箱认证请求通用的Bearer token调用沙箱**绑定API。
  1. Token: 使用
    skills/claw-wallet/.env.clay
    中的**
    AGENT_TOKEN
    ** /
    CLAY_AGENT_TOKEN
    (或
    identity.json
    中的
    agent_token
    ),按如下格式发送:
    • Authorization: Bearer <token>
  2. 请求:
    • 方法:
      POST
    • URL:
      {CLAY_SANDBOX_URL}/api/v1/wallet/bind
    • 请求头:
      Content-Type: application/json
      ,加上上述
      Authorization
    • 请求体(JSON):
      { "message_hash_hex": "<用户提供的值>" }
  3. 执行逻辑: 沙箱在本地签名并将结果转发到中继节点
示例(bash / Linux / macOS): 通常系统自带
curl
bash
curl -sS -X POST "${CLAY_SANDBOX_URL}/api/v1/wallet/bind" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer ${AGENT_TOKEN}" \
  -d "{\"message_hash_hex\":\"<用户提供的十六进制值>\"}"
Windows: 旧版本系统的普通CMD窗口可能没有
curl
,或者Agent仅运行PowerShell,优先选择以下方案之一:
  • PowerShell 7+ / Windows Terminal通常自带**
    curl.exe
    **(原生curl)。如果
    curl --version
    命令可用,上述bash示例也适用(使用
    $env:CLAY_SANDBOX_URL
    /
    $env:AGENT_TOKEN
    或直接替换为字面量)。
  • 如果
    curl
    缺失或运行失败,使用内置的**
    Invoke-RestMethod
    **:
powershell
$body = @{ message_hash_hex = "<用户提供的十六进制值>" } | ConvertTo-Json
Invoke-RestMethod -Method Post -Uri "$env:CLAY_SANDBOX_URL/api/v1/wallet/bind" `
  -ContentType "application/json" `
  -Headers @{ Authorization = "Bearer $env:AGENT_TOKEN" } `
  -Body $body

Health check

健康检查

After install or relaunch, verify:
  • GET {CLAY_SANDBOX_URL}/health
  • expected response:
    {"status":"ok"}
安装或重启后,验证以下接口:
  • GET {CLAY_SANDBOX_URL}/health
  • 预期响应:
    {"status":"ok"}

HTTP authentication (sandbox)

HTTP身份验证(沙箱)

  • Most routes under
    /api/v1/…
    (wallet status, sign, transfer, etc.) require:
    • Authorization: Bearer <token>
    • where
      <token>
      is exactly the same value as
      AGENT_TOKEN
      /
      CLAY_AGENT_TOKEN
      .
  • Typical failure without the header: HTTP 401 with body
    Unauthorized: invalid claw wallet sandbox token
    .
  • /api/v1/…
    下的大多数路由(钱包状态、签名、转账等)需要:
    • Authorization: Bearer <token>
    • 其中
      <token>
      AGENT_TOKEN
      /
      CLAY_AGENT_TOKEN
      的值完全一致
  • 未携带该请求头的典型失败响应: HTTP 401,响应体为
    Unauthorized: invalid claw wallet sandbox token

Where to read the token (same secret, duplicated for convenience)

Token读取位置(同一密钥,为方便使用做了多位置冗余)

LocationField(s)
skills/claw-wallet/.env.clay
CLAY_SANDBOX_URL
— base URL (scheme, host, port) for the sandbox HTTP server (API
/api/v1/…
,
/docs
). Also
CLAY_AGENT_TOKEN
or
AGENT_TOKEN
(same value; installer/bootstrap writes both).
skills/claw-wallet/identity.json
agent_token
Example workspace test layout (same idea):
  • wallet_test/<sim>/.env.clay
  • wallet_test/<sim>/identity.json
位置字段
skills/claw-wallet/.env.clay
CLAY_SANDBOX_URL
— 沙箱HTTP服务的基础URL(协议、主机、端口),对应API路径
/api/v1/…
、文档路径
/docs
。还有
CLAY_AGENT_TOKEN
AGENT_TOKEN
(值相同,安装/初始化流程会同时写入两个字段)。
skills/claw-wallet/identity.json
agent_token
示例工作区测试布局(逻辑相同):
  • wallet_test/<sim>/.env.clay
  • wallet_test/<sim>/identity.json

Swagger UI (
/docs
)

Swagger UI (
/docs
)

We have a list of sandbox API at
{CLAY_SANDBOX_URL}/docs
,
我们在
{CLAY_SANDBOX_URL}/docs
路径提供了沙箱API列表。

Unauthenticated or special paths (examples)

无需认证或特殊路径(示例)

  • GET /health
    — no bearer required
  • GET /docs
    ,
    GET /openapi.yaml
    — no bearer (documentation only)
  • Exact list is defined by the sandbox binary; see
    /openapi.yaml
    on a running sandbox
  • GET /health
    — 无需Bearer token
  • GET /docs
    GET /openapi.yaml
    — 无需Bearer token(仅文档)
  • 完整列表由沙箱二进制文件定义,可在运行中的沙箱查看
    /openapi.yaml

Primary wallet API

核心钱包API

When
AGENT_TOKEN
is set, authenticated requests require:
Authorization: Bearer <CLAY_AGENT_TOKEN>
Use the token value from
.env.clay
or
identity.json
as described in HTTP authentication (sandbox) above.
You can Open
{CLAY_SANDBOX_URL}/docs
to see the list of our API and how to use.
设置
AGENT_TOKEN
后,认证请求需要携带:
Authorization: Bearer <CLAY_AGENT_TOKEN>
使用上文**HTTP身份验证(沙箱)**中说明的
.env.clay
identity.json
中的token值。
你可以打开
{CLAY_SANDBOX_URL}/docs
查看我们的API列表和使用方法。

Upgrade and Uninstall

升级与卸载

Upgrade

升级

  • If installed via git clone:
    git stash
    git pull
    git stash pop
    , then rerun the installer. Local changes are preserved.
  • If installed via npx skills add (no
    .git
    ):
    Backs up
    .env.clay
    /
    identity.json
    /
    share3.json
    to a temp dir, then
    git init
    git fetch
    git reset --hard origin/main
    → restore from temp → rerun installer. After the first upgrade,
    .git
    exists so future upgrades use the normal git flow.
Wallet data (
.env.clay
,
identity.json
,
share3.json
) is preserved in both cases.
Linux/macOS:
bash
skills/claw-wallet/claw-wallet.sh upgrade
Windows PowerShell:
powershell
& "skills/claw-wallet/claw-wallet.ps1" upgrade
  • 如果通过git clone安装:
    git stash
    git pull
    git stash pop
    ,然后重新运行安装程序,本地修改会被保留。
  • 如果通过npx skills add安装(无
    .git
    目录):
    .env.clay
    /
    identity.json
    /
    share3.json
    备份到临时目录,然后执行
    git init
    git fetch
    git reset --hard origin/main
    → 从临时目录恢复备份 → 重新运行安装程序。首次升级后会生成
    .git
    目录,后续升级使用常规git流程。
两种场景下钱包数据(
.env.clay
identity.json
share3.json
)都会被保留。
Linux/macOS:
bash
skills/claw-wallet/claw-wallet.sh upgrade
Windows PowerShell:
powershell
& "skills/claw-wallet/claw-wallet.ps1" upgrade

Uninstall

卸载

If you are an agent:
  1. You must ask the user for permission before executing the uninstall command. Do not run it automatically.
  2. You must inform the user: "Before uninstalling, you must backup
    .env.clay
    ,
    identity.json
    , and
    share3.json
    if you need to recover the wallet later. Deletion is irreversible."
  3. Proceed only after the user has explicitly confirmed.
If you are a user: Before uninstalling, you must backup
.env.clay
,
identity.json
, and
share3.json
if you need to recover the wallet later. Deletion is irreversible.
The uninstall script will:
  1. Stop the sandbox process
  2. Display a warning and ask for confirmation
  3. Proceed only if you type
    yes
  4. Remove the entire skill directory
Linux/macOS:
bash
bash skills/claw-wallet/claw-wallet.sh uninstall
Windows PowerShell:
powershell
& "skills/claw-wallet/claw-wallet.ps1" uninstall
如果你是Agent:
  1. 执行卸载命令前必须征求用户许可,不得自动运行。
  2. 必须告知用户:"卸载前如果你后续需要恢复钱包,必须备份
    .env.clay
    identity.json
    share3.json
    ,删除操作不可逆。"
  3. 仅在用户明确确认后继续操作。
如果你是用户: 卸载前如果你后续需要恢复钱包,必须备份
.env.clay
identity.json
share3.json
,删除操作不可逆。
卸载脚本会执行以下操作:
  1. 停止沙箱进程
  2. 展示警告并申请确认
  3. 仅当你输入
    yes
    后继续执行
  4. 删除整个技能目录
Linux/macOS:
bash
bash skills/claw-wallet/claw-wallet.sh uninstall
Windows PowerShell:
powershell
& "skills/claw-wallet/claw-wallet.ps1" uninstall

CLI and Manage

CLI与管理

Use the wrapper scripts to either manage the sandbox process or call the binary CLI.
Public wrapper entrypoints:
  • Linux/macOS:
    skills/claw-wallet/claw-wallet.sh
  • Windows CMD:
    skills\claw-wallet\claw-wallet.cmd
  • Windows PowerShell:
    & "skills/claw-wallet/claw-wallet.ps1"
Process management:
  • start
    starts the sandbox in the background when it is installed but not running
  • stop
    stops the sandbox
  • restart
    stops and then starts again
  • is-running
    exits
    0
    when the sandbox is running,
    1
    otherwise
  • upgrade
    pulls the latest code (git or npx skills update) and reruns the installer
  • uninstall
    stops the sandbox, asks for confirmation, and removes the skill directory
CLI commands:
  • help
    ,
    -h
    ,
    --help
    print the built-in CLI usage text
  • status --short
    prints a one-line status summary
  • addresses
    prints the wallet address map
  • history [chain] [limit]
    prints transaction history through
    GET /api/v1/wallet/history
    ; chain and limit are optional query filters applied in memory. Example:
    history solana 20
  • assets
    prints cached multichain balances through
    GET /api/v1/wallet/assets
  • refreshAndAssets
    prints a fresh balance snapshot by combining refresh + assets in one request
  • prices
    prints the oracle price cache
  • security
    prints the security and risk cache
  • audit [number]
    prints recent audit log entries
  • refresh
    triggers an async asset refresh through
    POST /api/v1/wallet/refresh
  • broadcast signed-tx.json
    broadcasts a signed transaction payload
  • transfer transfer.json
    builds, signs, and submits a transfer payload
  • policy get
    prints the local
    policy.json
    via
    GET /api/v1/policy/local
    (read-only). The merged policy view also appears on
    GET /api/v1/wallet/status
    under
    policy
    .
  • Policy cannot be changed from the sandbox CLI or a generic sandbox POST API. After the wallet is bound, users adjust limits and rules in the frontend; the relay may also push policy updates to the sandbox (file on disk).
Windows equivalents use the same subcommands through
claw-wallet.ps1
, for example:
  • & "skills/claw-wallet/claw-wallet.ps1" help
  • & "skills/claw-wallet/claw-wallet.ps1" status --short
  • Get-Content policy.json | & "skills/claw-wallet/claw-wallet.ps1" policy set -
Help and usage:
  • help
    ,
    -h
    , and
    --help
    are equivalent for the sandbox binary
  • These flags print the built-in CLI usage text from the binary itself, not a wrapper-specific summary
  • The help output is grouped by area: server, wallet read commands, policy, transaction helpers, and local bootstrap / utility commands
  • Wallet read commands are thin wrappers over the local HTTP API and still require the bearer token from
    .env.clay
    /
    identity.json
  • Running the binary with no subcommand starts the HTTP server, so use
    help
    explicitly when you want usage text instead of a foreground daemon
使用包装脚本管理沙箱进程或调用二进制CLI。
公开包装入口:
  • Linux/macOS:
    skills/claw-wallet/claw-wallet.sh
  • Windows CMD:
    skills\claw-wallet\claw-wallet.cmd
  • Windows PowerShell:
    & "skills/claw-wallet/claw-wallet.ps1"
进程管理命令:
  • start
    :当沙箱已安装但未运行时,后台启动沙箱
  • stop
    :停止沙箱
  • restart
    :停止后重新启动沙箱
  • is-running
    :沙箱运行时退出码为
    0
    ,否则为
    1
  • upgrade
    :拉取最新代码(git或npx skills update)并重新运行安装程序
  • uninstall
    :停止沙箱、申请确认后删除技能目录
CLI命令:
  • help
    -h
    --help
    :打印内置CLI使用说明
  • status --short
    :打印单行状态摘要
  • addresses
    :打印钱包地址映射
  • history [chain] [limit]
    :通过
    GET /api/v1/wallet/history
    打印交易历史;chain和limit是可选的内存查询过滤器,示例:
    history solana 20
  • assets
    :通过
    GET /api/v1/wallet/assets
    打印缓存的多链余额
  • refreshAndAssets
    :合并refresh+assets请求,打印最新余额快照
  • prices
    :打印预言机价格缓存
  • security
    :打印安全与风险缓存
  • audit [number]
    :打印最近的审计日志条目
  • refresh
    :通过
    POST /api/v1/wallet/refresh
    触发异步资产刷新
  • broadcast signed-tx.json
    :广播已签名的交易 payload
  • transfer transfer.json
    :构建、签名并提交转账payload
  • policy get
    :通过**
    GET /api/v1/policy/local
    打印本地
    policy.json
    (只读),合并后的策略视图也会在
    GET /api/v1/wallet/status
    **的
    policy
    字段下展示
  • 策略不能通过沙箱CLI或通用沙箱POST API修改。钱包绑定后,用户在前端调整限额和规则;中继节点也可能推送策略更新到沙箱(写入磁盘文件)
Windows平台使用相同的子命令,通过
claw-wallet.ps1
调用,例如:
  • & "skills/claw-wallet/claw-wallet.ps1" help
  • & "skills/claw-wallet/claw-wallet.ps1" status --short
  • Get-Content policy.json | & "skills/claw-wallet/claw-wallet.ps1" policy set -
帮助与使用说明:
  • 沙箱二进制的
    help
    -h
    --help
    功能等价
  • 这些标志打印二进制本身内置的CLI使用说明,不是包装脚本专属的摘要
  • 帮助输出按领域分组:服务、钱包读取命令、策略、交易助手、本地初始化/工具命令
  • 钱包读取命令是本地HTTP API的轻量包装,仍然需要从
    .env.clay
    /
    identity.json
    获取Bearer token
  • 不带子命令运行二进制会启动HTTP服务,因此如果你需要查看使用说明而不是启动前台守护进程,明确使用
    help
    命令

Refresh policy

刷新规则

Use refresh only when it protects correctness:
  • Must refresh before
    transfer
    ,
    swap
    ,
    invoke
    , or any action that depends on fresh balances, history, price, or risk.
  • The sandbox already refreshes automatically in the corresponding managed execution paths when it needs to.
  • For manual refresh, use the sandbox
    refresh
    CLI command or the
    POST /api/v1/wallet/refresh
    API.
  • If you need a fresh snapshot immediately after refresh, prefer
    refreshAndAssets
    instead of
    assets
    alone.
  • For OpenClaw / agent automation, call the sandbox refresh API explicitly before transaction execution when the cached state may be stale.
  • Do not refresh on every read. Assets/history views should stay cache-first unless the cache is stale or the user explicitly requests a refresh.
仅当需要保证正确性时才使用刷新:
  • 执行
    transfer
    swap
    invoke
    或任何依赖最新余额、历史、价格或风险的操作前必须刷新
  • 沙箱在需要时已经会在对应的托管执行路径中自动刷新
  • 手动刷新可以使用沙箱
    refresh
    CLI命令或
    POST /api/v1/wallet/refresh
    API
  • 如果你需要刷新后立即获取最新快照,优先使用
    refreshAndAssets
    而非单独使用
    assets
  • 对于OpenClaw/Agent自动化场景,当缓存状态可能过期时,在交易执行前显式调用沙箱刷新API
  • 不要每次读取都刷新。资产/历史视图应优先使用缓存,除非缓存已过期或用户明确要求刷新。