You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
503 B
20 lines
503 B
2 years ago
|
import {
|
||
|
BUYABLE_CHAINS_MAP,
|
||
|
CHAIN_IDS,
|
||
|
} from '../../../shared/constants/network';
|
||
|
|
||
|
export const formatMoonpaySymbol = (symbol, chainId = CHAIN_IDS.MAINNET) => {
|
||
|
if (!symbol) {
|
||
|
return symbol;
|
||
|
}
|
||
|
let _symbol = symbol;
|
||
|
if (chainId === CHAIN_IDS.POLYGON || chainId === CHAIN_IDS.BSC) {
|
||
|
_symbol = `${_symbol}_${BUYABLE_CHAINS_MAP?.[
|
||
|
chainId
|
||
|
]?.network.toUpperCase()}`;
|
||
|
} else if (chainId === CHAIN_IDS.AVALANCHE) {
|
||
|
_symbol = `${_symbol}_CCHAIN`;
|
||
|
}
|
||
|
return _symbol;
|
||
|
};
|