Martian Wallet Dev Docs
HomeChrome web store
  • 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 Transaction Block
      • Sign and Execute Transaction
      • Get Public Key
      • Get Old Address
      • Get Accounts
    • Sign Message
    • Get Network
    • Get Current Blockchain
    • Cancel Submitted Transactions
    • Network Change Event
    • Account Change Event
Powered by GitBook
On this page
  1. Integration

Detecting the Provider

PreviousIntroductionNextEstablishing a Connection

Last updated 2 years ago

To detect if a user has already installed Martian wallet, a web application should check for the existence of an aptos object. Martian wallet browser extension will inject an aptos object into the of any web application the user visits.

const isMartianWalletInstalled = window.martian

If Martian wallet is not installed, we recommend you redirect your users to . Altogether, this may look like the following.

const getProvider = () => {
  if ("martian" in window) {
    return(window.martian);
  }
  window.open("https://www.martianwallet.xyz/", "_blank");
};
🏗️
window
our website