Skip to content

Commit

Permalink
fix(keplr-withdrwa): allow withdrawals to exchange and fix cctp filter (
Browse files Browse the repository at this point in the history
  • Loading branch information
jaredvu authored Dec 17, 2024
1 parent dec9a11 commit c93bfdb
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions src/views/forms/AccountManagementForms/SourceSelectMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,20 +90,24 @@ export const SourceSelectMenu = ({
[feesDecoratorProp]: getFeeDecoratorComponentForChainId(chain.type),
}))
.filter((chain) => {
// only cosmos chains are supported on kepler
// only Cosmos chains are supported on Keplr
if (isKeplrWallet) {
return selectedDydxChainId !== chain.value && SUPPORTED_COSMOS_CHAINS.includes(chain.value);
}
// only solana chains are supported on phantom
// only Solana chains are supported on Phantom
if (sourceAccount.walletInfo?.connectorType === ConnectorType.PhantomSolana) {
return selectedDydxChainId !== chain.value && chain.value.startsWith(solanaChainIdPrefix);
}
// other wallets do not support solana
// other wallets do not support Solana
if (chain.value.startsWith(solanaChainIdPrefix)) return false;

return true;
})
.filter((chain) => {
if (type === TransferType.withdrawal && isKeplrWallet) {
return true;
}

// if deposit and CCTPDepositOnly enabled, only return cctp tokens
if (type === TransferType.deposit && CCTPDepositOnly) {
return !!cctpTokensByChainId[chain.value];
Expand Down Expand Up @@ -136,12 +140,11 @@ export const SourceSelectMenu = ({
return (
<SearchSelectMenu
items={[
!isKeplrWallet &&
exchangeItems.length > 0 && {
group: 'exchanges',
groupLabel: stringGetter({ key: STRING_KEYS.EXCHANGES }),
items: exchangeItems,
},
exchangeItems.length > 0 && {
group: 'exchanges',
groupLabel: stringGetter({ key: STRING_KEYS.EXCHANGES }),
items: exchangeItems,
},
// only block privy wallets for deposits
isNotPrivyDeposit &&
chainItems.length > 0 && {
Expand Down

0 comments on commit c93bfdb

Please sign in to comment.