Skip to content

Commit

Permalink
add default target evm token
Browse files Browse the repository at this point in the history
  • Loading branch information
lykalabrada committed Oct 9, 2023
1 parent 5810e0f commit 523efd2
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -225,16 +225,27 @@ export function ConvertScreen(props: Props): JSX.Element {

function getListByDomain(listType: TokenListType): DomainToken[] {
if (listType === TokenListType.To) {
const defaultEvmTargetToken = {
tokenId: `${sourceToken.tokenId}-EVM`,
available: sourceToken.available,
token: {
...sourceToken.token,
name: `${sourceToken.token.name} for EVM`,
domainType: DomainType.EVM,
},
};
if (domain === DomainType.DVM && sourceToken.tokenId === "0") {
return [
...evmTokens.filter((token) => token.tokenId === "0-EVM"),
defaultEvmTargetToken,
...dvmTokens.filter((token) => token.tokenId === "0_utxo"),
];
} else if (
domain === DomainType.DVM &&
sourceToken.tokenId === "0_utxo"
) {
return dvmTokens.filter((token) => token.tokenId === "0");
} else if (domain === DomainType.DVM) {
return [defaultEvmTargetToken];
} else if (domain === DomainType.EVM && sourceToken.tokenId === "0-EVM") {
return dvmTokens.filter((token) => token.tokenId === "0");
}
Expand Down

0 comments on commit 523efd2

Please sign in to comment.