bridge_ui: Block transfers of aUSD from Karura
This commit is contained in:
parent
cf8c97082b
commit
ff9f200fb5
|
@ -26,7 +26,11 @@ import useMarketsMap from "../../hooks/useMarketsMap";
|
||||||
import { NFTParsedTokenAccount } from "../../store/nftSlice";
|
import { NFTParsedTokenAccount } from "../../store/nftSlice";
|
||||||
import { selectTransferTargetChain } from "../../store/selectors";
|
import { selectTransferTargetChain } from "../../store/selectors";
|
||||||
import { balancePretty } from "../../utils/balancePretty";
|
import { balancePretty } from "../../utils/balancePretty";
|
||||||
import { AVAILABLE_MARKETS_URL, CHAINS_BY_ID } from "../../utils/consts";
|
import {
|
||||||
|
AVAILABLE_MARKETS_URL,
|
||||||
|
CHAINS_BY_ID,
|
||||||
|
getIsTokenTransferDisabled,
|
||||||
|
} from "../../utils/consts";
|
||||||
import { shortenAddress } from "../../utils/solana";
|
import { shortenAddress } from "../../utils/solana";
|
||||||
import NFTViewer from "./NFTViewer";
|
import NFTViewer from "./NFTViewer";
|
||||||
|
|
||||||
|
@ -556,6 +560,10 @@ export default function TokenPicker({
|
||||||
option.mintKey +
|
option.mintKey +
|
||||||
(option.tokenId || "")
|
(option.tokenId || "")
|
||||||
}
|
}
|
||||||
|
disabled={getIsTokenTransferDisabled(
|
||||||
|
chainId,
|
||||||
|
option.mintKey
|
||||||
|
)}
|
||||||
>
|
>
|
||||||
<RenderOption account={option} />
|
<RenderOption account={option} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
@ -580,6 +588,7 @@ export default function TokenPicker({
|
||||||
key={
|
key={
|
||||||
option.publicKey + option.mintKey + (option.tokenId || "")
|
option.publicKey + option.mintKey + (option.tokenId || "")
|
||||||
}
|
}
|
||||||
|
disabled={getIsTokenTransferDisabled(chainId, option.mintKey)}
|
||||||
>
|
>
|
||||||
<RenderOption account={option} />
|
<RenderOption account={option} />
|
||||||
</ListItem>
|
</ListItem>
|
||||||
|
|
|
@ -1456,3 +1456,15 @@ export const COLOR_BY_CHAIN_ID: { [key in ChainId]?: string } = {
|
||||||
[CHAIN_ID_KARURA]: "#FF4B3B",
|
[CHAIN_ID_KARURA]: "#FF4B3B",
|
||||||
[CHAIN_ID_ACALA]: "#E00F51",
|
[CHAIN_ID_ACALA]: "#E00F51",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const DISABLED_TOKEN_TRANSFERS: { [key in ChainId]?: string[] } = {
|
||||||
|
[CHAIN_ID_KARURA]: [
|
||||||
|
"0x0000000000000000000100000000000000000081", // aUSD
|
||||||
|
],
|
||||||
|
};
|
||||||
|
export const getIsTokenTransferDisabled = (
|
||||||
|
chainId: ChainId,
|
||||||
|
tokenAddress: string
|
||||||
|
) => {
|
||||||
|
return !!DISABLED_TOKEN_TRANSFERS[chainId]?.includes(tokenAddress);
|
||||||
|
};
|
||||||
|
|
Loading…
Reference in New Issue