Skip to content

feat(request): plan every charge through machine-fetch (stack 3/6) - #276

Draft
brendanjryan wants to merge 1 commit into
brendan/machine-fetch-2-e2efrom
brendan/machine-fetch-3-plan
Draft

brendanjryan wants to merge 1 commit into
brendan/machine-fetch-2-e2efrom
brendan/machine-fetch-3-plan

Conversation

@brendanjryan

@brendanjryan brendanjryan commented Oct 18, 2026 •

Copy link
Copy Markdown
Contributor

3/6 — Phase 1. Every charge is planned through machine-fetch before signing (src/payment/funding.ts: mppxRequirement → planPayment → extension().preparePayment), and the credential is created with the context funding prepared. --max-spend becomes maxPayment as an asset list of the USD tokens the CLI lists. Behavior change: a charge in an unlisted token is refused with E_LIMIT_EXCEEDED instead of being compared as if it had six decimals. machine-fetch error codes map to CLI codes and ctas. TEMPO_DEV_CHAINS adds development tokens (used by the e2e harness).

Paired PRs

wallet-cli vendors machine-fetch main @ d168943 (0.3.0) and mppx brendan/wallet-cli-needs @ 8295134 (mppx@0.12.0 + the commits merged upstream as 82810df and 0acc2bc), pinned by commit until we choose to upgrade.

Charges go through planAndFund (src/payment/funding.ts): mppxRequirement,
planPayment, then machine-fetch's Mppx extension, and the credential is
created with the context it prepared. There are no funders yet, so payments
are unchanged.

--max-spend becomes maxPayment as an asset list: every USD token the CLI
lists for the network at the cap. A charge in any other token is now refused
with E_LIMIT_EXCEEDED instead of being compared as if it had six decimals.
enforceMaxSpend still refuses an over-cap charge early with the same cap.
machine-fetch error codes map to the CLI's codes and ctas.

src/shared/chains.ts holds the trusted token table; TEMPO_DEV_CHAINS adds
development tokens, which the e2e harness uses for its local chain.
@brendanjryan
brendanjryan force-pushed the brendan/machine-fetch-3-plan branch from e32c441 to 4a56d7b Compare October 19, 2026 21:48
@brendanjryan
brendanjryan force-pushed the brendan/machine-fetch-2-e2e branch from 833bb27 to f7296ca Compare October 19, 2026 21:48

This branch has not been deployed

No deployments
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.

1 participant