Skip to content

Commit

Permalink
Add Gnosis Chain to the popular custom network list (#19324)
Browse files Browse the repository at this point in the history
  • Loading branch information
alebanzas authored Jul 26, 2023
1 parent 9797d9a commit 058f3a3
Show file tree
Hide file tree
Showing 2 changed files with 69 additions and 0 deletions.
47 changes: 47 additions & 0 deletions app/images/gnosis.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions shared/constants/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ export const CHAIN_IDS = {
MOONBEAM_TESTNET: '0x507',
MOONRIVER: '0x505',
CRONOS: '0x19',
GNOSIS: '0x64',
} as const;

/**
Expand All @@ -181,6 +182,7 @@ export const HARMONY_DISPLAY_NAME = 'Harmony Mainnet Shard 0';
export const PALM_DISPLAY_NAME = 'Palm';
export const AURORA_DISPLAY_NAME = 'Aurora Mainnet';
export const CELO_DISPLAY_NAME = 'Celo Mainnet';
export const GNOSIS_DISPLAY_NAME = 'Gnosis';

export const infuraProjectId = process.env.INFURA_PROJECT_ID;
export const getRpcUrl = ({
Expand Down Expand Up @@ -218,6 +220,7 @@ export const CURRENCY_SYMBOLS = {
BUSD: 'BUSD',
CELO: 'CELO',
DAI: 'DAI',
GNOSIS: 'XDAI',
ETH: 'ETH',
FANTOM: 'FTM',
HARMONY: 'ONE',
Expand Down Expand Up @@ -248,6 +251,7 @@ export const OPTIMISM_TOKEN_IMAGE_URL = './images/optimism.svg';
export const PALM_TOKEN_IMAGE_URL = './images/palm.svg';
export const AURORA_TOKEN_IMAGE_URL = './images/aurora.png';
export const CELO_TOKEN_IMAGE_URL = './images/celo.svg';
export const GNOSIS_TOKEN_IMAGE_URL = './images/gnosis.svg';

export const INFURA_PROVIDER_TYPES = [
NETWORK_TYPES.MAINNET,
Expand Down Expand Up @@ -382,6 +386,7 @@ export const CHAIN_ID_TO_NETWORK_IMAGE_URL_MAP = {
[CHAIN_IDS.PALM]: PALM_TOKEN_IMAGE_URL,
[CHAIN_IDS.AURORA]: AURORA_TOKEN_IMAGE_URL,
[CHAIN_IDS.CELO]: CELO_TOKEN_IMAGE_URL,
[CHAIN_IDS.GNOSIS]: GNOSIS_TOKEN_IMAGE_URL,
} as const;

export const NETWORK_ID_TO_ETHERS_NETWORK_NAME_MAP = {
Expand Down Expand Up @@ -410,6 +415,7 @@ export const NATIVE_CURRENCY_TOKEN_IMAGE_MAP = {
[CURRENCY_SYMBOLS.OPTIMISM]: OPTIMISM_TOKEN_IMAGE_URL,
[CURRENCY_SYMBOLS.CELO]: CELO_TOKEN_IMAGE_URL,
[CURRENCY_SYMBOLS.AURORA_ETH]: ETH_TOKEN_IMAGE_URL,
[CURRENCY_SYMBOLS.GNOSIS]: GNOSIS_TOKEN_IMAGE_URL,
} as const;

export const INFURA_BLOCKED_KEY = 'countryBlocked';
Expand Down Expand Up @@ -514,6 +520,11 @@ export const ETHERSCAN_SUPPORTED_NETWORKS = {
subdomain: `${defaultEtherscanSubdomainPrefix}-moonriver`,
networkId: parseInt(CHAIN_IDS.MOONRIVER, 16).toString(),
},
[CHAIN_IDS.GNOSIS]: {
domain: 'gnosisscan.io',
subdomain: `${defaultEtherscanSubdomainPrefix}-gnosis`,
networkId: parseInt(CHAIN_IDS.GNOSIS, 16).toString(),
},
};

export const CHAIN_ID_TO_GAS_LIMIT_BUFFER_MAP = {
Expand Down Expand Up @@ -549,6 +560,7 @@ export const BUYABLE_CHAINS_MAP: {
| typeof CHAIN_IDS.MOONBEAM_TESTNET
| typeof CHAIN_IDS.LINEA_GOERLI
| typeof CHAIN_IDS.GOERLI
| typeof CHAIN_IDS.GNOSIS
>]: BuyableChainSettings;
} = {
[CHAIN_IDS.MAINNET]: {
Expand Down Expand Up @@ -718,6 +730,16 @@ export const FEATURED_RPCS: RPCDefinition[] = [
imageUrl: CELO_TOKEN_IMAGE_URL,
},
},
{
chainId: CHAIN_IDS.GNOSIS,
nickname: GNOSIS_DISPLAY_NAME,
rpcUrl: `https://rpc.gnosischain.com`,
ticker: CURRENCY_SYMBOLS.GNOSIS,
rpcPrefs: {
blockExplorerUrl: 'https://gnosisscan.io',
imageUrl: GNOSIS_TOKEN_IMAGE_URL,
},
},
];

/**
Expand Down

0 comments on commit 058f3a3

Please sign in to comment.