Skip to content

feat: 7702 delegation, atomic swaps#7157

Merged
DanielSinclair merged 16 commits intodevelopfrom
7702
Feb 26, 2026
Merged

feat: 7702 delegation, atomic swaps#7157
DanielSinclair merged 16 commits intodevelopfrom
7702

Conversation

@DanielSinclair
Copy link
Contributor

Fixes APP-####

What changed (plus any additional context for devs)

  • Feature branch merge including 7702 delegations, atomic swaps

Screen recordings / screenshots

What to test

DanielSinclair and others added 8 commits February 18, 2026 15:10
* chore: update viem to 2.38.0

* chore: install delegation, stores sdk

chore: install storesjs/stores

chore: delegation sdk upgrade

chore: upgrade delegation sdk, storesjs

chore: swaps, delegation sdk

chore: upgrade sdk

chore: upgrade delegation sdk to 0.2.2

chore: upgrade stores to 0.8.7

remove

* feat: add delegation experimental flag

Co-Authored-By: derHowie <derhowiedesigns@gmail.com>

* feat: delegation remote flag

* feat:  configure delegation client with dependencies

logger service

fix: add selected current address, chains

* note: chains issue

* fix: RainbowError safe logger proxy

fix: RainbowError safe logger proxy

chore: logger DebugContext for `delegation`

---------

Co-authored-by: derHowie <derhowiedesigns@gmail.com>
* feat: limit approvals based on approvalAmount quote gating

fix: perps estimation

fix: avoid convertAmountToRawAmount

* fix: delegation flag dependent finite approvals

* fix: break early on delegation disable

* Revert "fix: break early on delegation disable"

This reverts commit e3bec1f.
* refactor: estimateTransactionsGasLimit multi-call estimate consolidation

* refactor: simulateTransactions metadata client wrapper

fix: req transaction type

fix: pass individual transaction in transactions

* feat: delegation simulation response

* feat: delegated tx simulation with smart routing

fix: pass next nonce

* refactor: prepareSimulationTransaction to early break if delegation disable

* Revert "refactor: prepareSimulationTransaction to early break if delegation disable"

This reverts commit ef05dff.
* refactor: viem Hex type for toHex

casting

* refactor: adopt viem Hash over TxHash type

* feat: atomic swaps feature flag

* feat: atomic swaps remote flag

* feat: atomic rap action signaling

* feat: add prepare functions for atomic rap execution

Add prepare functions (prepareUnlock, prepareSwap, prepareCrosschainSwap)
that return BatchCall objects and transaction builders for atomic execution
via the delegation SDK. Integrate atomic path in walletExecuteRap using
typePrepareAction switch pattern.

refactor: return transaction data instead of builder function

Change prepare functions to return `transaction: Omit<NewTransaction, 'hash'>`
instead of a builder function. The hash is merged in after execution, making
the code simpler and more explicit about what data is available at each stage.

refactor: extract buildUnlockTransaction function

Move transaction building logic to buildUnlockTransaction for consistency
with buildSwapTransaction and buildCrosschainSwapTransaction.

refactor: add PrepareActionResult type

fix: approval param, nonce alignment

style: build new transaction return type

refactor: add optional hash param to build transaction functions

fix: hash return value

fix: swap quote hex values in prepare

fix: batch transaction value passing for native tokens

fix: use referrer default for prepare fills

fix: hash

* fix: use delegation feature flag/preference

* refactor: atomic execution switch logic

* fix: pass nonce for transaction consistency

* refactor: split atomic, sequential execute code paths

* Revert "refactor: split atomic, sequential execute code paths"

This reverts commit e2da7b2.

* fix: block speed up/cancel for delegation transactions

Adds a `delegation` boolean to `RainbowTransaction` to identify type 4
(EIP-7702) txs. Guards `SpeedUpAndCancelSheet` and the resubmit action
in transaction details so delegation txs can't be resubmitted — they
rely on a signed authorization that can't be re-signed after the fact.

fix: minimal post-execution delegation metadata for toasts

fix: batch, delegation transaction types
* feat: add revoke delegation panel

- Add RevokeDelegationPanel component for revoking delegations
- Add delegationStatus service for checking delegation state
- Use SDK executeRevokeDelegation for revocation

fix: add chain parameter to publicClient in RevokeDelegationPanel

feat: add revoke delegation panel

- Add RevokeDelegationPanel component for revoking delegations
- Add delegationStatus service for checking delegation state
- Use SDK executeRevokeDelegation for revocation

fix: add chain parameter to publicClient in RevokeDelegationPanel

fix: use ethers signer and provider

fix: hash

fix: revoke, status state mangement
Co-Authored-By: derHowie <derhowiedesigns@gmail.com>

* fix: pass nonce for transaction consistency

* feat: revoke reason, ui types

* feat: add gas fee display to RevokeDelegationPanel

- Add useGas hook integration for real-time gas fee polling
- Display gas fee with $0.01 floor for very small amounts
- Adjust panel padding and improve gas fee UI
- Import GasFee and LegacyGasFee entities

fix: gas bar revoke color

* chore: expand revoke reasons, messaging specificity

Support all backend alert reasons

refactor: remove SETTINGS_REVOKE

fix: empty delegations array handling

fix: default

fix: string, hold to disable

* fix: chain label name

* feat: useShouldRevoke checking

* fix: hold to revoke button colors

fix: colors

* fix: gas threshold formatting

