Import

import { useOpenWalletModal } from '@0xsequence/wallet-widget'

Usage

import { useOpenWalletModal } from '@0xsequence/wallet-widget'

function App() {
  // Get the function to open/close the wallet modal
  const { setOpenWalletModal } = useOpenWalletModal()
  
  // Function to handle opening the wallet inventory
  const handleViewInventory = () => {
    setOpenWalletModal(true) // Open the wallet modal to view tokens
  }
  
  return (
    <button 
      onClick={handleViewInventory}
      title="Inventory"
    >
      View all tokens in your wallet
    </button>
  )
}

Return Type: UseOpenWalletModalReturnType

The hook returns an object with the following properties:

type UseOpenWalletModalReturnType = {
  setOpenWalletModal: (isOpen: boolean) => void
  openWalletModalState: boolean
}

Properties

setOpenWalletModal

(isOpen: boolean) => void

Function to open or close the Wallet modal.

Parameters:

ParameterTypeDescription
isOpenbooleanWhether the modal should be open (true) or closed (false)

openWalletModalState

boolean

The current open state of the Wallet modal (true if open, false if closed).

Notes

This hook provides methods to control the Wallet Inventory modal that allows users to view their tokens and NFTs. The Wallet modal displays all tokens, NFTs and collectibles present in the connected wallet.