Skip to content

Respect --wallet and --private-key during payment request execution#40

Merged
stevekaliski-stripe merged 1 commit intostripe:mainfrom
pejmanjohn:codex/wallet-override-fix
Mar 11, 2026
Merged

Respect --wallet and --private-key during payment request execution#40
stevekaliski-stripe merged 1 commit intostripe:mainfrom
pejmanjohn:codex/wallet-override-fix

Conversation

@pejmanjohn
Copy link
Contributor

Summary

This fixes the request/payment path so CLI wallet overrides are actually used during x402 negotiation and dry-run/payment execution.

Before this change, purl would accept --wallet and --private-key, but the runtime request flow still only used the wallet configured in ~/.purl/config.toml. In practice that caused requests like these to fail with "No wallet configured" even when the user supplied a wallet on the command line:

  • purl --dry-run --private-key ... <url>
  • purl --dry-run --wallet /path/to/keystore.json <url>

What changed

  • apply --wallet and --private-key to the runtime Config before request execution
  • add runtime-only EVM signer/address helpers in the config layer
  • route EVM dry-run/address lookup through those shared helpers
  • add regression coverage for:
    • --dry-run --private-key with no preconfigured wallet
    • --dry-run --wallet <path> with no preconfigured wallet

Root cause

The CLI parsed wallet override flags, but cli/src/main.rs never merged them into the config used by the request/payment flow. As a result, the negotiator still saw no available payment method unless a wallet was already configured on disk.

Verification

cargo test -q --test runtime_wallet_override_tests
cargo fmt
cargo test -q

Notes

This is intentionally narrow:

  • no protocol behavior changes
  • no request retry changes
  • no changes to wallet file format

It only makes the existing CLI wallet override flags work in the main request path as advertised.

@cla-assistant
Copy link

cla-assistant bot commented Mar 9, 2026

CLA assistant check
All committers have signed the CLA.

@stevekaliski-stripe stevekaliski-stripe merged commit d5140c5 into stripe:main Mar 11, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants