⚛️
Leap Cosmos
  • Introduction
  • for dapps: Connect to Leap
    • Introduction
    • Optimizing Wallet Connectivity for Cosmos Dapps
    • Add Leap to existing Keplr integration
    • Add Leap to a new dapp
    • Suggest chain : Add Leap to a non-native chain
    • Add Leap to a Secret dapp
    • Wallet Connect
    • Wallet Adapters
      • Cosmos Kit
      • Shuttle
    • API Reference
  • for chains: integrate into Leap
    • Introduction
  • for SEI dapps: Connect to Compass
    • Connect to Compass
  • FOR SEI EVM DAPPS: CONNECT TO COMPASS
    • Connect to Compass
    • Supported RPC methods
  • Leap Metamask Snap
    • Introduction
    • Integrating Snaps
      • Metamask Cosmos Snap
      • Cosmos Snap Provider
      • Cosmos Kit
  • Embedded Wallet SDK
    • Embedded Wallet SDK React
    • Embedded Wallet Provider
    • Migration
    • Usage without UI
  • Elements
    • Introduction
    • Get Started
    • Integrate via CDN / Script Tag
    • Integrate as an Embed
    • Components
      • Aggregated Swaps
      • IBC Only Swaps
      • Fiat On-ramp
      • IBC Transfer
      • Multi View
    • Theming
      • Using CSS Variables
      • Advanced Customisations
    • Use Elements Without the UI
    • Tab Config
    • Using Skip API Key
  • Cosmos Nodes
    • Fallback Falooda : Node Fallback System
    • (Coming Soon) Blockchain Node Setup Guide
    • (Coming Soon) Monitoring Blockchain Node Performance
  • RESOURCES
    • Leap Assets
Powered by GitBook
On this page
  1. for dapps: Connect to Leap

Add Leap to existing Keplr integration

If Connect to Keplr already exists on your dapp, adding Leap is easy because we've followed a similar API structure

Similar to Keplr, you can find an object named 'leap' in the window object, which can be accessed using window.leap

To support Leap cosmos wallet on a dapp where Keplr is already integrated, follow these steps:

  • A Modal will be required for a user to select Leap or Keplr.

  • The dapp will have to maintain a persistent state to store which wallet is connected.

  • Based on the connected wallet, set

window.wallet = window.leap

  • Also, add the following event accordingly:

window.addEventListener('leap_keystorechange', reconnectWallet)
  • Now replace window.keplr with window.wallet in the whole application

  • Replace the following:

window.getOfflineSigner
window.getOfflineSignerOnlyAmino
window.getOfflineSignerAuto
window.getEnigmaUtils

with

window.leap.getOfflineSigner
window.leap.getOfflineSignerOnlyAmino
window.leap.getOfflineSignerAuto
window.leap.getEnigmaUtils
PreviousOptimizing Wallet Connectivity for Cosmos DappsNextAdd Leap to a new dapp

Last updated 2 years ago

For Leap assets, such as the wallet name, logo, and redirection link, please refer to our . These assets are useful in case Leap wallet is not installed.

documentation here