Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/components/Image/util/images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const logos = [
'connector/taho',
'connector/zengo',
'connector/ledger',
'connector/ledgerLive',
'connector/portis',
'connector/binance',
'connector/coinbase',
Expand Down
8 changes: 8 additions & 0 deletions src/components/ImagesProvider/images/connector/ledgerLive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions src/components/ImagesProvider/images/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import taho from './connector/taho.svg'
import rabby from './connector/rabby.svg'
import zengo from './connector/zengo.svg'
import ledger from './connector/ledger.svg'
import ledgerLive from './connector/ledgerLive.svg'
import portis from './connector/portis.svg'
import binance from './connector/binance.svg'
import coinbase from './connector/coinbase.svg'
Expand Down Expand Up @@ -131,6 +132,7 @@ export default {
'connector/taho': taho.src,
'connector/zengo': zengo.src,
'connector/ledger': ledger.src,
'connector/ledgerLive': ledgerLive.src,
'connector/portis': portis.src,
'connector/binance': binance.src,
'connector/coinbase': coinbase.src,
Expand Down
4 changes: 4 additions & 0 deletions src/config/core/config/util/useWallet/useAutoConnect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ const useAutoConnect = (values: UseAutoConnectProps) => {
catch {}

const isDesktop = window.innerWidth >= 1000
const isLedgerLive = window.ethereum?.isLedgerLive
const isDAppBrowser = !isDesktop && hasInjectedProvider
const isLedger = activeWallet === wallets.ledger.id
const isBinance = hasInjectedProvider && window.ethereum?.isBinance
Expand All @@ -107,6 +108,9 @@ const useAutoConnect = (values: UseAutoConnectProps) => {
else if (isBinance) {
connect(wallets.binance.id)
}
else if (isLedgerLive) {
connect(wallets.ledgerLive.id)
}
else if (isDAppBrowser) {
connect(wallets.dAppBrowser.id)
}
Expand Down
3 changes: 2 additions & 1 deletion src/config/core/wallets/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import coinbase from './coinbase'
import gnosisSafe from './gnosisSafe'
import walletConnect from './walletConnect'
import monitorAddress from './monitorAddress'
import { braveWallet, dAppBrowser, trustWallet, metaMask, rabby, taho, okx } from './injected'
import { braveWallet, dAppBrowser, trustWallet, metaMask, rabby, taho, okx, ledgerLive } from './injected'


// ATTN The order here is equal to the order in the UI not counting filters
Expand All @@ -19,6 +19,7 @@ const wallets = {
dAppBrowser,
okx,
taho,
ledgerLive,

walletConnect,
ledger,
Expand Down
1 change: 1 addition & 0 deletions src/config/core/wallets/injected/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ export { default as metaMask } from './metaMask'
export { default as rabby } from './rabby'
export { default as taho } from './taho'
export { default as okx } from './okx'
export { default as ledgerLive } from './ledgerLive'
35 changes: 35 additions & 0 deletions src/config/core/wallets/injected/ledgerLive.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Network } from 'sdk'

import { Location, IsDisabled } from '../types'

import messages from '../../messages'


const getConnector = async () => {
const InjectedConnector = (await import('../../connectors/InjectedConnector')).default

const connector = new InjectedConnector({ shimDisconnect: false })

return connector
}

const ledgerLive = {
id: 'ledgerLive',
title: 'Ledger Live',
logo: 'connector/ledgerLive',
isAddTokenEnabled: false,
isInjectedWallet: true,
isLocalStorageSave: true,
activationMessage: messages.authMessages.waitingAuth,
networks: [
Network.Mainnet,
Network.Hoodi,
] as ChainIds[],
location: [ 'desktop', 'mobile' ] as Location,
isDisabled: (() => !window.ethereum?.isLedgerLive) as IsDisabled,
getProvider: () => window.ethereum,
getConnector,
} as const


export default ledgerLive
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ const AccountMenu: React.FC<AccountMenuProps> = (props) => {
const { activeWallet } = useConfig()
const claimsTotal = useClaimsTotal()

const isDappBrowser = activeWallet === wallets.dAppBrowser.id
const NON_DISCONNECTABLE_WALLET_IDS = new Set<string>([
wallets.dAppBrowser.id,
wallets.ledgerLive.id,
])

const shouldShowDisconnect = activeWallet !== null && !NON_DISCONNECTABLE_WALLET_IDS.has(activeWallet)

return (
<>
Expand All @@ -40,7 +45,7 @@ const AccountMenu: React.FC<AccountMenuProps> = (props) => {
}
<Menu className="mt-16" />
{
!isDappBrowser && (
shouldShowDisconnect && (
<DisconnectButton className="mt-8" />
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const useChangeChainDisabled = () => {
const disabledChainSwitchWallets: WalletIds[] = [
wallets.dAppBrowser.id,
wallets.gnosisSafe.id,
wallets.ledgerLive.id,
wallets.zenGo.id,
]

Expand Down