Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to buy native currency and tokens on Optimism and Arbitrum #16031

Merged
merged 1 commit into from
Sep 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions shared/constants/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -374,6 +374,7 @@ const SUPPORTED_CURRENCY_SYMBOLS = {
SHIB: 'SHIB',
SKL: 'SKL',
SNX: 'SNX',
SPA: 'SPA',
STETH: 'STETH',
STORJ: 'STORJ',
SUKU: 'SUKU',
Expand Down Expand Up @@ -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]: {
Expand Down Expand Up @@ -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[] = [
Expand Down
2 changes: 1 addition & 1 deletion ui/selectors/selectors.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
),
);
Expand Down