Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
185cb525
Unverified
Commit
185cb525
authored
Sep 15, 2023
by
Matthew Spector
Committed by
GitHub
Sep 15, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
chore: Remove Hardcoded Uni Wallet Supported Chains List (#7320)
parent
92cf5b42
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
18 deletions
+2
-18
ChainSelector.tsx
src/components/NavBar/ChainSelector.tsx
+2
-10
chains.ts
src/constants/chains.ts
+0
-8
No files found.
src/components/NavBar/ChainSelector.tsx
View file @
185cb525
...
@@ -7,13 +7,7 @@ import { getConnection } from 'connection'
...
@@ -7,13 +7,7 @@ import { getConnection } from 'connection'
import
{
ConnectionType
}
from
'
connection/types
'
import
{
ConnectionType
}
from
'
connection/types
'
import
{
WalletConnectV2
}
from
'
connection/WalletConnectV2
'
import
{
WalletConnectV2
}
from
'
connection/WalletConnectV2
'
import
{
getChainInfo
}
from
'
constants/chainInfo
'
import
{
getChainInfo
}
from
'
constants/chainInfo
'
import
{
import
{
getChainPriority
,
L1_CHAIN_IDS
,
L2_CHAIN_IDS
,
TESTNET_CHAIN_IDS
}
from
'
constants/chains
'
getChainPriority
,
L1_CHAIN_IDS
,
L2_CHAIN_IDS
,
TESTNET_CHAIN_IDS
,
UniWalletSupportedChains
,
}
from
'
constants/chains
'
import
{
useOnClickOutside
}
from
'
hooks/useOnClickOutside
'
import
{
useOnClickOutside
}
from
'
hooks/useOnClickOutside
'
import
useSelectChain
from
'
hooks/useSelectChain
'
import
useSelectChain
from
'
hooks/useSelectChain
'
import
useSyncChainQuery
from
'
hooks/useSyncChainQuery
'
import
useSyncChainQuery
from
'
hooks/useSyncChainQuery
'
...
@@ -39,14 +33,12 @@ interface ChainSelectorProps {
...
@@ -39,14 +33,12 @@ interface ChainSelectorProps {
function
useWalletSupportedChains
():
ChainId
[]
{
function
useWalletSupportedChains
():
ChainId
[]
{
const
{
connector
}
=
useWeb3React
()
const
{
connector
}
=
useWeb3React
()
const
connectionType
=
getConnection
(
connector
).
type
const
connectionType
=
getConnection
(
connector
).
type
switch
(
connectionType
)
{
switch
(
connectionType
)
{
case
ConnectionType
.
WALLET_CONNECT_V2
:
case
ConnectionType
.
WALLET_CONNECT_V2
:
return
getSupportedChainIdsFromWalletConnectSession
((
connector
as
WalletConnectV2
).
provider
?.
session
)
case
ConnectionType
.
UNISWAP_WALLET_V2
:
case
ConnectionType
.
UNISWAP_WALLET_V2
:
return
UniWalletSupportedChains
return
getSupportedChainIdsFromWalletConnectSession
((
connector
as
WalletConnectV2
).
provider
?.
session
)
default
:
default
:
return
NETWORK_SELECTOR_CHAINS
return
NETWORK_SELECTOR_CHAINS
}
}
...
...
src/constants/chains.ts
View file @
185cb525
import
{
ChainId
,
SUPPORTED_CHAINS
,
SupportedChainsType
}
from
'
@uniswap/sdk-core
'
import
{
ChainId
,
SUPPORTED_CHAINS
,
SupportedChainsType
}
from
'
@uniswap/sdk-core
'
export
const
UniWalletSupportedChains
=
[
ChainId
.
MAINNET
,
ChainId
.
ARBITRUM_ONE
,
ChainId
.
OPTIMISM
,
ChainId
.
POLYGON
,
ChainId
.
BASE
,
]
export
const
CHAIN_IDS_TO_NAMES
=
{
export
const
CHAIN_IDS_TO_NAMES
=
{
[
ChainId
.
MAINNET
]:
'
mainnet
'
,
[
ChainId
.
MAINNET
]:
'
mainnet
'
,
[
ChainId
.
GOERLI
]:
'
goerli
'
,
[
ChainId
.
GOERLI
]:
'
goerli
'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment