1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-10-22 11:22:43 +02:00

Ability to buy native currency and tokens on Optimism and Arbitrum, using Transak (#16031)

This commit is contained in:
Nicolas Ferro 2022-09-29 16:47:41 +02:00 committed by GitHub
parent 21c9fe2de9
commit 47f136380f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 3 deletions

View File

@ -374,6 +374,7 @@ const SUPPORTED_CURRENCY_SYMBOLS = {
SHIB: 'SHIB',
SKL: 'SKL',
SNX: 'SNX',
SPA: 'SPA',
STETH: 'STETH',
STORJ: 'STORJ',
SUKU: 'SUKU',
@ -577,9 +578,7 @@ export const BUYABLE_CHAINS_MAP: {
| typeof CHAIN_IDS.LOCALHOST
| typeof CHAIN_IDS.PALM
| typeof CHAIN_IDS.HARMONY
| typeof CHAIN_IDS.OPTIMISM
| typeof CHAIN_IDS.OPTIMISM_TESTNET
| typeof CHAIN_IDS.ARBITRUM
>]: BuyableChainSettings;
} = {
[CHAIN_IDS.MAINNET]: {
@ -844,6 +843,24 @@ export const BUYABLE_CHAINS_MAP: {
showOnlyCurrencies: [SUPPORTED_CURRENCY_SYMBOLS.CELO],
},
},
[CHAIN_IDS.OPTIMISM]: {
nativeCurrency: CURRENCY_SYMBOLS.ETH,
network: 'optimism',
transakCurrencies: [
SUPPORTED_CURRENCY_SYMBOLS.ETH,
SUPPORTED_CURRENCY_SYMBOLS.USDC,
],
},
[CHAIN_IDS.ARBITRUM]: {
nativeCurrency: CURRENCY_SYMBOLS.ARBITRUM,
network: 'arbitrum',
transakCurrencies: [
SUPPORTED_CURRENCY_SYMBOLS.ARBITRUM,
SUPPORTED_CURRENCY_SYMBOLS.SPA,
SUPPORTED_CURRENCY_SYMBOLS.USDC,
SUPPORTED_CURRENCY_SYMBOLS.USDS,
],
},
};
export const FEATURED_RPCS: RPCDefinition[] = [

View File

@ -721,7 +721,7 @@ export function getIsBuyableMoonpayToken(state, symbol) {
const chainId = getCurrentChainId(state);
const _symbol = formatMoonpaySymbol(symbol, chainId);
return Boolean(
BUYABLE_CHAINS_MAP?.[chainId]?.moonPay.showOnlyCurrencies?.includes(
BUYABLE_CHAINS_MAP?.[chainId]?.moonPay?.showOnlyCurrencies?.includes(
_symbol,
),
);