> For the complete documentation index, see [llms.txt](https://docs.adena.app/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.adena.app/integrations/network/switch-network.md).

# Switch Network

A web application may request Adena to **switch the current network settings to a new one** via the `SwitchNetwork` method. Upon the user's approval, Adena will switch the network to the one requested by the app.

#### Code

```javascript
adena.SwitchNetwork(chainId: string)
```

#### **Params**

<table><thead><tr><th width="224">Key</th><th width="197.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>network.chainId</code></td><td><code>string</code></td><td>Chain ID</td></tr></tbody></table>

#### Response

<table><thead><tr><th width="212">Key</th><th width="168.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>code</code></td><td><code>number</code></td><td>Code <code>(success: 0)</code></td></tr><tr><td><code>status</code></td><td><code>string</code></td><td>Returns <code>success</code> or <code>failure</code></td></tr><tr><td><code>type</code></td><td><code>string</code></td><td>Response type</td></tr><tr><td><code>message</code></td><td><code>string</code></td><td>Descriptive message of the result</td></tr><tr><td><code>data</code></td><td><code>object</code></td><td><strong>Switch Network Result Model</strong></td></tr></tbody></table>

#### Switch Network Result Model

<table><thead><tr><th width="212">Key</th><th width="168.33333333333331">Type</th><th>Description</th></tr></thead><tbody><tr><td><code>chainId</code></td><td><code>string</code></td><td>Chain ID</td></tr></tbody></table>

#### Sample Request

```javascript
await adena.SwitchNetwork('dev-1')
```

#### Sample Response

```json
{
    "code": 0,
    "status": "success",
    "type": "SWITCH_NETWORK_SUCCESS",
    "message": "The network has been successfully changed.",
    "data": {
        "chainId": "dev-1"
    }
}
```
