-
Notifications
You must be signed in to change notification settings - Fork 200
Closed
Closed
Copy link
Description
Context
Following the changes in shapeshift/hdwallet#758, we should add an additional layer of protection in the walletSupportsChain function by excluding GridplusHDWallet for certain UTXO chains.
Requested Changes
Add !(wallet instanceof GridplusHDWallet) check to the following cases in src/hooks/useWalletSupportsChain/useWalletSupportsChain.ts:
- BCH (Bitcoin Cash)
- DOGE (Dogecoin)
- LTC (Litecoin)
- ZEC (Zcash)
Currently these cases have:
return supportsBTC(wallet) && !(wallet instanceof PhantomHDWallet)They should be updated to:
return supportsBTC(wallet) && !(wallet instanceof PhantomHDWallet) && !(wallet instanceof GridplusHDWallet)And here too:
web/src/state/slices/portfolioSlice/utils/index.ts
Lines 359 to 402 in f61da34
| export const isAssetSupportedByWallet = (assetId: AssetId, wallet: HDWallet): boolean => { | |
| if (!assetId) return false | |
| const { chainId } = fromAssetId(assetId) | |
| switch (chainId) { | |
| case ethChainId: | |
| return supportsETH(wallet) | |
| case avalancheChainId: | |
| return supportsAvalanche(wallet) | |
| case optimismChainId: | |
| return supportsOptimism(wallet) | |
| case bscChainId: | |
| return supportsBSC(wallet) | |
| case polygonChainId: | |
| return supportsPolygon(wallet) | |
| case gnosisChainId: | |
| return supportsGnosis(wallet) | |
| case arbitrumChainId: | |
| return supportsArbitrum(wallet) | |
| case arbitrumNovaChainId: | |
| return supportsArbitrumNova(wallet) | |
| case baseChainId: | |
| return supportsBase(wallet) | |
| case btcChainId: | |
| return supportsBTC(wallet) | |
| case ltcChainId: | |
| return supportsBTC(wallet) && !(wallet instanceof PhantomHDWallet) | |
| case dogeChainId: | |
| return supportsBTC(wallet) && !(wallet instanceof PhantomHDWallet) | |
| case bchChainId: | |
| return supportsBTC(wallet) && !(wallet instanceof PhantomHDWallet) | |
| case cosmosChainId: | |
| return supportsCosmos(wallet) | |
| case thorchainChainId: | |
| return supportsThorchain(wallet) | |
| case mayachainChainId: | |
| return supportsMayachain(wallet) | |
| case solanaChainId: | |
| return supportsSolana(wallet) | |
| case suiChainId: | |
| return supportsSui(wallet) | |
| default: | |
| return false | |
| } | |
| } |
References
- Original request: feat: zcash support #11290 (comment)
- Requested by: @gomesalexandre
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done