Repository: reown-com/appkit
Pull request #4126: fix:reset swap controller state(myTokensWithBalance) when network/account changed
Author: login: KannuSingh
Created: 2025-04-02T12:14:42Z | Merged: 2025-04-03T09:20:16Z

# Description

On network/account switch the swap controller `myTokensWithBalance` state was not reset, as it was not part of resetState. Added it.

## Type of change

- [ ] Chore (non-breaking change that addresses non-functional tasks, maintenance, or code quality improvements)
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)

# Associated Issues

For Linear issues: Closes APKT-xxx
For GH issues: closes #...

# Showcase (Optional)

If there is a UI change include the screenshots with before and after state.
If new feature is being introduced, include the link to demo recording.

# Checklist

- [x] Code in this PR is covered by automated tests (Unit tests, E2E tests)
- [x] My changes generate no new warnings
- [x] I have reviewed my own code
- [x] I have filled out all required sections
- [x] I have tested my changes on the preview link
- [ ] Approver of this PR confirms that the changes are tested on the preview link



Diff:
diff --git a/.changeset/kind-hats-mate.md b/.changeset/kind-hats-mate.md
new file mode 100644
index 0000000000..278818bd01
--- /dev/null
+++ b/.changeset/kind-hats-mate.md
@@ -0,0 +1,24 @@
+---
+'@reown/appkit-controllers': patch
+'@reown/appkit-scaffold-ui': patch
+'@reown/appkit-adapter-bitcoin': patch
+'@reown/appkit-adapter-ethers': patch
+'@reown/appkit-adapter-ethers5': patch
+'@reown/appkit-adapter-solana': patch
+'@reown/appkit-adapter-wagmi': patch
+'@reown/appkit': patch
+'@reown/appkit-utils': patch
+'@reown/appkit-cdn': patch
+'@reown/appkit-cli': patch
+'@reown/appkit-common': patch
+'@reown/appkit-core': patch
+'@reown/appkit-experimental': patch
+'@reown/appkit-polyfills': patch
+'@reown/appkit-siwe': patch
+'@reown/appkit-siwx': patch
+'@reown/appkit-ui': patch
+'@reown/appkit-wallet': patch
+'@reown/appkit-wallet-button': patch
+---
+
+Fixes swap balance recent on network and account change
diff --git a/packages/controllers/src/controllers/SwapController.ts b/packages/controllers/src/controllers/SwapController.ts
index 30dcebc26b..8bdb776716 100644
--- a/packages/controllers/src/controllers/SwapController.ts
+++ b/packages/controllers/src/controllers/SwapController.ts
@@ -302,6 +302,7 @@ export const SwapController = {
     state.networkTokenSymbol = initialState.networkTokenSymbol
     state.networkBalanceInUSD = initialState.networkBalanceInUSD
     state.inputError = initialState.inputError
+    state.myTokensWithBalance = initialState.myTokensWithBalance
   },
 
   resetValues() {
diff --git a/packages/scaffold-ui/src/views/w3m-swap-view/index.ts b/packages/scaffold-ui/src/views/w3m-swap-view/index.ts
index 9605abfce6..6154c13105 100644
--- a/packages/scaffold-ui/src/views/w3m-swap-view/index.ts
+++ b/packages/scaffold-ui/src/views/w3m-swap-view/index.ts
@@ -36,6 +36,8 @@ export class W3mSwapView extends LitElement {
 
   @state() private detailsOpen = false
 
+  @state() private caipAddress = AccountController.state.caipAddress
+
   @state() private caipNetworkId = ChainController.state.activeCaipNetwork?.caipNetworkId
 
   @state() private initialized = SwapController.state.initialized
@@ -74,6 +76,13 @@ export class W3mSwapView extends LitElement {
         SwapController.initializeState()
       }
     })
