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

KeyTypeDescription

network.chainId

string

Chain ID

network.rpcUrl

string

Network RPC Url

network.chainName

string

Chain Name

Response

KeyTypeDescription

code

number

Code (success: 0)

status

string

Returns success or failure

type

string

Response type

message

string

Descriptive message of the result

data

object

Add Network Result Model

Add Network Result Model

KeyTypeDescription

chainId

string

Chain ID

rpcUrl

string

Network RPC Url

chainName

string

Chain Name

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