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

36 lines (31 loc) 1.05 kB
import type { WalletInit } from '@web3-onboard/common' import type { ExternalProvider } from '@ethersproject/providers' import { createEIP1193Provider } from '@web3-onboard/common' declare const window: Window & { zeal: ExternalProvider & { isZeal: boolean } } function zealWallet(): WalletInit { if (typeof window === 'undefined') return () => null return () => ({ label: 'Zeal', injectedNamespace: 'zeal', checkProviderIdentity: ({ provider }: { provider: any }) => { !!provider && !!provider['isZeal'] }, getIcon: async () => (await import('./icon.js')).default, getInterface: async () => { if ( window.hasOwnProperty('zeal') && 'isZeal' in window.zeal && window.zeal.isZeal ) { return { provider: createEIP1193Provider(window.zeal) } } else { window.open('https://www.zeal.app/', '_blank') throw new Error('Please Install Zeall to use this wallet') } }, platforms: ['desktop'] }) } export default zealWallet