+    AccountController.subscribeKey('caipAddress', newCaipAddress => {
+      if (this.caipAddress !== newCaipAddress) {
+        this.caipAddress = newCaipAddress
+        SwapController.resetState()
+        SwapController.initializeState()
+      }
+    })
     this.unsubscribe.push(
       ...[
         ModalController.subscribeKey('open', isOpen => {
diff --git a/packages/scaffold-ui/test/views/w3m-swap-view.test.ts b/packages/scaffold-ui/test/views/w3m-swap-view.test.ts
index a6aaf7651b..47a74594e7 100644
--- a/packages/scaffold-ui/test/views/w3m-swap-view.test.ts
+++ b/packages/scaffold-ui/test/views/w3m-swap-view.test.ts
@@ -2,6 +2,7 @@ import { expect, fixture, html } from '@open-wc/testing'
 import { afterEach, beforeEach, describe, it, vi } from 'vitest'
 
 import {
+  AccountController,
   ChainController,
   type ChainControllerState,
   RouterController,
@@ -122,6 +123,12 @@ describe('W3mSwapView', () => {
     vi.spyOn(SwapController, 'switchTokens').mockImplementation(() => {})
     vi.spyOn(SwapController, 'resetState').mockImplementation(() => {})
     vi.spyOn(RouterController, 'push').mockImplementation(() => {})
+
+    vi.spyOn(AccountController, 'state', 'get').mockReturnValue({
+      ...AccountController.state,
+      caipAddress: 'eip155:1:0x123456789abcdef123456789abcdef123456789a',
+      address: '0x123456789abcdef123456789abcdef123456789a'
+    })
   })
 
   afterEach(() => {
@@ -269,4 +276,52 @@ describe('W3mSwapView', () => {
     expect(routerPushSpy.mock.calls.length).to.equal(1)
     expect(routerPushSpy.mock.calls[0]?.[0]).to.equal('SwapPreview')
   })
+
+  it('should handle caipAddress change', async () => {
+    vi.mocked(SwapController.resetState).mockClear()
+    vi.mocked(SwapController.initializeState).mockClear()
+
+    // Spy on AccountController.subscribeKey to capture subscription callbacks
+    const subscribeKeySpy = vi.spyOn(AccountController, 'subscribeKey')
+
+    // Create the component which will register subscriptions
+    const element = await fixture<W3mSwapView>(html`<w3m-swap-view></w3m-swap-view>`)
+    await element.updateComplete
+
+    // Verify AccountController.subscribeKey was called
+    expect(subscribeKeySpy.mock.calls.length).to.be.greaterThan(0)
+
+    // Verify one of the calls was for caipAddress
+    const hasCaipAddressCall = subscribeKeySpy.mock.calls.some(call => call[0] === 'caipAddress')
+    expect(hasCaipAddressCall).to.be.true
+
+    // Get the callback function that was registered for caipAddress changes
+    const caipAddressCallArgs = subscribeKeySpy.mock.calls.find(call => call[0] === 'caipAddress')
+    const callback = caipAddressCallArgs?.[1]
+
+    // Verify callback exists
+    expect(callback).to.exist
+
+    // Test 1: Same caipAddress should not trigger resets
+    const currentCaipAddress = 'eip155:1:0x123456789abcdef123456789abcdef123456789a'
+    vi.mocked(SwapController.resetState).mockClear()
+    vi.mocked(SwapController.initializeState).mockClear()
+
+    callback!(currentCaipAddress)
+
+    // Verify methods were NOT called when address hasn't changed
+    expect(vi.mocked(SwapController.resetState).mock.calls.length).to.equal(0)
+    expect(vi.mocked(SwapController.initializeState).mock.calls.length).to.equal(0)
+
+    // Test 2: Different caipAddress should trigger resets
+    vi.mocked(SwapController.resetState).mockClear()
+    vi.mocked(SwapController.initializeState).mockClear()
+
+    const newCaipAddress = 'eip155:1:0xabcdef123456789abcdef123456789abcdef1234'
+    callback!(newCaipAddress)
+
+    // Verify methods were called when address changed
+    expect(vi.mocked(SwapController.resetState).mock.calls.length).to.equal(1)
+    expect(vi.mocked(SwapController.initializeState).mock.calls.length).to.equal(1)
+  })
 })


Reviews:
user: login: enesozturk
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-02T12:56:15Z
user: login: enesozturk
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-02T12:56:51Z
user: login: KannuSingh
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-02T13:19:01Z
user: login: KannuSingh
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-02T13:19:09Z
user: login: enesozturk
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T07:46:13Z
user: login: enesozturk
state: COMMENTED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T07:46:55Z
user: login: enesozturk
state: APPROVED
author_association: CONTRIBUTOR
submitted_at: 2025-04-03T07:52:25Z

Review comments:
diff_hunk: @@ -74,6 +76,13 @@ export class W3mSwapView extends LitElement {
         SwapController.initializeState()
       }
     })
+    AccountController.subscribeKey('address', newAddress => {
path: packages/scaffold-ui/src/views/w3m-swap-view/index.ts
user: login: enesozturk
body: Shouldn't you check `caipAddress` instead of `address`? If user switch network, address will be same but CAIP address will be different
created_at: 2025-04-02T12:56:15Z
author_association: CONTRIBUTOR
diff_hunk: @@ -36,6 +36,8 @@ export class W3mSwapView extends LitElement {
 
path: packages/scaffold-ui/src/views/w3m-swap-view/index.ts
user: login: enesozturk
body: Also can you handle this in `w3m-swap-view` tests?
created_at: 2025-04-02T12:56:51Z
author_association: CONTRIBUTOR
diff_hunk: @@ -74,6 +76,13 @@ export class W3mSwapView extends LitElement {
         SwapController.initializeState()
       }
     })
+    AccountController.subscribeKey('address', newAddress => {
path: packages/scaffold-ui/src/views/w3m-swap-view/index.ts
user: login: KannuSingh
body: ok, your right. Thanks
created_at: 2025-04-02T13:19:01Z
author_association: CONTRIBUTOR
diff_hunk: @@ -36,6 +36,8 @@ export class W3mSwapView extends LitElement {
 
path: packages/scaffold-ui/src/views/w3m-swap-view/index.ts
user: login: KannuSingh
body: added.
created_at: 2025-04-02T13:19:09Z
author_association: CONTRIBUTOR
diff_hunk: @@ -0,0 +1,24 @@
+---
+'@reown/appkit-controllers': patch
+'@reown/appkit-scaffold-ui': patch
+'@reown/appkit-adapter-bitcoin': patch
+'@reown/appkit-adapter-ethers': patch
+'@reown/appkit-adapter-ethers5': patch
+'@reown/appkit-adapter-solana': patch
+'@reown/appkit-adapter-wagmi': patch
+'@reown/appkit': patch
+'@reown/appkit-utils': patch
+'@reown/appkit-cdn': patch
+'@reown/appkit-cli': patch
+'@reown/appkit-common': patch
+'@reown/appkit-core': patch
+'@reown/appkit-experimental': patch
+'@reown/appkit-polyfills': patch
+'@reown/appkit-siwe': patch
+'@reown/appkit-siwx': patch
+'@reown/appkit-ui': patch
+'@reown/appkit-wallet': patch
+'@reown/appkit-wallet-button': patch
+---
+
+chore: swap state (myTokensWithBalance) reset on network and account change
path: .changeset/kind-hats-mate.md
user: login: enesozturk
body: Update the message to follow our convention, like "Fixes swap balance recent on network and account change"
```suggestion
Fixes swap balance recent on network and account change
```
created_at: 2025-04-03T07:46:13Z
author_association: CONTRIBUTOR
diff_hunk: @@ -122,6 +123,19 @@ describe('W3mSwapView', () => {
     vi.spyOn(SwapController, 'switchTokens').mockImplementation(() => {})
     vi.spyOn(SwapController, 'resetState').mockImplementation(() => {})
     vi.spyOn(RouterController, 'push').mockImplementation(() => {})
+
+    vi.spyOn(AccountController, 'state', 'get').mockReturnValue({
+      currentTab: 0,
+      caipAddress: 'eip155:1:0x123456789abcdef123456789abcdef123456789a',
+      address: '0x123456789abcdef123456789abcdef123456789a',
+      profileName: undefined,
+      profileImage: undefined,
+      balance: undefined,
+      balanceSymbol: undefined,
+      addressLabels: new Map(),
+      allAccounts: [],
+      preferredAccountType: undefined
path: packages/scaffold-ui/test/views/w3m-swap-view.test.ts
user: login: enesozturk
body: ```suggestion
      ...AccountController.state,
      caipAddress: 'eip155:1:0x123456789abcdef123456789abcdef123456789a',
      address: '0x123456789abcdef123456789abcdef123456789a'
```
created_at: 2025-04-03T07:46:55Z
author_association: CONTRIBUTOR

PR comments:
user: login: changeset-bot[bot]
created_at: 2025-04-02T12:14:46Z
body: ###  🦋  Changeset detected

Latest commit: 8e6617acd5851f7abc4010be98d2d104c4179594

**The changes in this PR will be included in the next version bump.**

<details><summary>This PR includes changesets to release 20 packages</summary>

  | Name                          | Type  |
| ----------------------------- | ----- |
| @reown/appkit-controllers     | Patch |
| @reown/appkit-scaffold-ui     | Patch |
| @reown/appkit-adapter-bitcoin | Patch |
| @reown/appkit-adapter-ethers  | Patch |
| @reown/appkit-adapter-ethers5 | Patch |
| @reown/appkit-adapter-solana  | Patch |
| @reown/appkit-adapter-wagmi   | Patch |
| @reown/appkit                 | Patch |
| @reown/appkit-utils           | Patch |
| @reown/appkit-cdn             | Patch |
| @reown/appkit-cli             | Patch |
| @reown/appkit-common          | Patch |
| @reown/appkit-core            | Patch |
| @reown/appkit-experimental    | Patch |
| @reown/appkit-polyfills       | Patch |
| @reown/appkit-siwe            | Patch |
| @reown/appkit-siwx            | Patch |
| @reown/appkit-ui              | Patch |
| @reown/appkit-wallet          | Patch |
| @reown/appkit-wallet-button   | Patch |

</details>

Not sure what this means? [Click here  to learn what changesets are](https://github.com/changesets/changesets/blob/main/docs/adding-a-changeset.md).

[Click here if you're a maintainer who wants to add another changeset to this PR](https://github.com/reown-com/appkit/new/chore/reset-swap-controller-state-on-network?filename=.changeset/lovely-grapes-destroy.md&value=---%0A%22%40reown%2Fappkit-controllers%22%3A%20patch%0A%22%40reown%2Fappkit-scaffold-ui%22%3A%20patch%0A---%0A%0Achore%3Areset%20swap%20controller%20state(myTokensWithBalance)%20when%20network%2Faccount%20changed%0A)


author_association: NONE
user: login: vercel[bot]
created_at: 2025-04-02T12:14:48Z
body: [vc]: #YgCnHPmLYYGi52I4WJqiwOxYuN1lBOelSeActRO4udI=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJhcHBraXQtbGFib3JhdG9yeSIsInJvb3REaXJlY3RvcnkiOm51bGwsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9yZW93bi1jb20vYXBwa2l0LWxhYm9yYXRvcnkvQW5VeXZaVXBKcEdFdm14dFdLaUhvZHlYNU1UYSIsInByZXZpZXdVcmwiOiJhcHBraXQtbGFib3JhdG9yeS1naXQtY2hvcmUtcmVzZXQtc3dhcC1jb250cm9sLTNkZjhiNy1yZW93bi1jb20udmVyY2VsLmFwcCIsIm5leHRDb21taXRTdGF0dXMiOiJERVBMT1lFRCIsImxpdmVGZWVkYmFjayI6eyJyZXNvbHZlZCI6MCwidW5yZXNvbHZlZCI6MCwidG90YWwiOjAsImxpbmsiOiJhcHBraXQtbGFib3JhdG9yeS1naXQtY2hvcmUtcmVzZXQtc3dhcC1jb250cm9sLTNkZjhiNy1yZW93bi1jb20udmVyY2VsLmFwcCJ9fSx7Im5hbWUiOiJhcHBraXQtd2FnbWktY2RuLWV4YW1wbGUiLCJyb290RGlyZWN0b3J5IjpudWxsLCJsaXZlRmVlZGJhY2siOnsicmVzb2x2ZWQiOjAsInVucmVzb2x2ZWQiOjAsInRvdGFsIjowLCJsaW5rIjoiIn0sImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9yZW93bi1jb20vYXBwa2l0LXdhZ21pLWNkbi1leGFtcGxlLzQ3dmJXd3I1ZTRNQmRTRHhCWlc2SlhrTUdGaEoiLCJuZXh0Q29tbWl0U3RhdHVzIjoiSUdOT1JFRCJ9LHsibmFtZSI6InZ1ZS13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5zZW4tZGVtby9DQjVpWGtmeGE3RGV1UXg2ZXJLM1o2RFpiWjU3IiwibmV4dENvbW1pdFN0YXR1cyI6IklHTk9SRUQifV19
**The latest updates on your projects**. Learn more about [Vercel for Git ↗︎](https://vercel.link/github-learn-more)

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **appkit-demo** | ✅ Ready ([Inspect](https://vercel.com/reown-com/appkit-demo/9Hf57GecZV9yAn1D4vMfCz4urnfw)) | [Visit Preview](https://appkit-demo-git-chore-reset-swap-controller-st-9ec159-reown-com.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/appkit-demo-git-chore-reset-swap-controller-st-9ec159-reown-com.vercel.app?via=pr-comment-feedback-link) | Apr 3, 2025 7:56am |
| **appkit-laboratory** | ✅ Ready ([Inspect](https://vercel.com/reown-com/appkit-laboratory/AnUyvZUpJpGEvmxtWKiHodyX5MTa)) | [Visit Preview](https://appkit-laboratory-git-chore-reset-swap-control-3df8b7-reown-com.vercel.app) | 💬 [**Add feedback**](https://vercel.live/open-feedback/appkit-laboratory-git-chore-reset-swap-control-3df8b7-reown-com.vercel.app?via=pr-comment-feedback-link) | Apr 3, 2025 7:56am |

<details><summary>12 Skipped Deployments</summary>

| Name | Status | Preview | Comments | Updated (UTC) |
| :--- | :----- | :------ | :------- | :------ |
| **appkit-basic-ep** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/appkit-basic-ep/7QUsvTNDjxmqp4JRUdM4QUaZxurD)) |  |  | Apr 3, 2025 7:56am |
| **appkit-basic-ep-example** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/appkit-basic-ep-example/ATcLohudFnmzS1xeQFeJ5TGtPrAA)) |  |  | Apr 3, 2025 7:56am |
| **appkit-basic-example** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/appkit-basic-example/GTUqW41fzMNnfVzZbnsiNU6APxkt)) |  |  | Apr 3, 2025 7:56am |
| **appkit-basic-sign-client-example** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/appkit-basic-sign-client-example/7moRcC9f4jGJ6yshM9TEJSiUVaAs)) |  |  | Apr 3, 2025 7:56am |
| **appkit-basic-up-example** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/appkit-basic-up-example/3ZDnRa7qCQHgww4vji55WfuJxynG)) |  |  | Apr 3, 2025 7:56am |
| **appkit-ethers5-bera** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/appkit-ethers5-bera/HvEPzUFqf7bvvXUiVhEoB3mWFNPZ)) |  |  | Apr 3, 2025 7:56am |
| **appkit-nansen-demo** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/appkit-nansen-demo/CB5iXkfxa7DeuQx6erK3Z6DZbZ57)) |  |  | Apr 3, 2025 7:56am |
| **appkit-vue-solana** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/appkit-vue-solana/EuFSXM9DepT39S4yax2Jjo86z84g)) |  |  | Apr 3, 2025 7:56am |
| **appkit-wagmi-cdn-example** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/appkit-wagmi-cdn-example/47vbWwr5e4MBdSDxBZW6JXkMGFhJ)) |  |  | Apr 3, 2025 7:56am |
| **ethereum-provider-wagmi-example** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/ethereum-provider-wagmi-example/4tCYwcZXeEkoFUNkeuNp4jzr9yLi)) | [Visit Preview](https://ethereum-provider-wagmi-example-git-chore-rese-46de76-reown-com.vercel.app) |  | Apr 3, 2025 7:56am |
| **next-wagmi-solana-bitcoin-example** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/next-wagmi-solana-bitcoin-example/7boDYAE7a4tszFW4328jZqAAMFCn)) |  |  | Apr 3, 2025 7:56am |
| **vue-wagmi-example** | ⬜️ Ignored ([Inspect](https://vercel.com/reown-com/vue-wagmi-example/STF8CAu876St9RdDPZw6wcTHUA9B)) |  |  | Apr 3, 2025 7:56am |
</details>















author_association: NONE
user: login: github-actions[bot]
created_at: 2025-04-02T12:17:53Z
body: 
<!--
  0 failure: 
  3 warning:  File packages/con..., File packages/sca..., File packages/sca...
  
  
  DangerID: danger-id-Danger;
-->


<table>
  <thead>
    <tr>
      <th width="50"></th>
      <th width="100%" data-danger-table="true">Warnings</th>
    </tr>
  </thead>
  <tbody><tr>
      <td>:warning:</td>
      <td>File packages/controllers/src/controllers/SwapController.ts contains a KEY or SECRET</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>File packages/scaffold-ui/src/views/w3m-swap-view/index.ts contains a KEY or SECRET</td>
    </tr>
  
<tr>
      <td>:warning:</td>
      <td>File packages/scaffold-ui/test/views/w3m-swap-view.test.ts contains a KEY or SECRET</td>
    </tr>
  </tbody>
</table>



<p align="right">
  Generated by :no_entry_sign: <a href="https://danger.systems/js">dangerJS</a> against 8e6617acd5851f7abc4010be98d2d104c4179594
</p>

author_association: CONTRIBUTOR
user: login: github-actions[bot]
created_at: 2025-04-02T12:20:02Z
body: <h2>Coverage Report</h2>
<table> <thead> <tr> <th align="center">Status</th> <th align="left">Category</th> <th align="right">Percentage</th> <th align="right">Covered / Total</th> </tr> </thead> <tbody> <tr> <td align="center">🔵</td> <td align="left">Lines</td> <td align="right">74.8%</td> <td align="right">24985 / 33400</td> </tr> <tr> <td align="center">🔵</td> <td align="left">Statements</td> <td align="right">74.8%</td> <td align="right">24985 / 33400</td> </tr> <tr> <td align="center">🔵</td> <td align="left">Functions</td> <td align="right">66.13%</td> <td align="right">2109 / 3189</td> </tr> <tr> <td align="center">🔵</td> <td align="left">Branches</td> <td align="right">83.17%</td> <td align="right">4806 / 5778</td> </tr> </tbody> </table><details><summary>File Coverage</summary><table> <thead> <tr> <th align="left">File</th> <th align="right">Stmts</th> <th align="right">Branches</th> <th align="right">Functions</th> <th align="right">Lines</th> <th align="left">Uncovered Lines</th> </tr> </thead> <tbody> <tr> <td align="left" colspan="6"><b>Changed Files</b></td> </tr> <tr> <td align="left"><a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts">packages/controllers/src/controllers/SwapController.ts</a></td> <td align="right">50.51%</td> <td align="right">72.5%</td> <td align="right">62.06%</td> <td align="right">50.51%</td> <td align="left"><a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L44-L47" class="text-red">44-47</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L174" class="text-red">174</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L185-L186" class="text-red">185-186</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L216-L221" class="text-red">216-221</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L254-L256" class="text-red">254-256</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L265-L266" class="text-red">265-266</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L274-L288" class="text-red">274-288</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L317" class="text-red">317</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L321" class="text-red">321</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L326-L327" class="text-red">326-327</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L335-L338" class="text-red">335-338</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L371" class="text-red">371</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L378" class="text-red">378</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L383-L400" class="text-red">383-400</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L409-L411" class="text-red">409-411</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L424-L425" class="text-red">424-425</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L436-L437" class="text-red">436-437</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L449" class="text-red">449</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L456-L457" class="text-red">456-457</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L461-L469" class="text-red">461-469</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L473" class="text-red">473</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L475" class="text-red">475</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L477" class="text-red">477</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L479" class="text-red">479</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L524-L533" class="text-red">524-533</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L560-L598" class="text-red">560-598</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L602-L658" class="text-red">602-658</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L662-L711" class="text-red">662-711</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L716-L766" class="text-red">716-766</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L770-L853" class="text-red">770-853</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L869-L870" class="text-red">869-870</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L886-L887" class="text-red">886-887</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/controllers/src/controllers/SwapController.ts#L764-L849" class="text-red">764-849</a></td> </tr> <tr> <td align="left"><a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts">packages/scaffold-ui/src/views/w3m-swap-view/index.ts</a></td> <td align="right">69.72%</td> <td align="right">83.33%</td> <td align="right">83.33%</td> <td align="right">69.72%</td> <td align="left"><a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L73-L77" class="text-red">73-77</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L89-L91" class="text-red">89-91</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L94-L96" class="text-red">94-96</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L99-L111" class="text-red">99-111</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L133" class="text-red">133</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L139-L141" class="text-red">139-141</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L154" class="text-red">154</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L163-L164" class="text-red">163-164</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L167-L168" class="text-red">167-168</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L184" class="text-red">184</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L197" class="text-red">197</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L218" class="text-red">218</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L222-L248" class="text-red">222-248</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L259-L266" class="text-red">259-266</a>, <a href="https://github.com/reown-com/appkit/blob/8e6617acd5851f7abc4010be98d2d104c4179594/packages/scaffold-ui/src/views/w3m-swap-view/index.ts#L288" class="text-red">288</a></td> </tr> </tbody> </table></details>
<em>Generated in workflow <a href=https://github.com/reown-com/appkit/actions/runs/14237772284>#10623</a> for commit <a href="https://github.com/reown-com/appkit/commit/8e6617acd5851f7abc4010be98d2d104c4179594">8e6617a</a> by the <a href="https://github.com/davelosert/vitest-coverage-report-action">Vitest Coverage Report Action</a></em>

<!-- vitest-coverage-report-marker-root -->
author_association: CONTRIBUTOR
user: login: enesozturk
created_at: 2025-04-02T13:17:07Z
body: @KannuSingh can you add changeset file?
author_association: CONTRIBUTOR
user: login: KannuSingh
created_at: 2025-04-02T13:42:09Z
body: @enesozturk added the changeset file
author_association: CONTRIBUTOR