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

Switch Network

A web application may request Adena to switch the current network settings to a new one via the SwitchNetwork method. Upon the user's approval, Adena will switch the network to the one requested by the app.

Code

adena.SwitchNetwork(chainId: string)

Params

Key
Type
Description

network.chainId

string

Chain ID

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

Switch Network Result Model

Switch Network Result Model

Key
Type
Description

chainId

string

Chain ID

Sample Request

await adena.SwitchNetwork('dev-1')

Sample Response

{
    "code": 0,
    "status": "success",
    "type": "SWITCH_NETWORK_SUCCESS",
    "message": "The network has been successfully changed.",
    "data": {
        "chainId": "dev-1"
    }
}
PreviousAdd a Custom NetworkNextDetect Events

Last updated 1 year ago

đŸ› ī¸