Skip to content

Commit

Permalink
arbitrum debug flag
Browse files Browse the repository at this point in the history
  • Loading branch information
onnovisser committed Sep 18, 2023
1 parent 1a004a2 commit 9d40002
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 1 deletion.
6 changes: 6 additions & 0 deletions centrifuge-app/src/components/DebugFlags/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export type Key =
| 'batchMintNFTs'
| 'persistDebugFlags'
| 'showBase'
| 'showArbitrum'
| 'showUnusedFlags'
| 'allowInvestBelowMin'
| 'alternativeTheme'
Expand Down Expand Up @@ -77,6 +78,11 @@ export const flagsConfig: Record<Key, DebugFlagConfig> = {
default: false,
alwaysShow: true,
},
showArbitrum: {
type: 'checkbox',
default: false,
alwaysShow: true,
},
showTestNets: {
type: 'checkbox',
default: isTestEnv,
Expand Down
1 change: 1 addition & 0 deletions centrifuge-app/src/components/Root.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,7 @@ export function Root() {
walletConnectId={import.meta.env.REACT_APP_WALLETCONNECT_ID}
showAdvancedAccounts={debugState.showAdvancedAccounts as any}
showBase={debugState.showBase as any}
showArbitrum={debugState.showArbitrum as any}
showTestNets={debugState.showTestNets as any}
>
<OnboardingAuthProvider>
Expand Down
10 changes: 9 additions & 1 deletion centrifuge-react/src/components/WalletProvider/WalletDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Props = {
evmChains: EvmChains
showAdvancedAccounts?: boolean
showBase?: boolean
showArbitrum?: boolean
showTestNets?: boolean
}

Expand All @@ -40,9 +41,16 @@ const title = {
accounts: 'Choose account',
}

export function WalletDialog({ evmChains: allEvmChains, showAdvancedAccounts, showBase, showTestNets }: Props) {
export function WalletDialog({
evmChains: allEvmChains,
showAdvancedAccounts,
showBase,
showArbitrum,
showTestNets,
}: Props) {
const evmChains = Object.keys(allEvmChains)
.filter((chain) => (!showBase ? !['8453', '84531'].includes(chain) : true))
.filter((chain) => (!showArbitrum ? !['42161', '421613'].includes(chain) : true))
.filter((chain) => (!showTestNets ? !['5', '84531', '421613', '43113'].includes(chain) : true))
.reduce((obj, key) => {
obj[key] = allEvmChains[key]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ type WalletProviderProps = {
subscanUrl?: string
showAdvancedAccounts?: boolean
showBase?: boolean
showArbitrum?: boolean
showTestNets?: boolean
}

Expand All @@ -144,6 +145,7 @@ export function WalletProvider({
subscanUrl,
showAdvancedAccounts,
showBase,
showArbitrum,
showTestNets,
}: WalletProviderProps) {
if (!evmChainsProp[1]?.urls[0]) throw new Error('Mainnet should be defined in EVM Chains')
Expand Down Expand Up @@ -488,6 +490,7 @@ export function WalletProvider({
evmChains={evmChains}
showAdvancedAccounts={showAdvancedAccounts}
showBase={showBase}
showArbitrum={showArbitrum}
showTestNets={showTestNets}
/>
</WalletContext.Provider>
Expand Down

0 comments on commit 9d40002

Please sign in to comment.