Adena Docs
  • Intro
  • â„šī¸User Guide
    • Download
    • Sign In
      • Connect Hardware Wallet
        • Ledger
        • Keystone
      • Set Up Air-gap Account
        • Air-gap Account
      • Advanced options
        • Create New Wallet
        • Import Wallet
        • Sign In With Google
    • Sidebar Menu
      • Account Details
      • Add Account
      • Settings
        • Connected Apps
        • Address Book
        • Change Network
        • Security & Privacy
          • Change Password
          • Reveal Seed Phrase
          • Export Private Key
          • Remove Account
          • Reset Wallet
        • About Adena
    • Wallet
      • Deposit
      • Send
        • Hardware Wallets
        • Air-gap Accounts
        • Advanced Accounts
      • Manage Tokens
    • NFTs
      • Asset Details
      • Manage Collectables
      • Deposit NFT
      • Send NFT
    • Explore
    • History
    • Web3 Interactions
      • Connect to a Dapp
      • Approve a Transaction
      • Add a Network
      • Switch Networks
  • đŸ› ī¸Integrations
    • Detect Wallet
    • Establish Connection
    • Get Account Info
    • Transactions
      • Sign & Send a Transaction
      • Sign Amino
      • Sign a Transaction
    • Network
      • Add a Custom Network
      • Switch Network
    • Detect Events
      • Detect an Account Change
      • Detect a Network Change
    • Use Adena Wallet SDK
      • JavaScript
    • Errors
    • Displaying Your App
    • Sample Usage
  • 📚Resources
    • FAQ
    • Audits
    • Brand Assets
      • Download Logo
      • Style Guide
      • Components
Powered by GitBook
On this page
  1. Integrations
  2. Network

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

Key
Type
Description

network.chainId

string

Chain ID

network.rpcUrl

string

Network RPC Url

network.chainName

string

Chain Name

Response

Key
Type
Description

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

Key
Type
Description

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"
    }
}
PreviousNetworkNextSwitch Network

Last updated 8 months ago

đŸ› ī¸