feat(fee-payer): upgrade to accounts SDK relay handler#970
Open
decofe wants to merge 3 commits into
Open
Conversation
…andler.relay Handler.relay from the accounts SDK provides: - Fee token resolution (auto-detects best fee token from balances) - Auto-swap support for cross-token fee payment - Simulation with balance diffs and fee breakdown - Multi-chain transport support (mainnet, moderato, devnet) - Proper AMM liquidity handling This replaces the older tempo.ts Handler.feePayer which lacked fee token resolution and could produce transactions with missing/wrong feeToken fields. Amp-Thread-ID: https://ampcode.com/threads/T-019e2d80-38fe-76d6-91b5-f1aef2e1caf9
Cloudflare Deployments
|
Bundle Size Report
Chunk changes (>1KB)
Compared against main branch (baseline from 4/27/2026, 4:02:54 PM) |
Handler.relay proxies eth_chainId instead of rejecting with MethodNotSupportedError. Updated assertions to expect a successful result instead of an error. Amp-Thread-ID: https://ampcode.com/threads/T-019e2d80-38fe-76d6-91b5-f1aef2e1caf9
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.
Summary
Replaces
Handler.feePayerfromtempo.ts/serverwithHandler.relayfromaccounts/server(same handler wallet-next uses).Why
The old
tempo.tshandler lacks fee token resolution — clients had to manually setfeeTokenon the chain config or the transaction would be sent without one, causing FeeAMM swap errors even when validators accept pathUSD.What changes
tempo.ts→accounts(already in workspace catalog at~0.8.1)Handler.feePayer()→Handler.relay()withfeatures: "all"chainId)eth_fillTransactionresponsesHandler config
Backward-compatible
/still works/tp_*still works