Skip to content

Comments

feat: add support for safe queued transactions#347

Open
tomiiide wants to merge 14 commits intomainfrom
chore-investigate-rabby-safe
Open

feat: add support for safe queued transactions#347
tomiiide wants to merge 14 commits intomainfrom
chore-investigate-rabby-safe

Conversation

@tomiiide
Copy link
Contributor

@tomiiide tomiiide commented Feb 5, 2026

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 StepExecutor was 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

  • I have performed a self-review and testing of my code.
  • This pull request is focused and addresses a single problem.
  • If this PR modifies the SDK API or adds new features that require documentation, I have updated the documentation in the public-docs repository.

@tomiiide tomiiide force-pushed the chore-investigate-rabby-safe branch from ba3c598 to 95957aa Compare February 9, 2026 14:57
@tomiiide tomiiide marked this pull request as ready for review February 10, 2026 10:06
- 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
@tomiiide tomiiide requested review from chybisov and effie-ms and removed request for chybisov February 16, 2026 11:37
const txServiceUrlCache = new Map<number, CacheEntry<string>>()

// Cache for isSafeWallet results per chainId:address
const safeWalletCache = new Map<string, boolean>()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Contributor Author

@tomiiide tomiiide Feb 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, yeah, I don't think it would grow too large, but since we already have the bound util setup, I'll add it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants