> For the complete documentation index, see [llms.txt](https://tutorial.neoline.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tutorial.neoline.io/reference/neo3-provider-api-legacy/common-methods/getnetworks.md).

# getNetworks

Returns the networks the wallet provider has available to connect to, along with the default network the wallet is currently set to.

## **Input Arguments**

None

## **Success Response**

<table><thead><tr><th width="344">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>networks: string[]</code></td><td>Array of network names the wallet provider has available for the dapp developer to connect to</td></tr><tr><td><code>chainId:</code> <a href="/pages/jN4WZEEOnXGEaGFmsSmK#chain-ids-type"><img src="http://localhost:8080/assets/images/info.svg" alt="i"></a><code>number</code></td><td>ChainId the wallet is currently set to</td></tr><tr><td><code>defaultNetwork: string</code></td><td>Network the wallet is currently set to</td></tr></tbody></table>

### **Chain IDs Type**

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

<table><thead><tr><th width="185">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>

## **Error Response**

<table><thead><tr><th width="343">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
neolineN3.getNetworks()
.then(result => {
    const {
        chainId,
        networks,
        defaultNetwork
    } = result;

    console.log('chainId: ' + chainId);
    // eg. 6

    console.log('Networks: ' + networks);
    // eg. ["MainNet", "TestNet", "N3TestNet"]

    console.log('Default network: ' + defaultNetwork);
    // eg. "N3TestNet"
})
.catch((error) => {
    const {type, description, data} = error;
    switch(type) {
        case 'NO_PROVIDER':
            console.log('No provider available.');
            break;
        case 'CONNECTION_DENIED':
            console.log('The user rejected the request to connect with your dApp');
            break;
        case 'CHAIN_NOT_MATCH':
            console.log('The currently opened chain does not match the type of the call chain, please switch the chain.');
            break;
        default:
            // Not an expected error object.  Just write the error to the console.
            console.error(error);
            break;
    }
});
```

### Response

```js
{
    chainId: 6,
    networks: ["MainNet", "TestNet", "N3TestNet"],
    defaultNetwork: "N3TestNet"
}
```
