Skip to content

Commit

Permalink
add opbnb
Browse files Browse the repository at this point in the history
  • Loading branch information
TiyoSheng committed Feb 19, 2024
1 parent fb43fbd commit 588157d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
21 changes: 20 additions & 1 deletion packages/client/src/mud/supportedChains.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ arbitrumGoerli.rpcUrls.default.http = ['https://arbitrum-goerli.publicnode.com']
arbitrumGoerli.rpcUrls.default.webSocket = [ 'wss://arbitrum-goerli.publicnode.com'];
arbitrumGoerli.indexerUrl = [ 'https://indexer_arb.0xmssp.xyz/trpc'];


const testnet = {
name: "Mississippi testnet",
id: 33784,
Expand Down Expand Up @@ -52,8 +53,26 @@ const redstone = {
}
}

const opBNB = {
id: 204,
name: 'opBNB Mainnet',
network: 'opBNB Mainnet',
nativeCurrency: {
name: 'BNB',
symbol: 'BNB',
decimals: 18,
},
rpcUrls: {
public: {
http: ['https://opbnb-mainnet-rpc.bnbchain.org'],
webSocket: ['https://opbnb-mainnet-rpc.bnbchain.org'],
},
default: { http: ['https://opbnb-mainnet-rpc.bnbchain.org'], webSocket: ['https://opbnb-mainnet-rpc.bnbchain.org'] },
}
}

/*
* See https://mud.dev/tutorials/minimal/deploy#run-the-user-interface
* for instructions on how to add networks.
*/
export const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet, sepolia, arbitrumGoerli, testnet, redstone];
export const supportedChains: MUDChain[] = [mudFoundry, latticeTestnet, sepolia, arbitrumGoerli, testnet, redstone, opBNB];
5 changes: 3 additions & 2 deletions packages/client/src/pages/home/header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ const HomeHeader = (props: IProps) => {
<div className='network-item' onClick={() => changeNetwork(33784)}>Mississippi Testnet</div>
<div className='network-item' onClick={() => changeNetwork(17001)}>Redstone Testnet</div>
<div className='network-item' onClick={() => changeNetwork(421613)}>Arbitrum Goerli</div>
<div className='network-item' onClick={() => changeNetwork(204)}>opBNB</div>

<div className='network-item' >Starknet(Coming Soon)</div>
{
Expand All @@ -130,8 +131,8 @@ const HomeHeader = (props: IProps) => {
}
</div>
{
walletAddress ?
<UserAddress address={walletAddress} account={walletBalance + 'ETH'}/>
walletAddress ?
<UserAddress address={walletAddress} account={walletBalance + (network?.walletClient?.chain?.id == 204 ? 'BNB' : 'ETH')}/>
:
<button className="play-btn mi-btn" onClick={props.onPlayBtnClick}>PLAY NOW</button>
}
Expand Down

0 comments on commit 588157d

Please sign in to comment.