Weave
Weave is a CLI for crypto invoicing and cross-chain payment workflows. Use this when you need to create Bitcoin, Ethereum, Solana, USDC, or USDT invoices, generate payment quotes, and monitor settlement across supported networks such as Base, Tron, and Zcash for agent workflows or operations.
Overview
Use weave for full Weave Cash invoice lifecycle workflows:
- 1. Create an invoice (
weave create) - Generate payment instructions (
weave quote) - Track settlement (
weave status or weave status --watch)
Guardrails
- - Crypto-to-crypto only. Do not introduce fiat currencies, fiat conversions, or fiat-denominated behavior.
- Prefer machine-readable JSON output. Use
--human only when explicitly requested. - Never expose secrets (private keys, tokens, JWTs) in outputs.
- Treat network/API calls as failure-prone and handle non-zero exits explicitly.
When Not To Use
- - Do not use this skill for fiat invoice or fiat settlement workflows.
- Do not use this skill for editing Weave web UI/frontend code.
- Do not use this skill for unrelated wallet custody or private-key management tasks.
- Do not use this skill when the user wants non-Weave payment rails.
Preflight
- 1. Confirm CLI availability:
CODEBLOCK0
- 2. Discover runtime token/network support before choosing assets:
CODEBLOCK1
- 3. If
weave is missing, provide compliant install guidance and ask before running:
CODEBLOCK2
If Go is unavailable, use npm fallback:
CODEBLOCK3
If both Go and npm are unavailable, report the missing prerequisites.
Compliant Install Policy
- - Prefer
metadata.openclaw.install / metadata.clawdbot.install package-manager installs. - Never suggest remote download commands piped directly to a shell interpreter.
- Detect and instruct; do not auto-install dependencies without explicit user approval.
Token And Network Selection
- - Always trust live
weave tokens output from the runtime binary. - Do not hardcode token/network lists in reasoning.
- INLINECODE10 is required only for receive tokens that support multiple networks.
- Network aliases are accepted (for example
Ethereum|ETH, Solana|SOL, Tron|TRX when supported by runtime output).
Workflow
1) Create Invoice
Collect:
- - INLINECODE14
- INLINECODE15 (positive numeric string)
- INLINECODE16
- INLINECODE17 only when required by runtime token/network map
- optional buyer fields (
description, buyer-name, buyer-email, buyer-address)
Command:
CODEBLOCK4
Expected JSON shape:
CODEBLOCK5
Capture id for downstream quote/status calls.
2) Generate Quote
Collect:
- - INLINECODE25
- INLINECODE26
- INLINECODE27
- INLINECODE28
Command:
CODEBLOCK6
Expected fields:
- - INLINECODE29
- INLINECODE30 (optional)
- INLINECODE31
- INLINECODE32
- INLINECODE33
- INLINECODE34
3) Check Status
One-shot:
CODEBLOCK7
Watch mode:
CODEBLOCK8
Interpretation:
- - Exit
0: reached terminal status (COMPLETED, FAILED, REFUNDED, EXPIRED) - Exit
2: watch timeout (not a command failure) - Exit
1: command/API/network/validation failure
Error Handling
When exit code is 1, surface structured stderr JSON when present. Common API-derived shape:
CODEBLOCK9
If watch times out (exit 2), treat as incomplete progress, not fatal failure. Recommend extending --timeout-seconds or rerunning a one-shot weave status <invoice-id>.
Runtime Drift Rule
The installed binary and source tree can drift in token support. Always use runtime discovery (weave tokens) when deciding valid token/network combinations.
Weave
Weave 是一个用于加密发票和跨链支付工作流的命令行工具。当你需要创建比特币、以太坊、Solana、USDC 或 USDT 发票,生成支付报价,并监控 Base、Tron 和 Zcash 等支持网络上的结算时,请使用此工具,适用于代理工作流或运营操作。
概述
使用 weave 完成完整的 Weave Cash 发票生命周期工作流:
- 1. 创建发票(weave create)
- 生成支付说明(weave quote)
- 跟踪结算(weave status 或 weave status --watch)
使用限制
- - 仅限加密货币之间的操作。不要引入法定货币、法定货币兑换或法定货币计价行为。
- 优先使用机器可读的 JSON 输出。仅在明确要求时使用 --human 参数。
- 切勿在输出中暴露密钥(私钥、令牌、JWT)。
- 将网络/API 调用视为易失败操作,并显式处理非零退出码。
不适用场景
- - 请勿将此技能用于法定货币发票或法定货币结算工作流。
- 请勿将此技能用于编辑 Weave Web UI/前端代码。
- 请勿将此技能用于无关的钱包托管或私钥管理任务。
- 当用户需要非 Weave 支付通道时,请勿使用此技能。
前置检查
- 1. 确认 CLI 可用性:
bash
weave --help
- 2. 在选择资产前,先发现运行时令牌/网络支持:
bash
weave tokens
- 3. 如果 weave 缺失,提供合规的安装指南并在运行前询问:
bash
go install github.com/AryanJ-NYC/weave-cash/apps/cli/cmd/weave@latest
weave --help
如果 Go 不可用,使用 npm 备用方案:
bash
npm i -g weave-cash-cli
weave --help
如果 Go 和 npm 均不可用,报告缺少的先决条件。
合规安装策略
- - 优先使用 metadata.openclaw.install / metadata.clawdbot.install 包管理器安装。
- 切勿建议直接通过管道传输到 shell 解释器的远程下载命令。
- 检测并指导;未经用户明确批准,不要自动安装依赖项。
令牌和网络选择
- - 始终信任运行时二进制文件中的实时 weave tokens 输出。
- 不要在推理中硬编码令牌/网络列表。
- --receive-network 仅对支持多个网络的接收令牌是必需的。
- 接受网络别名(例如,当运行时输出支持时,Ethereum|ETH、Solana|SOL、Tron|TRX)。
工作流
1) 创建发票
收集:
- - receive-token
- amount(正数字字符串)
- wallet-address
- receive-network(仅当运行时令牌/网络映射要求时)
- 可选的买家字段(description、buyer-name、buyer-email、buyer-address)
命令:
bash
weave create \
--receive-token USDC \
--receive-network Ethereum \
--amount 25 \
--wallet-address 0x1111111111111111111111111111111111111111
预期 JSON 格式:
json
{
id: inv_123,
invoiceUrl: https://www.weavecash.com/invoice/inv_123
}
捕获 id 用于后续的 quote/status 调用。
2) 生成报价
收集:
- - invoice-id
- pay-token
- pay-network
- refund-address
命令:
bash
weave quote inv_123 \
--pay-token USDT \
--pay-network Ethereum \
--refund-address 0x2222222222222222222222222222222222222222
预期字段:
- - depositAddress
- depositMemo(可选)
- amountIn
- amountOut
- timeEstimate
- expiresAt
3) 检查状态
一次性查询:
bash
weave status inv_123
监控模式:
bash
weave status inv_123 --watch --interval-seconds 5 --timeout-seconds 900
解释:
- - 退出码 0:达到终止状态(COMPLETED、FAILED、REFUNDED、EXPIRED)
- 退出码 2:监控超时(非命令失败)
- 退出码 1:命令/API/网络/验证失败
错误处理
当退出码为 1 时,如果存在结构化的 stderr JSON,则显示它。常见的 API 派生格式:
json
{
error: api message,
status: 409,
details: {
error: Invoice is not in PENDING status
}
}
如果监控超时(退出码 2),将其视为未完成的进度,而非致命错误。建议延长 --timeout-seconds 或重新运行一次性 weave status 。
运行时漂移规则
已安装的二进制文件和源代码树在令牌支持方面可能发生漂移。在决定有效的令牌/网络组合时,始终使用运行时发现(weave tokens)。