# switchWalletNetwork

Allows NeoLine applications ('dapps') to request that the wallet switches its active Neo network.

## Input Arguments

<table><thead><tr><th width="277">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>chainId:</code><a href="#chain-ids-type"><img src="http://localhost:8080/assets/images/info.svg" alt="i"></a><code>number</code></td><td>Switch the chainId of the network</td></tr></tbody></table>

### **Chain IDs Type**

These are the IDs of the Neo chain supported by NeoLine.

<table><thead><tr><th width="280">chainId</th><th>Description</th></tr></thead><tbody><tr><td><code>1</code></td><td>ChainId 1 is the Neo2 MainNet</td></tr><tr><td><code>2</code></td><td>ChainId 2 is the Neo2 TestNet</td></tr><tr><td><code>3</code></td><td>ChainId 3 is the N3 MainNet</td></tr><tr><td><code>6</code></td><td>ChainId 6 is the N3 TestNet (Currently only N3 TestNet)</td></tr><tr><td><code>0</code></td><td>ChainId 0 is the N3 Private Network</td></tr></tbody></table>

## **Success Response**

Null

## **Error Response**

<table><thead><tr><th width="289">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>type: string</code></td><td>The type of error which has occured</td></tr><tr><td><code>description: string</code></td><td>A description of the error which has occured</td></tr><tr><td><code>data: string</code></td><td>Any raw data associated with the error</td></tr></tbody></table>

## Example

### Request

```js
neoline.switchWalletNetwork({
  chainId: 3
})
.then(() => {})
.catch((error) => {
  const {type, description, data} = error;
  switch(type) {
    case UNKNOWN_ERROR:
        console.log(description);
        break;
    default:
        // Not an expected error object.  Just write the error to the console.
        console.error(error);
        break;
  }
});
```

### Response

```js
null
```