* fix: optional contractAddress for simulation

* fix: revoke checking for owned wallets only

* refactor: revoking status

* refactor: extract timeout magic number to REVOKE_SUCCESS_DELAY_MS constant

* refactor: extract RevokeDelegationPanel into focused components

refactor: move derived state booleans above buttonLabel and handleButtonPress

* Revert "refactor: extract RevokeDelegationPanel into focused components"

This reverts commit ee611147b3927d3c40511a8ea2546b2216bc0199.

---------

Co-authored-by: derHowie <derhowiedesigns@gmail.com>
* feat: ViewWalletDelegations settings menu

fix: gradients, border colors

refactor: adopt getDelegations

fix: chain label

fix: patch for local state update on enable

fix: revoke, status state management

fix: reactive delegations list

feat: Edit Smart Wallet drop-down, UI placeholder

fix: edit smart wallet naming

fix: manage smart wallet for address title

chore: expand revoke reasons, messaging specificity

Support all backend alert reasons

refactor: remove SETTINGS_REVOKE

* fix: disable delegation settings when delegation disable

fix: delegation flag

fix: replace undefined showDelegationSettings with delegationEnabled

* chore: i18n ViewWalletDelegations strings
* feat: add delegation status label to wallet switcher

- Display "Delegated" (green) or "Not Delegated" (red) labels for owned wallets
- Check delegation on both mainnet and Base chains
- Use SDK getIsDelegated for checking delegation status
- Only visible in TESTFLIGHT/DEV builds

fix: ChangeWalletSheet

fix: use opacity helper instead of colors.alpha in AddressRow

- Replace colors.alpha() with opacity() for delegation badge border
- Matches existing usage pattern in the same file

* feat: display transaction type label on swap/bridge toast

Show "Type 4" (new delegation + action) or "Type 2" (already delegated)
on the toast for swap and bridge transactions when using atomic swaps.

- Add txType field to RainbowTransaction
- Check delegation status before executing to determine type
- Create transaction with txType for delegate path
- Display type label as bottom line in swap toast

fix: already delegated patch

fix: getIsDelegated

* feat: reset delegation store

refactor: improve resetDelegationCache call with ts-expect-error

- Remove unnecessary 'as any' cast
- Add explanatory comment about SDK type definition bug
- Actual implementation expects Record<string, never>, not Signer & Provider
- Linter optimized to no-arg call which works correctly

fix: add type assertion for resetDelegationCache in dev settings

- SDK expects Record<string, never> but type definitions incorrectly require Signer & Provider
- Use 'as any' for dev-only cache reset functionality

refactor: remove unused checkKeychainIntegrity import

* refactor: wallet list delegation badge

ChangeWalletSheet.tsx: Removed checkDelegationStatuses useEffect and delegationStatusByAddress state. This was imperative
  async fetching for all wallets at the parent level, only checking mainnet/base. Replaced by reactive hooks in each
  component. Removed isDelegated from AddressItem — delegation status is no longer passed as props.

  AddressRow.tsx: Calls useDelegations (reactive, all chains) and useDelegationPreference (reactive enabled/disabled) per
  address. Tri-state badge: red "Disabled" / green "Delegated" / gray "Not Delegated".

  PinnedWalletsGrid.tsx: Added small DelegationBadge component (wraps just the icon) so hooks can be called per-address inside
   the .map(). Same two hooks, same tri-state logic. Simplified draggableItems memo — no longer needs isDelegated tracking.

  WalletList.tsx: Removed isDelegated from memo dep tracking.

  en_US.json: Added "disabled" i18n key.

fix: replace getIsDelegated with getDelegations API

- getIsDelegated is not exported from @rainbow-me/delegation SDK
- Use getDelegations() and filter by chainId + DelegationStatus
- Simplify error handling with single try/catch per address

* fix: IS_TEST_FLIGHT

* patch: only label first-party delegations

* feat: smart wallet fee label and explainer on review panel

* feat: 7702 debug labels on swap button

* feat: simulate, trigger revoke types

fix: dev section revoke uses optional contractAddress

* chore: i18n for dev settigns

* fix: gate transaction type label behind dev/testflight
@socket-security
Copy link

socket-security bot commented Feb 20, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​@​rainbow-me/​delegation@​0.3.178100999470
Updatednpm/​viem@​2.21.54 ⏵ 2.38.099100100 +197 +1100
Addednpm/​@​storesjs/​stores@​0.8.7100100100100100

View full report

@DanielSinclair DanielSinclair marked this pull request as ready for review February 20, 2026 21:56
@github-actions
Copy link

github-actions bot commented Feb 20, 2026

🧪 Flashlight Performance Report (AWS Device Farm)

🔀 Commit: 7d90805

📎 View Artifacts

Metric Current Δ vs Baseline
Time to Interactive (TTI) 5568 ms
Average FPS 56.79
Average RAM 392.9 MB

@github-actions
Copy link

Launch in simulator or device for b1eea7c

@github-actions
Copy link

Launch in simulator or device for 1592859

@github-actions
Copy link

Launch in simulator or device for ab04e13

@github-actions
Copy link

Launch in simulator or device for 34085f9

@github-actions
Copy link

Launch in simulator or device for 7d90805

@DanielSinclair DanielSinclair merged commit 42af677 into develop Feb 26, 2026
19 checks passed
@DanielSinclair DanielSinclair deleted the 7702 branch February 26, 2026 05:50
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