Skip to content

Add GridplusHDWallet exclusion for BCH, DOGE, LTC, ZEC chain support checks #11297

@coderabbitai

Description

@coderabbitai

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:

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

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions