import { mobileWalletInstallMessage } from '../content' ; import { WalletModule , Helpers , CommonWalletOptions } from '../../../interfaces' ; import bitpieIcon from '../wallet-icons/icon-bitpie' ; function bitpie ( options ) { const { preferred , label , iconSrc , svg } = options ; return { name : label || 'Bitpie' , iconSrc , svg : svg || bitpieIcon , wallet : async ( helpers ) => { const { getProviderName , createModernProviderInterface , createLegacyProviderInterface } = helpers ; const provider = ( window as any ) . ethereum || ( ( window as any ) . web3 && ( window as any ) . web3 . currentProvider ) ; return { provider , interface : provider && getProviderName ( provider ) === 'Bitpie' ? typeof provider . enable === 'function' ? createModernProviderInterface ( provider ) : createLegacyProviderInterface ( provider ) : null } ; } , type : 'injected' , link : `https://bitpiehk.com` , installMessage : mobileWalletInstallMessage , mobile : true , preferred } ; } export default bitpie ;