# Add a Custom Network

A web application may request Adena to **add a custom Gnoland network to Adena** via the `AddNetwork` method. Upon the user's approval, the network will be added to the list of available networks on the Change Network page in the Settings menu.

#### Code

```javascript
adena.AddNetwork(network: {
  chainId: string;
  rpcUrl: string;
  chainName: 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><tr><td><code>network.rpcUrl</code></td><td><code>string</code></td><td>Network RPC Url</td></tr><tr><td><code>network.chainName</code></td><td><code>string</code></td><td>Chain Name</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>Add Network Result Model</strong></td></tr></tbody></table>

#### Add 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><tr><td><code>rpcUrl</code></td><td><code>string</code></td><td>Network RPC Url</td></tr><tr><td><code>chainName</code></td><td><code>string</code></td><td>Chain Name</td></tr></tbody></table>

#### Sample Request

```javascript
await adena.AddNetwork({
  chainId: 'dev-1',
  chainName: 'My Network',
  rpcUrl: 'http://localhost:8888',
});
```

#### Sample Response

```json
{
    "code": 0,
    "status": "success",
    "type": "ADD_NETWORK_SUCCESS",
    "message": "The network has been successfully added.",
    "data": {
        "chainId": "dev-1",
        "chainName": "My Network",
        "rpcUrl": "http://localhost:8888"
    }
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.adena.app/integrations/network/add-a-custom-network.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
