@rozoai/checkout 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,255 @@
1
+ # rozo-checkout
2
+
3
+ [English](../README.md) | [简体中文](README.zh.md) | **日本語** | [Español](README.es.md)
4
+
5
+ **OpenRouter の Coinbase 決済リンク (Payment Link)** を、そのリンクが直接受け取れない
6
+ 通貨で支払います — Lightning 経由の BTC、または Solana、BNB Chain、Ethereum、
7
+ Polygon、Base、Stellar 上の USDT/USDC です。Coinbase の決済リンクは Base 上の USDC しか
8
+ 受け付けません。本ツールは、あなたが実際に保有している通貨をブリッジ経由で中継し、
9
+ 資金提供ウォレット (funder wallet) があなたに代わってインボイスを決済します。
10
+ アカウントも API キーもブラウザーも不要です。
11
+
12
+ ```bash
13
+ npx @rozoai/checkout pay <coinbase-link>
14
+ ```
15
+
16
+ どの通貨で支払うかを最初に尋ねます。プロンプトでウォレットアドレスを貼り付けると、
17
+ どの通貨なら残高が足りるかを表示します。そのあと、任意のウォレットから支払うための
18
+ 入金アドレスが表示されます — **秘密鍵も環境変数も設定も一切不要です**。あとは
19
+ インボイスが決済完了するまで待つだけです。
20
+
21
+ 使う通貨が決まっている場合は、この質問を省略できます:
22
+
23
+ ```bash
24
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
25
+ ```
26
+
27
+ ## 支払いに使える通貨
28
+
29
+ | チェーン | `--with` | チェーン id | 備考 |
30
+ |---|---|---|---|
31
+ | Ethereum | `usdt-ethereum` `usdc-ethereum` | `1` | 小数点以下 6 桁 |
32
+ | BNB Chain | `usdt-bnb` `usdc-bnb` | `56` | 小数点以下 18 桁 |
33
+ | Polygon | `usdt-polygon` `usdc-polygon` | `137` | 小数点以下 6 桁 |
34
+ | Base | `usdc-base` | `8453` | 小数点以下 6 桁 |
35
+ | Solana | `usdt-solana` `usdc-solana` | `900` | SPL。ネイティブの SOL は非対応 |
36
+ | Stellar | `usdc-stellar` | `1500` | メモが必須 — 入金ブロックに表示されます |
37
+ | Bitcoin Lightning | `btc-lightning` | `lightning` | BOLT11。金額は satoshi 単位 |
38
+
39
+ ネイティブのガス通貨(SOL、BNB、ETH、MATIC)およびオンチェーンの BTC は受け付けません。
40
+
41
+ ## エージェントから使う
42
+
43
+ 渡す内容はどこでも同じです。上のワンライナーそのものか、エージェントに
44
+ [llms.txt](../llms.txt) を読ませるかのどちらかです。**自分のウォレットから支払う場合、
45
+ 鍵は一切不要です。** ローカルで署名するのは任意の `--send` フラグだけで、
46
+ `ROZO_CHECKOUT_EVM_KEY` / `ROZO_CHECKOUT_SOL_KEY` を読むのもそのフラグだけです。
47
+ エージェントやスクリプトでは必ず `--with` を渡してください。対話式の選択は端末でのみ
48
+ 表示され、既定の通貨は意図的にありません。
49
+
50
+ <details>
51
+ <summary><b>Claude Code</b> — スキルをインストールするか、ワンライナーを貼り付ける</summary>
52
+
53
+ このリポジトリは Claude Code のスキルです。`SKILL.md` と `scripts/dist/` 内の実行可能
54
+ ファイルが同梱されています。スキルディレクトリにクローンすれば、Claude Code が自動的に
55
+ 認識します。
56
+
57
+ ```bash
58
+ git clone https://github.com/RozoAI/rozo-checkout-skill ~/.claude/skills/rozo-checkout
59
+ ```
60
+
61
+ インストールせずに、実行を依頼するだけでも構いません:
62
+
63
+ ```
64
+ この OpenRouter のリンクを Solana の USDT で支払ってください:
65
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
66
+ ```
67
+
68
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** Claude にホットウォレット
69
+ から署名させたい場合にだけ `--send` を追加してください。その場合は環境変数の鍵が必要です。
70
+ </details>
71
+
72
+ <details>
73
+ <summary><b>Codex CLI</b> — AGENTS.md に書くか、そのまま実行する</summary>
74
+
75
+ Codex はプロジェクトルートの `AGENTS.md` を読みます。毎回説明しなくても支払い方が
76
+ 分かるように、常設の指示を追加しておきましょう:
77
+
78
+ ```
79
+ OpenRouter / Coinbase の決済リンクを支払うには、次を実行してください:
80
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
81
+ ```
82
+
83
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** `--send` を使う場合だけ
84
+ 環境変数の鍵が必要です。
85
+ </details>
86
+
87
+ <details>
88
+ <summary><b>OpenCode</b> — AGENTS.md に書くか、そのまま実行する</summary>
89
+
90
+ OpenCode もプロジェクトルートの `AGENTS.md` を読むため、上の Codex 用のスニペットが
91
+ そのまま使えます。最短経路はやはりコマンドそのものです:
92
+
93
+ ```bash
94
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
95
+ ```
96
+
97
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** `--send` を使う場合だけ
98
+ 環境変数の鍵が必要です。
99
+ </details>
100
+
101
+ <details>
102
+ <summary><b>Cline</b> — .clinerules に書くか、そのまま実行する</summary>
103
+
104
+ Cline はプロジェクトルートの `.clinerules` から常設の指示を読み込みます:
105
+
106
+ ```
107
+ OpenRouter / Coinbase の決済リンクを支払うには、次を実行してください:
108
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
109
+ ```
110
+
111
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** `--send` を使う場合だけ
112
+ 環境変数の鍵が必要です。
113
+ </details>
114
+
115
+ <details>
116
+ <summary><b>Cursor</b> — .cursor/rules に書くか、そのまま実行する</summary>
117
+
118
+ `.cursor/rules/rozo-checkout.mdc` にプロジェクトルールを追加します:
119
+
120
+ ```
121
+ OpenRouter / Coinbase の決済リンクを支払うには、次を実行してください:
122
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
123
+ ```
124
+
125
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** `--send` を使う場合だけ
126
+ 環境変数の鍵が必要です。
127
+ </details>
128
+
129
+ <details>
130
+ <summary><b>Hermes Agent</b> — セッション内でワンライナーを実行する</summary>
131
+
132
+ Hermes Agent(Nous Research)はシェルにアクセスでき、独自のスキルシステムを持っています。
133
+ `hermes` で起動して、こう依頼してください:
134
+
135
+ ```
136
+ https://checkout.rozo.ai/llms.txt を取得したうえで、この OpenRouter のリンクを支払ってください:
137
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
138
+ ```
139
+
140
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** `--send` を使う場合だけ
141
+ 環境変数の鍵が必要です。
142
+ </details>
143
+
144
+ <details>
145
+ <summary><b>OpenClaw</b> — openclaw agent exec</summary>
146
+
147
+ OpenClaw のヘッドレス入口は単発のタスクを実行するため、スクリプトやチャットチャンネル
148
+ から起動する支払いに向いています:
149
+
150
+ ```bash
151
+ openclaw agent exec "Pay this OpenRouter link with USDT on Solana by running: npx @rozoai/checkout pay <coinbase-link> --with usdt-solana"
152
+ ```
153
+
154
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** `--send` を使う場合だけ
155
+ 環境変数の鍵が必要です。
156
+ </details>
157
+
158
+ <details>
159
+ <summary><b>Pi</b> — セッション内でワンライナーを実行する</summary>
160
+
161
+ Pi は BYOK のターミナルエージェントで、組み込みツールに `bash` を含むため、コマンドを
162
+ 直接実行できます。`pi` で起動して、こう依頼してください:
163
+
164
+ ```
165
+ この OpenRouter のリンクを Solana の USDT で支払ってください。次を実行します:
166
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
167
+ ```
168
+
169
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** `--send` を使う場合だけ
170
+ 環境変数の鍵が必要です。
171
+ </details>
172
+
173
+ <details>
174
+ <summary><b>ターミナル — エージェントなし</b> — スクリプトを 1 ステップずつ実行する</summary>
175
+
176
+ 各ステップを自分で進めます。バンドルは自己完結型なので、Node 18 以降のほかに
177
+ インストールするものはありません。
178
+
179
+ ```bash
180
+ git clone https://github.com/RozoAI/rozo-checkout-skill && cd rozo-checkout-skill
181
+ LINK="https://payments.coinbase.com/payment-links/pl_01YOURLINKID"
182
+
183
+ # 読み取り専用の見積もり。費用はかかりません
184
+ node scripts/dist/quote.js --url "$LINK"
185
+
186
+ # 注文を作成します。ここでは完全な入金アドレスは伏せられ、まず確認用の
187
+ # マスクされた要約が返ります。
188
+ node scripts/dist/create-order.js --url "$LINK" --chain 900 --token USDT
189
+
190
+ # 支払うと決めたら、--confirm を付けて再実行し、アドレスを開示します
191
+ node scripts/dist/create-order.js --url "$LINK" --chain 900 --token USDT --confirm
192
+
193
+ # 入金ブロックの内容を任意のウォレットから支払い、決済完了を見守ります
194
+ node scripts/dist/status.js --rozo-payment-id <uuid> --watch
195
+ ```
196
+
197
+ 各スクリプトは標準出力にちょうど 1 個の JSON オブジェクトを出力します。終了コードは
198
+ `0` が成功、`1` が拒否/失敗(`error.code` を参照)、`2` が使い方の誤り、`3` が送信済みだが
199
+ 未確認です。詳しい手順: [クイックスタート](QUICKSTART.ja.md)。
200
+
201
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** ホットウォレットからの送金
202
+ については、`ROZO_CHECKOUT_EVM_KEY` / `ROZO_CHECKOUT_SOL_KEY` を読む `send-evm.js` /
203
+ `send-sol.js` を参照してください。
204
+ </details>
205
+
206
+ <details>
207
+ <summary><b>その他のあらゆるエージェント</b> — llms.txt を読ませる</summary>
208
+
209
+ URL を取得してコマンドを実行できるエージェントであれば、どれでもこれができます:
210
+
211
+ ```
212
+ https://checkout.rozo.ai/llms.txt を自分のコンテキストに読み込み、それを使って
213
+ この OpenRouter のリンクを支払ってください: <coinbase-link>
214
+ ```
215
+
216
+ シェルを持たないエージェントでも、HTTP リクエストが可能なら 4 つの公開エンドポイントを
217
+ 直接操作できます — [仕組み](how-it-works.md) を参照してください。
218
+
219
+ ウォレット: どのウォレットでも構いません。**鍵は不要です。** `--send` を使う場合だけ
220
+ 環境変数の鍵が必要です。
221
+ </details>
222
+
223
+ ## 知っておく価値のある 3 つのルール
224
+
225
+ - **入金アドレスは使い捨てです。** 古い注文、キャッシュされたレスポンス、スクリーンショット
226
+ から得たアドレスを再利用しては決していけません。
227
+ - **表示された金額をそのとおりに送金してください。** 通常はインボイス金額より大きくなります
228
+ — ブリッジ手数料とネットワーク手数料が含まれるためです。
229
+ - **入金済みの注文に二重に支払っては決していけません。** すでに支払いが検知されている場合は
230
+ 中止し、人間に照合を依頼してください。使い捨てアドレスへの 2 回目の支払いは、入金として
231
+ 反映される保証がありません。
232
+
233
+ 本ツールが何を拒否するのか、そしてその理由の完全な一覧は
234
+ [safety.md](safety.md) にあります。
235
+
236
+ ## リンク
237
+
238
+ - [クイックスタート](QUICKSTART.ja.md) — 5 つのコマンドと、期待される出力
239
+ - [仕組み](how-it-works.md) — フロー、エンドポイント、識別子
240
+ - [安全性の設計](safety.md) — すべての安全機構の詳細
241
+ - [SKILL.md](../SKILL.md) — エージェント向けの指示書 · [llms.txt](../llms.txt) — 1 ファイルの要約
242
+ - [checkout.rozo.ai/agent](https://checkout.rozo.ai/agent.html) — 同じものを Web で
243
+ - [Issues](https://github.com/RozoAI/rozo-checkout-skill/issues) — バグと要望
244
+
245
+ ## 変更履歴
246
+
247
+ - **0.1.1** — 支出上限を 2 つから 1 つに変更しました。1 回の支払いは $1,100 を超えられず
248
+ ($1,000 のクレジット購入とその 5% の手数料に合わせた値です)、セッション累計の上限と
249
+ `--yes-large` による上書きは削除されました。自分のウォレットから支払う場合は鍵も設定も
250
+ 不要であることを、ドキュメントで明示しました。
251
+ - **0.1.0** — 最初のリリース: `npx @rozoai/checkout`。
252
+
253
+ ## ライセンス
254
+
255
+ MIT.
@@ -0,0 +1,233 @@
1
+ # rozo-checkout
2
+
3
+ [English](../README.md) | **简体中文** | [日本語](README.ja.md) | [Español](README.es.md)
4
+
5
+ 用一种 **OpenRouter Coinbase 收款链接 (Payment Link)** 本身收不了的币去付款 —— 走
6
+ 闪电网络的 BTC,或者 Solana、BNB Chain、Ethereum、Polygon、Base、Stellar 上的
7
+ USDT/USDC。Coinbase 收款链接只接受 Base 上的 USDC;本工具把你实际持有的币通过
8
+ 一座桥路由过去,再由一个出资钱包代你结清账单。无需账号、无需 API key、无需浏览器。
9
+
10
+ ```bash
11
+ npx @rozoai/checkout pay <coinbase-link>
12
+ ```
13
+
14
+ 它会先问你想用哪种币付款 —— 在提示处粘贴你的钱包地址,它就会标出哪些币你余额
15
+ 够付 —— 然后打印一个充值地址,你用任意钱包付进去即可 —— **不需要私钥、不需要
16
+ 环境变量、不需要任何配置**。之后它会一直等到账单被结清。
17
+
18
+ 已经知道要用哪种币?直接跳过这一问:
19
+
20
+ ```bash
21
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
22
+ ```
23
+
24
+ ## 可用于付款的币种
25
+
26
+ | 链 | `--with` | 链 id | 备注 |
27
+ |---|---|---|---|
28
+ | Ethereum | `usdt-ethereum` `usdc-ethereum` | `1` | 6 位小数 |
29
+ | BNB Chain | `usdt-bnb` `usdc-bnb` | `56` | 18 位小数 |
30
+ | Polygon | `usdt-polygon` `usdc-polygon` | `137` | 6 位小数 |
31
+ | Base | `usdc-base` | `8453` | 6 位小数 |
32
+ | Solana | `usdt-solana` `usdc-solana` | `900` | SPL;不支持原生 SOL |
33
+ | Stellar | `usdc-stellar` | `1500` | 必须带 memo —— 会在充值信息块里给出 |
34
+ | Bitcoin Lightning | `btc-lightning` | `lightning` | BOLT11;金额单位为聪 |
35
+
36
+ 原生 gas 币(SOL、BNB、ETH、MATIC)以及链上 BTC 均不接受。
37
+
38
+ ## 在你的 agent 里使用
39
+
40
+ 不管用哪个 agent,喂给它的东西都一样:上面那条命令,或者直接让它读
41
+ [llms.txt](../llms.txt)。**用你自己的钱包付款永远不需要私钥。** 只有可选的
42
+ `--send` 才会在本地签名,也只有它会读取 `ROZO_CHECKOUT_EVM_KEY` /
43
+ `ROZO_CHECKOUT_SOL_KEY`。
44
+
45
+ <details>
46
+ <summary><b>Claude Code</b> —— 安装 skill,或者直接粘贴那条命令</summary>
47
+
48
+ 本仓库本身就是一个 Claude Code skill:它自带 `SKILL.md` 和 `scripts/dist/` 里的
49
+ 可执行文件。把它克隆到你的 skills 目录,Claude Code 会自动识别。
50
+
51
+ ```bash
52
+ git clone https://github.com/RozoAI/rozo-checkout-skill ~/.claude/skills/rozo-checkout
53
+ ```
54
+
55
+ 或者跳过安装,直接让它执行:
56
+
57
+ ```
58
+ 用 Solana 上的 USDT 支付这个 OpenRouter 链接:
59
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
60
+ ```
61
+
62
+ 钱包:任意钱包,**无需私钥**。只有当你想让 Claude 用热钱包签名时才加 `--send`,
63
+ 那一步才需要环境变量里的私钥。
64
+ </details>
65
+
66
+ <details>
67
+ <summary><b>Codex CLI</b> —— 写进 AGENTS.md,或者直接跑</summary>
68
+
69
+ Codex 会读取项目根目录的 `AGENTS.md`。加一条常驻指令,它就不用每次都被告知怎么付:
70
+
71
+ ```
72
+ 要支付 OpenRouter / Coinbase 收款链接,执行:
73
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
74
+ ```
75
+
76
+ 钱包:任意钱包,**无需私钥**。`--send` 才需要环境变量里的私钥。
77
+ </details>
78
+
79
+ <details>
80
+ <summary><b>OpenCode</b> —— 写进 AGENTS.md,或者直接跑</summary>
81
+
82
+ OpenCode 同样读取项目根目录的 `AGENTS.md`,所以上面那段 Codex 的写法可以原样照搬。
83
+ 最短的路径依然是直接执行命令本身:
84
+
85
+ ```bash
86
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
87
+ ```
88
+
89
+ 钱包:任意钱包,**无需私钥**。`--send` 才需要环境变量里的私钥。
90
+ </details>
91
+
92
+ <details>
93
+ <summary><b>Cline</b> —— 写进 .clinerules,或者直接跑</summary>
94
+
95
+ Cline 从项目根目录的 `.clinerules` 读取常驻指令:
96
+
97
+ ```
98
+ 要支付 OpenRouter / Coinbase 收款链接,执行:
99
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
100
+ ```
101
+
102
+ 钱包:任意钱包,**无需私钥**。`--send` 才需要环境变量里的私钥。
103
+ </details>
104
+
105
+ <details>
106
+ <summary><b>Cursor</b> —— 写进 .cursor/rules,或者直接跑</summary>
107
+
108
+ 在 `.cursor/rules/rozo-checkout.mdc` 加一条项目规则:
109
+
110
+ ```
111
+ 要支付 OpenRouter / Coinbase 收款链接,执行:
112
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
113
+ ```
114
+
115
+ 钱包:任意钱包,**无需私钥**。`--send` 才需要环境变量里的私钥。
116
+ </details>
117
+
118
+ <details>
119
+ <summary><b>Hermes Agent</b> —— 在会话里跑那条命令</summary>
120
+
121
+ Hermes Agent(Nous Research)有 shell 权限,也有自己的 skill 体系。用 `hermes`
122
+ 启动后这样说:
123
+
124
+ ```
125
+ 先抓取 https://checkout.rozo.ai/llms.txt,然后支付这个 OpenRouter 链接:
126
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
127
+ ```
128
+
129
+ 钱包:任意钱包,**无需私钥**。`--send` 才需要环境变量里的私钥。
130
+ </details>
131
+
132
+ <details>
133
+ <summary><b>OpenClaw</b> —— openclaw agent exec</summary>
134
+
135
+ OpenClaw 的无头入口用来跑一次性任务,很适合从脚本或聊天渠道里触发一笔付款:
136
+
137
+ ```bash
138
+ openclaw agent exec "Pay this OpenRouter link with USDT on Solana by running: npx @rozoai/checkout pay <coinbase-link> --with usdt-solana"
139
+ ```
140
+
141
+ 钱包:任意钱包,**无需私钥**。`--send` 才需要环境变量里的私钥。
142
+ </details>
143
+
144
+ <details>
145
+ <summary><b>Pi</b> —— 在会话里跑那条命令</summary>
146
+
147
+ Pi 是一个 BYOK 终端 agent,内置工具里就有 `bash`,可以直接执行命令。用 `pi`
148
+ 启动后这样说:
149
+
150
+ ```
151
+ 用 Solana 上的 USDT 支付这个 OpenRouter 链接,执行:
152
+ npx @rozoai/checkout pay <coinbase-link> --with usdt-solana
153
+ ```
154
+
155
+ 钱包:任意钱包,**无需私钥**。`--send` 才需要环境变量里的私钥。
156
+ </details>
157
+
158
+ <details>
159
+ <summary><b>终端 —— 完全不用 agent</b> —— 一步步跑脚本</summary>
160
+
161
+ 每一步都自己来。打包产物是自包含的,除了 Node 18+ 之外不需要装任何东西。
162
+
163
+ ```bash
164
+ git clone https://github.com/RozoAI/rozo-checkout-skill && cd rozo-checkout-skill
165
+ LINK="https://payments.coinbase.com/payment-links/pl_01YOURLINKID"
166
+
167
+ # 只读报价,不产生任何费用
168
+ node scripts/dist/quote.js --url "$LINK"
169
+
170
+ # 创建订单。此阶段完整充值地址会被扣留:你先拿到一份打码后的摘要用于核对。
171
+ node scripts/dist/create-order.js --url "$LINK" --chain 900 --token USDT
172
+
173
+ # 决定付款之后,加 --confirm 重新执行同一条命令来释放它
174
+ node scripts/dist/create-order.js --url "$LINK" --chain 900 --token USDT --confirm
175
+
176
+ # 用任意钱包按充值信息块付款,然后观察它结清
177
+ node scripts/dist/status.js --rozo-payment-id <uuid> --watch
178
+ ```
179
+
180
+ 每个脚本在 stdout 上只打印一个 JSON 对象。退出码 `0` 表示成功,`1` 表示被拒绝/
181
+ 失败(读 `error.code`),`2` 表示用法错误,`3` 表示已提交但未确认。完整走一遍:
182
+ [QUICKSTART](QUICKSTART.zh.md)。
183
+
184
+ 钱包:任意钱包,**无需私钥**。热钱包发送见 `send-evm.js` / `send-sol.js`,它们读取
185
+ `ROZO_CHECKOUT_EVM_KEY` / `ROZO_CHECKOUT_SOL_KEY`。agent 和脚本必须显式传 `--with`:
186
+ 交互式选择只在终端里出现,而且刻意没有默认币种。
187
+ </details>
188
+
189
+ <details>
190
+ <summary><b>任何其他 agent</b> —— 让它去读 llms.txt</summary>
191
+
192
+ 只要一个 agent 能抓 URL、能执行命令,它就能干这件事:
193
+
194
+ ```
195
+ 把 https://checkout.rozo.ai/llms.txt 抓进你的上下文,然后照着它
196
+ 支付这个 OpenRouter 链接:<coinbase-link>
197
+ ```
198
+
199
+ 如果 agent 没有 shell 但能发 HTTP 请求,它可以直接调用那四个公开端点 —— 见
200
+ [工作原理](how-it-works.md)。
201
+
202
+ 钱包:任意钱包,**无需私钥**。`--send` 才需要环境变量里的私钥。
203
+ </details>
204
+
205
+ ## 三条必须知道的规则
206
+
207
+ - **充值地址是一次性的。** 绝不要复用旧订单、缓存响应或截图里的地址。
208
+ - **严格按显示的金额发送。** 它通常比账单金额大 —— 因为包含了跨桥费和网络费。
209
+ - **绝不要对已入账的订单二次付款。** 一旦检测到已有付款,就停下来找人工核对;
210
+ 再往一个一次性地址打第二笔钱,不保证能被记账。
211
+
212
+ 它拒绝去做哪些事、以及为什么,完整清单见
213
+ [docs/safety.md](safety.md)。
214
+
215
+ ## 相关链接
216
+
217
+ - [快速开始](QUICKSTART.zh.md) —— 五条命令,附预期输出
218
+ - [工作原理](how-it-works.md) —— 流程、端点、标识符
219
+ - [安全设计](safety.md) —— 每一道防线的细节
220
+ - [SKILL.md](../SKILL.md) —— 面向 agent 的指令 · [llms.txt](../llms.txt) —— 单文件摘要
221
+ - [checkout.rozo.ai/agent](https://checkout.rozo.ai/agent.html) —— 网页版,同样的东西
222
+ - [Issues](https://github.com/RozoAI/rozo-checkout-skill/issues) —— bug 与需求
223
+
224
+ ## 更新日志
225
+
226
+ - **0.1.1** —— 两条额度上限合并为一条:单笔付款不得超过 $1,100(按购买 $1,000
227
+ 额度加 5% 手续费来设定),单会话累计上限与 `--yes-large` 绕过开关均已移除。文档
228
+ 明确说明:用你自己的钱包付款不需要私钥,也不需要任何配置。
229
+ - **0.1.0** —— 首个版本:`npx @rozoai/checkout`。
230
+
231
+ ## 许可证
232
+
233
+ MIT。
@@ -0,0 +1,43 @@
1
+ # How it works
2
+
3
+ [← back to the README](../README.md) · [Quick start](QUICKSTART.md) · [Safety design](safety.md)
4
+
5
+ ```mermaid
6
+ flowchart TD
7
+ A["Coinbase Payment Link<br/>payments.coinbase.com/payment-links/pl_*"] --> B
8
+ B["quote-invoice<br/>(public POST)"] --> C["create-invoice<br/>(public POST)"]
9
+ C --> D["Bridge order<br/>one-time deposit address<br/>+ exact amount + expiry"]
10
+ D --> E["You send USDT/USDC/BTC<br/>on your chosen chain"]
11
+ E --> F["Bridge converts the pay-in"]
12
+ F --> G["Funder wallet settles<br/>the Coinbase invoice"]
13
+ G --> H["Merchant is paid<br/>(e.g. OpenRouter credit)"]
14
+ ```
15
+
16
+ The same thing as ASCII, for terminals without mermaid:
17
+
18
+ ```
19
+ Coinbase Payment Link (pl_* / paymentSession_*)
20
+ |
21
+ v
22
+ [ quote-invoice ] -> merchant, amount, expiry, short-lived quote receipt
23
+ |
24
+ v
25
+ [ create-invoice ] -> bridge order: rozoPaymentId + deposit address
26
+ | + exact amount + order expiry
27
+ v
28
+ you send USDT / USDC / BTC on your chain ------> deposit address
29
+ |
30
+ v
31
+ bridge converts the pay-in ------> funder wallet pays the Coinbase invoice
32
+ |
33
+ v
34
+ merchant credited; poll until the state is `settled`
35
+ ```
36
+
37
+ Three identifiers appear throughout and are never interchangeable:
38
+
39
+ | Identifier | What it is |
40
+ |---|---|
41
+ | `linkId` | the Coinbase id: `pl_*` (Payment Link) or `paymentSession_*` (v3 session) |
42
+ | `rozoPaymentId` | the bridge order's UUID — use this for deposit detail and status |
43
+ | `paymentLink` | a hosted pay page URL for the bridge order (human fallback) |
package/docs/safety.md ADDED
@@ -0,0 +1,74 @@
1
+ # Safety design
2
+
3
+ [← back to the README](../README.md) · [Quick start](QUICKSTART.md) · [How it works](how-it-works.md)
4
+
5
+ The interesting part of this project is what it refuses to do. The README keeps
6
+ the three rules a payer needs; everything below is the full list, for anyone
7
+ reviewing or extending the code.
8
+
9
+ - **Two-phase confirmation, enforced.** `create-order.js` withholds the full
10
+ deposit address, memo and BOLT11 until it is re-run with `--confirm`, which
11
+ records a confirmation bound to a sha256 of those exact instructions. The
12
+ send scripts refuse without both `--send` and a confirmation whose digest
13
+ still matches the live data, so neither an accidental invocation nor a
14
+ swapped deposit address can move funds.
15
+ - **Full invoice, always.** `callerPays` must equal the invoice amount and
16
+ `discount` must be `"0"`; anything else aborts with `NO_DISCOUNT_VIOLATION`.
17
+ Security-critical fields (`linkId`, `merchant`, `original`, `callerPays`, the
18
+ echoed source) must be present as well as equal — a missing field is drift.
19
+ - **Reuse guard.** Creating an order for a link that already has an unexpired
20
+ order returns that existing order — even if it has already been funded. So on
21
+ every run the live order is required to be unpaid (`payment_unpaid`, no tx
22
+ hash, no amount received, no confirmation) and to match the chain and token
23
+ the caller chose. Otherwise: `ORDER_ALREADY_FUNDED` or
24
+ `REUSED_SOURCE_MISMATCH`.
25
+ - **Money-detected rule, fail closed.** Once any pay-in exists, the tooling
26
+ never reports a plain failure, never advises paying again, and never retries
27
+ into a new order. An `amountReceived` that is non-null but unreadable counts
28
+ as money, not as absence of money. An unreadable backend reports `unknown`,
29
+ never `awaiting_deposit`.
30
+ - **Complete deposit instructions.** A zero, negative or unparsable amount
31
+ aborts. Lightning requires the BOLT11 (which arrives in `source.lnInvoice`
32
+ with an empty address). A Stellar deposit is a shared hub address plus a
33
+ per-order memo, so the memo is part of the destination: an order that
34
+ arrives without one is a hard abort, never rendered as "no memo required".
35
+ - **Expiry margins.** Payment is refused unless the earlier of the order expiry
36
+ and the Coinbase expiry is more than a per-chain margin away (10 min EVM and
37
+ Stellar, 5 min Solana). Lightning additionally requires at least 10 minutes
38
+ of BOLT11 validity. A missing or unparsable deadline aborts.
39
+ - **Payability revalidation.** A quote receipt makes order creation skip the
40
+ live Coinbase check, and the link can be consumed by someone else at any
41
+ moment — so payability is re-checked immediately before the deposit address
42
+ is shown, and again as the very last step before broadcast, after all the RPC
43
+ preparation. Incomplete Coinbase state is treated as "cannot prove payable",
44
+ not as payable.
45
+ - **Compromised-address list, fail closed.** `scripts/src/lib/blacklist.json`
46
+ carries a vendored list with a provenance header and a sha256 over the
47
+ addresses. The digest proves only that this vendored copy has not been edited
48
+ since its sync date; it is not a signature by the upstream source. Both the
49
+ deposit address and the sending wallet are checked. If the file is missing,
50
+ malformed, empty, or its digest does not match, every send is refused rather
51
+ than proceeding unchecked.
52
+ - **Send-once, across processes.** Order state lives in
53
+ `$HOME/.rozo-checkout/state/<uuid>.json`, written atomically (temp file,
54
+ fsync, rename). Every read-modify-write of a state file — the claim, the
55
+ spend caps, the order record and the confirmation — runs inside one exclusive
56
+ lockfile, so two concurrent invocations can neither both decide they are
57
+ first, nor overwrite each other's send record. A send is claimed *before* broadcasting, so an ambiguous RPC error can
58
+ never become a second transfer. Transactions are signed before broadcast so
59
+ the hash is known in advance; on an ambiguous result the scripts look that
60
+ exact transaction up instead of rebroadcasting.
61
+ - **Hot-wallet controls.** Keys come from the environment only
62
+ (`ROZO_CHECKOUT_EVM_KEY`, `ROZO_CHECKOUT_SOL_KEY`), are never printed and
63
+ never accepted on the command line; library and RPC errors are redacted
64
+ before display, including credential-bearing provider URLs, bearer tokens and
65
+ key-shaped strings. The scripts refuse to run when any `.env`/`.env.*` in the
66
+ working directory is git-tracked, and refuse just as hard when git cannot
67
+ prove it is untracked. The RPC's chain id (or Solana genesis hash) and the token's
68
+ on-chain decimals are verified before signing. One limit applies: a single
69
+ payment may not exceed $1,100. There is no override flag and no cumulative
70
+ session cap — a larger invoice is paid from your own wallet, which needs no
71
+ key and has no limit.
72
+ - **Address masking.** Prose shows `first6...last4`. The full deposit address,
73
+ memo and BOLT11 string appear only inside the machine-readable `deposit`
74
+ object, so they stay copy-pastable without being scattered through logs.
package/llms.txt CHANGED
@@ -8,7 +8,7 @@
8
8
  > deposit normally carries a small bridge/source-chain fee on top.
9
9
 
10
10
  This file teaches the whole flow to any agent or script. Repo (scripts, safety rails,
11
- full docs): https://github.com/RozoAI/rozo-checkout-skill — see QUICKSTART.md.
11
+ full docs): https://github.com/RozoAI/rozo-checkout-skill — see docs/QUICKSTART.md.
12
12
 
13
13
  ## Fastest path: the CLI (npm @rozoai/checkout)
14
14
 
@@ -21,11 +21,19 @@ calls with every safety rule already enforced:
21
21
 
22
22
  --with accepts usdt-solana, usdc-solana, usdt-bnb, usdc-bnb, usdt-ethereum,
23
23
  usdc-ethereum, usdt-polygon, usdc-polygon, usdc-base, usdc-stellar, btc-lightning
24
- (or raw: --chain 900 --token USDT). Flags: --send (pay from a hot wallet, keys from
25
- ROZO_CHECKOUT_EVM_KEY / ROZO_CHECKOUT_SOL_KEY, never from argv), --yes (skip the
26
- interactive confirm; required when stdin is not a TTY), --dry-run, --json (exactly
27
- one JSON object on stdout), --no-watch, --timeout <s>. Exit codes: 0 success,
28
- 1 refused/failed (read error.code), 2 usage, 3 submitted but unconfirmed.
24
+ (or raw: --chain 900 --token USDT).
25
+
26
+ DEFAULT PATH NEEDS NO KEY: `pay` prints a deposit address for the user to pay from
27
+ any wallet. No private key, no environment variable, no configuration. Only the
28
+ optional --send flag signs locally, and only that flag reads
29
+ ROZO_CHECKOUT_EVM_KEY / ROZO_CHECKOUT_SOL_KEY (from the environment, never argv).
30
+ With --send, one limit applies: a single payment may not exceed $1,100, with no
31
+ override; larger invoices go through the keyless path.
32
+
33
+ Other flags: --yes (skip the interactive confirm; required when stdin is not a
34
+ TTY), --dry-run, --json (exactly one JSON object on stdout), --no-watch,
35
+ --timeout <s>. Exit codes: 0 success, 1 refused/failed (read error.code),
36
+ 2 usage, 3 submitted but unconfirmed.
29
37
 
30
38
  `pay` withholds the full deposit address until you confirm, then prints it as a
31
39
  copy-pastable block. Creating an order moves no money; an unfunded order expires.
@@ -62,7 +70,9 @@ Native SOL/ETH/BNB are NOT supported — stablecoins (or Lightning BTC) only.
62
70
  -> { status, expiresAt, source:{ receiverAddress, receiverMemo, amount, amountUnit,
63
71
  lnInvoice, txHash, amountReceived, confirmedAt, ... }, destination:{...} }
64
72
  Pay EXACTLY source.amount of the requested token on the requested chain to
65
- source.receiverAddress (include receiverMemo when present — Stellar requires it).
73
+ source.receiverAddress, including every other field the block carries (Stellar
74
+ routes on a shared hub address plus source.receiverMemo, so omitting the memo
75
+ loses the payment).
66
76
  For Lightning, pay the BOLT11 in source.lnInvoice (receiverAddress is empty).
67
77
 
68
78
  4) Poll until settled: