Skip to content

feat(python): add extra.minDeposit hint for EVM batch-settlement - #22

Closed
PhilBot402 wants to merge 3 commits into
mainfrom
philbotpython-mindeposit-batch-settlement-cd97
Closed

PhilBot402 wants to merge 3 commits into
mainfrom
philbotpython-mindeposit-batch-settlement-cd97

Conversation

@PhilBot402

Copy link
Copy Markdown
Owner

Port of x402-foundation#3372 from TypeScript to Python SDK.

Python batch-settlement now matches the TypeScript behavior from that PR. x402Client forwards the resolved atomic spend cap on PaymentPayloadContext.max_amount_per_payment. Servers always announce extra.minDeposit on 402 responses (SDK default 10 × amount, optional Money or atomic override) and may opt in to enforce_min_deposit. Clients size deposits from a valid hint, otherwise amount × deposit_multiplier, clamped to spend_cap × deposit_multiplier. Uncapped payments leave deposits uncapped. Tracks x402-foundation#3405.

AI disclosure: Automated by @phdargen. Use your own judgement

Open in Web Open in Cursor 

PhilBot402 and others added 3 commits September 15, 2026 05:48
Pass the already-resolved atomic spendControls cap to scheme
create_payment_payload via PaymentPayloadContext.max_amount_per_payment
(omitted when uncapped) so capital-locking schemes can reuse client
policy without re-resolving it.

Co-authored-by: phdargen <phdargen@users.noreply.github.com>
Servers always announce extra.minDeposit on 402 responses (SDK default
10 × amount). Clients size deposits from a valid hint, else
amount × deposit_multiplier, clamped to spend_cap × deposit_multiplier.
Servers may opt in to enforce_min_deposit (default off).

Co-authored-by: phdargen <phdargen@users.noreply.github.com>
Show the client spend-cap deposit ceiling and the optional server
extra.minDeposit override in the Python batch-settlement examples.

Co-authored-by: phdargen <phdargen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant