Martian Wallet Dev Docs
HomeChrome web store
Search
⌃K
Links
Introduction
🏗
Integration
Detecting the Provider
Establishing a Connection
Displaying Your App
⚙
methods
Aptos
Generate Transaction
Sign Transaction
Submit Transaction
Sign and Submit Transaction
Sign Generic Transaction
Generate Sign and Submit Transaction
Create Collection
Create Token
Add Network
Change Network
Get Networks
Get Transaction
Get Transactions
Get Account Transactions
Get Account Resources
Get Account
Get Chain Id
Get Ledger Info
Sui
Sign Message
Get Network
Get Current Blockchain
Cancel Submitted Transactions
Network Change Event
Account Change Event
Powered By GitBook

Get Chain Id

This method can be used to fetch current chain id
Below is an example code describing the way to fetch chain id.
getChainId()
// Fetch chain id
const chainId = await window.martian.getChainId();
console.log(chainId);
// above code output
{
"chainId": 20
}
Previous
Get Account
Next
Get Ledger Info
Last modified 1yr ago