UNPKG

saepenatus

Version:

Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, mul

34 lines (30 loc) 900 B
import type { CustomNotification, Notify, UpdateNotification, Notification, PreflightNotificationsOptions } from '@web3-onboard/core' import { useWeb3Onboard } from '../context.js' import { useAppState } from './useAppState.js' export const useNotifications = (): [ Notification[], (updatedNotification: CustomNotification) => { dismiss: () => void update: UpdateNotification }, (update: Partial<Notify>) => void, (options: PreflightNotificationsOptions) => Promise<void | string> ] => { const web3Onboard = useWeb3Onboard() const customNotification = web3Onboard.state.actions.customNotification const updateNotify = web3Onboard.state.actions.updateNotify const preflightNotifications = web3Onboard.state.actions.preflightNotifications return [ useAppState('notifications'), customNotification, updateNotify, preflightNotifications ] }