Skip to content

Commit f100d3c

Browse files
committed
feat: add bsc network
1 parent 972b0fb commit f100d3c

File tree

2 files changed

+27
-5
lines changed

2 files changed

+27
-5
lines changed

apps/frontend/src/config/chains.ts

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import setup, { Chain, ChainIds } from '@sovryn/ethers-provider';
22

33
import {
4+
BSC_EXPLORER,
5+
BSC_RPC,
46
ETH_EXPLORER,
57
ETH_RPC,
68
RSK_EXPLORER,
@@ -52,6 +54,21 @@ export const chains: Chain[] = [
5254
rpcUrl: ETH_RPC[Environments.Testnet],
5355
blockExplorerUrl: ETH_EXPLORER[Environments.Testnet],
5456
},
57+
isMainnet()
58+
? {
59+
id: ChainIds.BSC_MAINNET,
60+
label: 'BNB Smart Chain',
61+
token: 'BNB',
62+
rpcUrl: BSC_RPC[Environments.Mainnet],
63+
blockExplorerUrl: BSC_EXPLORER[Environments.Mainnet],
64+
}
65+
: {
66+
id: ChainIds.BSC_TESTNET,
67+
label: 'BNB Smart Chain testnet',
68+
token: 'tBNB',
69+
rpcUrl: BSC_RPC[Environments.Testnet],
70+
blockExplorerUrl: BSC_EXPLORER[Environments.Testnet],
71+
},
5572
];
5673

5774
setup(chains);

apps/frontend/src/constants/infrastructure.ts

+10-5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export const ETH_RPC = {
3131
[Environments.Testnet]: ['https://rpc2.sepolia.org'],
3232
};
3333

34+
export const BSC_RPC = {
35+
[Environments.Mainnet]: ['https://bsc.publicnode.com'],
36+
[Environments.Testnet]: ['https://bsc-testnet.publicnode.com'],
37+
};
38+
3439
//TODO: refactor this into separate dictionary file once we add more chains
3540
export const RSK_EXPLORER = {
3641
[Environments.Mainnet]: 'https://explorer.rsk.co',
@@ -42,14 +47,14 @@ export const ETH_EXPLORER = {
4247
[Environments.Testnet]: 'https://sepolia.etherscan.io',
4348
};
4449

50+
export const BSC_EXPLORER = {
51+
[Environments.Mainnet]: 'https://bscscan.com',
52+
[Environments.Testnet]: 'https://testnet.bscscan.com',
53+
};
54+
4555
export const BTC_EXPLORER = {
4656
[Environments.Mainnet]: 'https://live.blockcypher.com/btc',
4757
[Environments.Testnet]: 'https://live.blockcypher.com/btc-testnet',
4858
};
4959

50-
export const ETH_EXPLORER = {
51-
[Environments.Mainnet]: 'https://etherscan.io',
52-
[Environments.Testnet]: 'https://sepolia.etherscan.io',
53-
};
54-
5560
export const ESTIMATOR_URI = process.env.REACT_APP_ESTIMATOR_URI;

0 commit comments

Comments
 (0)