@rozoai/checkout 0.1.16 → 0.1.18
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.
- package/README.md +51 -2
- package/llms.txt +5 -2
- package/package.json +1 -1
- package/scripts/dist/cli.js +655 -123
- package/scripts/dist/create-order.js +423 -217
- package/scripts/dist/quote.js +99 -33
- package/scripts/dist/receipt.js +149 -83
- package/scripts/dist/resume.js +1552 -0
- package/scripts/dist/send-evm.js +298 -232
- package/scripts/dist/send-sol.js +298 -232
- package/scripts/dist/status.js +168 -85
package/README.md
CHANGED
|
@@ -120,6 +120,22 @@ Distributing this CLI? `--utm-source <label>` (or `ROZO_CHECKOUT_UTM_SOURCE`) is
|
|
|
120
120
|
|
|
121
121
|
Want ROZO to be able to reach you if a payment needs attention? Add the optional `--email you@example.com` to `pay`.
|
|
122
122
|
|
|
123
|
+
### Privacy: anonymous install id
|
|
124
|
+
|
|
125
|
+
Every order this CLI creates carries two optional reporting fields in
|
|
126
|
+
`attribution`, so repeat orders from one install can be counted as one payer:
|
|
127
|
+
|
|
128
|
+
- `install_id`: a random UUID v4 made on first run and stored in
|
|
129
|
+
`~/.rozo-checkout/prefs.json` (mode 0600). It is not derived from your
|
|
130
|
+
machine, wallet or anything else about you.
|
|
131
|
+
- `account_hash`: sent only if `OPENROUTER_API_KEY` is set in your
|
|
132
|
+
environment. It is the lowercase hex sha256 of `"rozo-acct-v1:" + key`. The
|
|
133
|
+
key itself is never sent, logged or written to disk. An OpenRouter account id
|
|
134
|
+
is never used for this, because a hash of a short id could be guessed back.
|
|
135
|
+
|
|
136
|
+
Delete `~/.rozo-checkout/prefs.json` to get a new id (it also forgets your last
|
|
137
|
+
wallet and coin). Set `ROZO_CHECKOUT_ANON_ID=off` to send neither field.
|
|
138
|
+
|
|
123
139
|
Need help? Email hi@rozo.ai, or reach us on [X](https://x.com/ROZOai) or [Discord](https://discord.gg/EfWejgTbuU).
|
|
124
140
|
|
|
125
141
|
<details>
|
|
@@ -372,6 +388,14 @@ keypair or an encrypted keystore, and supports EVM chains and Solana only —
|
|
|
372
388
|
Stellar and Lightning are Mode A only.
|
|
373
389
|
</details>
|
|
374
390
|
|
|
391
|
+
## Bulk and automated use
|
|
392
|
+
|
|
393
|
+
Buying credits regularly, reselling them, or building an agent that tops up
|
|
394
|
+
OpenRouter for its users? The [Bulk Purchases and Agents](https://docs.rozo.ai/products/checkout/bulk-and-agents)
|
|
395
|
+
guide covers the CLI, the MCP server and the raw HTTP flow side by side, plus
|
|
396
|
+
fees, rate limits, idempotency, error codes and what each final status means.
|
|
397
|
+
The batch script below is the CLI half of it.
|
|
398
|
+
|
|
375
399
|
## Paying many invoices (batch / resellers)
|
|
376
400
|
|
|
377
401
|
Each OpenRouter top-up is its own Coinbase link, so paying many is a loop: one
|
|
@@ -402,7 +426,8 @@ done < links.txt
|
|
|
402
426
|
- `--yes` is required when stdin is not a terminal, `--json` prints exactly one
|
|
403
427
|
JSON object, and `--no-watch` returns as soon as the deposit details exist.
|
|
404
428
|
Without `--no-watch`, `pay --json` first waits for settlement (up to
|
|
405
|
-
`--timeout`, default 900 s
|
|
429
|
+
`--timeout`, default 900 s; for Lightning, the invoice's remaining validity,
|
|
430
|
+
at most 60 minutes) and prints nothing until then, invoice included.
|
|
406
431
|
- Without `--send` (the loop above), a successful `pay --no-watch` means the
|
|
407
432
|
order and its deposit details exist. **No money has moved yet**, which is
|
|
408
433
|
why the log says `pending`. With `--send`, the CLI may already have
|
|
@@ -441,6 +466,20 @@ flight or unknown, and 1 if the order expired unpaid or needs a human:
|
|
|
441
466
|
rozo-checkout receipt <rozoPaymentId> --json | jq '.receipt | .paymentOutcome, .merchantSettlement.status'
|
|
442
467
|
```
|
|
443
468
|
|
|
469
|
+
Closed the terminal before paying? `resume` picks the order back up without
|
|
470
|
+
creating a new one:
|
|
471
|
+
|
|
472
|
+
```bash
|
|
473
|
+
rozo-checkout resume <rozoPaymentId> # asks before showing the address
|
|
474
|
+
rozo-checkout resume <rozoPaymentId> --yes # non-interactive
|
|
475
|
+
```
|
|
476
|
+
|
|
477
|
+
If the order is still unpaid and has enough time left, it prints the hosted pay
|
|
478
|
+
page and (after you confirm) the exact deposit instructions again. A paid order
|
|
479
|
+
is reported as paid (exit 0); an expired one exits 1 and says how to start
|
|
480
|
+
over; it refuses if this machine already recorded a send. Nothing is created or
|
|
481
|
+
sent.
|
|
482
|
+
|
|
444
483
|
It reports your payment, the merchant invoice and service delivery as separate
|
|
445
484
|
layers. Delivery is always `unknown`: Rozo cannot see your OpenRouter credits.
|
|
446
485
|
|
|
@@ -481,7 +520,11 @@ a link again, run `status` on its `rozoPaymentId`:
|
|
|
481
520
|
- `RATE_LIMITED`: order creation is capped per IP per hour (currently 30
|
|
482
521
|
requests, and each `pay` makes two), so plan on about 15 links per hour from
|
|
483
522
|
one IP. Wait for the next hour and resume with the links not yet `settled`.
|
|
484
|
-
Need more? Email us.
|
|
523
|
+
Need more? Email us. The CLI retries a 429 by itself, up to 3 times, when
|
|
524
|
+
the server's `Retry-After` (or `retryAfterSeconds`) fits in 2 minutes of
|
|
525
|
+
total waiting. A longer wait fails at once: read
|
|
526
|
+
`error.details.retryAfterSeconds`, and `error.details.rateLimit` (limit,
|
|
527
|
+
remaining, tier, scope) when the server sends it.
|
|
485
528
|
|
|
486
529
|
Questions about a batch? Email hi@rozo.ai, or reach us on
|
|
487
530
|
[X](https://x.com/ROZOai) or [Discord](https://discord.gg/EfWejgTbuU).
|
|
@@ -514,6 +557,12 @@ The full list of what this refuses to do, and why, is in
|
|
|
514
557
|
|
|
515
558
|
## Changelog
|
|
516
559
|
|
|
560
|
+
- **0.1.17**: new `resume <rozoPaymentId>` command: re-shows the pay page and
|
|
561
|
+
deposit instructions for an unpaid order (read-only, same expiry, payability
|
|
562
|
+
and blacklist gates as `pay`), and answers clearly when it is already paid or
|
|
563
|
+
expired. Orders now carry an anonymous `attribution.install_id` and, when
|
|
564
|
+
`OPENROUTER_API_KEY` is set, a salted `attribution.account_hash`; see
|
|
565
|
+
Privacy. `ROZO_CHECKOUT_ANON_ID=off` sends neither.
|
|
517
566
|
- **0.1.16**: new `receipt` command: one read, exit 0 only when the merchant
|
|
518
567
|
side itself reports the invoice paid (Coinbase v3 `CAPTURE_SUCCEEDED`, v1 usage
|
|
519
568
|
count, or the Bitrefill payout), reported as three layers
|
package/llms.txt
CHANGED
|
@@ -86,7 +86,8 @@ override; larger invoices go through the keyless path.
|
|
|
86
86
|
|
|
87
87
|
Other flags: --yes (skip the interactive confirm; required when stdin is not a
|
|
88
88
|
TTY), --dry-run, --json (exactly one JSON object on stdout), --no-watch,
|
|
89
|
-
--timeout <s
|
|
89
|
+
--timeout <s> (default 900; Lightning: the invoice's remaining validity, max 60
|
|
90
|
+
min). Exit codes: 0 success, 1 refused/failed (read error.code),
|
|
90
91
|
2 usage, 3 submitted but unconfirmed.
|
|
91
92
|
|
|
92
93
|
`pay` withholds the full deposit address until you confirm, then prints it as a
|
|
@@ -176,7 +177,9 @@ private key (EVM and Solana only); every other path is keyless.
|
|
|
176
177
|
|
|
177
178
|
409 = link already used · 410 = link expired · UNSUPPORTED_SOURCE = the response's
|
|
178
179
|
"supported" object lists valid (chainId, tokenSymbol) pairs (Lightning is supported
|
|
179
|
-
but omitted from that list) · RATE_LIMITED = per-IP creation cap, retry later
|
|
180
|
+
but omitted from that list) · RATE_LIMITED = per-IP creation cap, retry later (the CLI itself retries a 429 up
|
|
181
|
+
to 3 times within 2 minutes of total waiting, per Retry-After; a longer wait
|
|
182
|
+
fails at once with error.details.retryAfterSeconds and rateLimit) ·
|
|
180
183
|
INVALID_EMAIL = the optional email is malformed; fix it or omit it.
|
|
181
184
|
|
|
182
185
|
## Support
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rozoai/checkout",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.18",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Pay OpenRouter, or any Coinbase invoice, with the crypto you already hold: USDT/USDC on Solana, BNB Chain, Ethereum or Polygon, USDC on Base or Stellar, or BTC over Lightning. No Coinbase account.",
|
|
6
6
|
"license": "MIT",
|