-
Notifications
You must be signed in to change notification settings - Fork 191
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: lazy load wallet adapters part 1
- Loading branch information
1 parent
3444d54
commit 4e120d9
Showing
12 changed files
with
99 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,16 @@ | ||
import { KkRestAdapter } from '@keepkey/hdwallet-keepkey-rest' | ||
import { WebUSBKeepKeyAdapter } from '@shapeshiftoss/hdwallet-keepkey-webusb' | ||
import { KeepKeyIcon } from 'components/Icons/KeepKeyIcon' | ||
import type { SupportedWalletInfo } from 'context/WalletProvider/config' | ||
|
||
export const KeepKeyConfig: Omit<SupportedWalletInfo, 'routes'> = { | ||
// Allow multiple transports per wallet. order is in first attempt priority, with fail over to next transport | ||
adapters: [KkRestAdapter, WebUSBKeepKeyAdapter], | ||
adapters: [ | ||
{ | ||
loadAdapter: () => import('@keepkey/hdwallet-keepkey-rest').then(m => m.KkRestAdapter), | ||
}, | ||
{ | ||
loadAdapter: () => | ||
import('@shapeshiftoss/hdwallet-keepkey-webusb').then(m => m.WebUSBKeepKeyAdapter), | ||
}, | ||
], | ||
icon: KeepKeyIcon, | ||
name: 'KeepKey', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { KeplrAdapter } from '@shapeshiftoss/hdwallet-keplr' | ||
import { KeplrIcon } from 'components/Icons/KeplrIcon' | ||
import type { SupportedWalletInfo } from 'context/WalletProvider/config' | ||
|
||
export const KeplrConfig: Omit<SupportedWalletInfo, 'routes'> = { | ||
adapters: [KeplrAdapter], | ||
adapters: [ | ||
{ | ||
loadAdapter: () => import('@shapeshiftoss/hdwallet-keplr').then(m => m.KeplrAdapter), | ||
}, | ||
], | ||
icon: KeplrIcon, | ||
name: 'Keplr', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,13 @@ | ||
import { WebUSBLedgerAdapter } from '@shapeshiftoss/hdwallet-ledger-webusb' | ||
import { LedgerIcon } from 'components/Icons/LedgerIcon' | ||
import type { SupportedWalletInfo } from 'context/WalletProvider/config' | ||
|
||
export const LedgerConfig: Omit<SupportedWalletInfo, 'routes'> = { | ||
adapters: [WebUSBLedgerAdapter], | ||
adapters: [ | ||
{ | ||
loadAdapter: () => | ||
import('@shapeshiftoss/hdwallet-ledger-webusb').then(m => m.WebUSBLedgerAdapter), | ||
}, | ||
], | ||
icon: LedgerIcon, | ||
name: 'Ledger', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
import { XDEFIAdapter } from '@shapeshiftoss/hdwallet-xdefi' | ||
import { XDEFIIcon } from 'components/Icons/XDEFIIcon' | ||
import type { SupportedWalletInfo } from 'context/WalletProvider/config' | ||
|
||
export const XDEFIConfig: Omit<SupportedWalletInfo, 'routes'> = { | ||
adapters: [XDEFIAdapter], | ||
adapters: [ | ||
{ | ||
loadAdapter: () => import('@shapeshiftoss/hdwallet-xdefi').then(m => m.XDEFIAdapter), | ||
}, | ||
], | ||
icon: XDEFIIcon, | ||
name: 'XDEFI', | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters