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

adena.AddNetwork(network: {
  chainId: string;
  rpcUrl: string;
  chainName: string;
})

Params

Response

Add Network Result Model

Sample Request

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

Sample Response

{
    "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"
    }
}

Last updated