feat: add support for safe queued transactions#347
Open
Conversation
ba3c598 to
95957aa
Compare
- disable message signing for safe wallet addresses connected via other wallets - on allowance check resumption, check if an allowance transaction is already in queue - do an onchain precheck before calling the safe api during isSafeWallet checks
effie-ms
reviewed
Feb 16, 2026
| const txServiceUrlCache = new Map<number, CacheEntry<string>>() | ||
|
|
||
| // Cache for isSafeWallet results per chainId:address | ||
| const safeWalletCache = new Map<string, boolean>() |
Contributor
There was a problem hiding this comment.
Is there a risk this cache grows too large? We have LruMap in withDedupe util, maybe we could reuse it to bound the cache anyhow?
Contributor
Author
There was a problem hiding this comment.
Interesting, yeah, I don't think it would grow too large, but since we already have the bound util setup, I'll add it.
chybisov
requested changes
Feb 18, 2026
- move safeApiKey to config to avoid prop drilling - split waitForTransaction logic into separate files - improve jsdocs - streamline transaction waiting logic to reduce API look ups
chybisov
requested changes
Feb 19, 2026
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.
Which Jira task is linked to this PR?
https://lifi.atlassian.net/browse/LF-17274
Why was it implemented this way?
The default safe provider from wagmi supports batched transactions, however when a safe wallet is connected via Rabby it doesn't support batched txns and txns are executed normally.
Safe wallet detection
The
StepExecutorwas updated to detect safe wallets that don't support batched transactions by checking on-chain contract code first, and then querying the Safe Transaction Service API.Allowance
When a Safe wallet that doesn't support batch txns is detected, we disable message signing, so that skip permit2, and use regular ERC-20 allow flow.
Queued Safe Transaction:
When a Safe wallet returns a signature instead of a txn hash during allowance or swap transaction, the SDK checks if this as a queued Safe transaction and polls the Safe Transaction Service until it's executed on-chain
Visual showcase (Screenshots or Videos)
If applicable, attach screenshots, GIFs, or videos to showcase the functionality, UI changes, or bug fixes.
Checklist before requesting a review