IBC Transfer Modal

If you want to have the IBCTransfer component inside a modal on your dApp, we recommend you to use the IBCTransferModal component. We handle all the states and edge-cases, so you can focus on your dApp!

Usage

import {
  ElementsProvider,
  IBCTransferModal,
  WalletType
} from '@leapwallet/elements'
import { useState } from 'react'

import '@leapwallet/elements/styles.css'

const YourDapp = () => {
  const [isOpen, setIsOpen] = useState(false)
  
  // trigger the dApp's connect wallet flow
  const connectWallet = () => {}
  
  // set this to the currently connected wallet
  const connectedWalletType = WalletType.LEAP

  return (
    <div className="leap-ui">
      <button onClick={() => setIsOpen(true)}>
        Open IBC Transfer Modal
      </button>
      <ElementsProvider
        connectWallet={connectWallet}
        connectedWalletType={connectedWalletType}
      >
        <IBCTransferModal
          isOpen={isOpen}
          setIsOpen={setIsOpen}
        />
      </ElementsProvider>
    </div>
  )
}

Props

isOpen (required)

A state variable for the open state of the modal

setIsOpen (required)

A function to change the open state of the modal.

All props of the IBCTransfer component are supported in IBCTransferModal

Last updated