Repository navigation
Conversation
fnando
requested review from
leighmcculloch and
marcelosalloum
and
a balanced review from Copilot
November 4, 2026 19:56
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Unresolved critical flaws can authorize transfers beyond the spend cap, exhaust client memory, and corrupt downloaded binary resources.
7 open issues
Reject unexpected nested calls in payment authorization trees · New Bound server-provided decimals before formatting · New Preserve resource bytes in text-mode output · New Verify the RPC network before building checkout authorization · New Resolve authorization signer from the requested signing method · New Continue scanning network matches for a supported fee-sponsored option · New Add CLI integration tests for checkout authorization and replay · New
What changed in this PR
Adds stellar checkout <URL> to fetch x402-protected resources using existing Stellar identities and network configuration. Payments use authorization-signed SEP-41 transfers that a fee-sponsoring facilitator submits.
Changes:
- Adds challenge selection, spend-cap enforcement, payment-proof construction, and HTTP replay.
- Supports build-only proofs, JSON receipts, and payment failure diagnostics.
- Registers the command, documents its options, and adds unit tests.
| File | Description |
|---|---|
FULL_HELP_DOCS.md |
Documents checkout usage and options. |
cmd/soroban-cli/src/env_vars.rs |
Registers the checkout spend-cap environment variable. |
cmd/soroban-cli/src/commands/pay/payment.rs |
Builds payment proofs and diagnoses transfer failures. |
cmd/soroban-cli/src/commands/pay/mod.rs |
Coordinates checkout, proof output, and receipts. |
cmd/soroban-cli/src/commands/pay/http.rs |
Fetches resources and replays requests with payment proofs. |
cmd/soroban-cli/src/commands/pay/challenge.rs |
Parses challenges, selects payment options, and decodes settlements. |
cmd/soroban-cli/src/commands/pay/cap.rs |
Parses and enforces display-unit spending limits. |
cmd/soroban-cli/src/commands/mod.rs |
Registers and dispatches the checkout command. |
cmd/soroban-cli/src/commands/contract/invoke.rs |
Adds authorization-only transaction construction for payment proofs. |
cmd/soroban-cli/src/cli.rs |
Integrates checkout with structured JSON error output. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


What
Adds
stellar checkout <URL>, an x402 client. When the server responds with a 402, it builds and auth-signs a SEP-41transferand retries the request with the payment proof. The facilitator then submits it and pays the fees. Options:--max-amountsets a spend cap (default1),--build-onlyprints the proof without paying, and--output jsonreturns a receipt. Errors give the facilitator's reason, or name the account with a missing trustline or a low balance.Why
It lets Stellar users pay for x402-protected resources from the CLI with their existing identities and networks.
Known limitations
Only the
exactscheme with fee-sponsoring facilitators is supported, and muxed payers aren't. Tested end to end against stellar/x402-stellar on testnet, which needs@x402/*≥ 2.29.