@subwallet-connect/taho
Version:
Taho SDK wallet module for connecting to Web3-Onboard. 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 ja
32 lines (31 loc) • 1.18 kB
JavaScript
import { createEIP1193Provider } from '@subwallet-connect/common';
import detectEthereumProvider from 'tallyho-detect-provider';
import TallyHoOnboarding from 'tallyho-onboarding';
function tahoWallet() {
if (typeof window === 'undefined')
return () => null;
return () => {
return {
label: 'Taho',
type: 'evm',
injectedNamespace: 'tally',
checkProviderIdentity: ({ provider }) => {
!!provider && !!provider['isTally'];
},
getIcon: async () => (await import('./icon.js')).default,
getInterface: async () => {
const provider = await detectEthereumProvider({ mustBeTallyHo: true });
if (!provider) {
const onboarding = new TallyHoOnboarding();
onboarding.startOnboarding();
throw new Error('Please install Taho to use this wallet');
}
else {
return { provider: createEIP1193Provider(window.tally) };
}
},
platforms: ['desktop']
};
};
}
export default tahoWallet;