11import { isCyberWallet } from '@cyberlab/cyber-app-sdk'
22import { ChainId } from '@pancakeswap/chains'
3- import { WalletConfigV2 , WalletIds } from '@pancakeswap/ui-wallets'
3+ import { LegacyWalletConfig , LegacyWalletIds } from '@pancakeswap/ui-wallets'
44import { WalletFilledIcon } from '@pancakeswap/uikit'
55import safeGetWindow from '@pancakeswap/utils/safeGetWindow'
66import { getTrustWalletProvider } from '@pancakeswap/wagmi/connectors/trustWallet'
@@ -24,13 +24,13 @@ export enum ConnectorNames {
2424 CyberWallet = 'cyberWallet' ,
2525}
2626
27- export const TOP_WALLET_MAP : { [ chainId : number ] : WalletIds [ ] } = {
28- [ ChainId . BSC ] : [ WalletIds . Metamask , WalletIds . Trust , WalletIds . Okx , WalletIds . BinanceW3W ] ,
29- [ ChainId . ETHEREUM ] : [ WalletIds . Metamask , WalletIds . Trust , WalletIds . Okx ] ,
30- [ ChainId . POLYGON_ZKEVM ] : [ WalletIds . Metamask , WalletIds . Trust , WalletIds . Okx ] ,
31- [ ChainId . ZKSYNC ] : [ WalletIds . Metamask , WalletIds . Trust , WalletIds . Okx ] ,
32- [ ChainId . ARBITRUM_ONE ] : [ WalletIds . Metamask , WalletIds . Trust , WalletIds . Okx ] ,
33- [ ChainId . BASE ] : [ WalletIds . Metamask , WalletIds . Trust , WalletIds . Okx ] ,
27+ export const TOP_WALLET_MAP : { [ chainId : number ] : LegacyWalletIds [ ] } = {
28+ [ ChainId . BSC ] : [ LegacyWalletIds . Metamask , LegacyWalletIds . Trust , LegacyWalletIds . Okx , LegacyWalletIds . BinanceW3W ] ,
29+ [ ChainId . ETHEREUM ] : [ LegacyWalletIds . Metamask , LegacyWalletIds . Trust , LegacyWalletIds . Okx ] ,
30+ [ ChainId . POLYGON_ZKEVM ] : [ LegacyWalletIds . Metamask , LegacyWalletIds . Trust , LegacyWalletIds . Okx ] ,
31+ [ ChainId . ZKSYNC ] : [ LegacyWalletIds . Metamask , LegacyWalletIds . Trust , LegacyWalletIds . Okx ] ,
32+ [ ChainId . ARBITRUM_ONE ] : [ LegacyWalletIds . Metamask , LegacyWalletIds . Trust , LegacyWalletIds . Okx ] ,
33+ [ ChainId . BASE ] : [ LegacyWalletIds . Metamask , LegacyWalletIds . Trust , LegacyWalletIds . Okx ] ,
3434}
3535
3636const createQrCode =
@@ -95,11 +95,11 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
9595} : {
9696 chainId : number
9797 connect : ConnectMutateAsync < config , context >
98- } ) : WalletConfigV2 < ConnectorNames > [ ] => {
98+ } ) : LegacyWalletConfig < ConnectorNames > [ ] => {
9999 const qrCode = createQrCode ( chainId , connect )
100100 return [
101101 {
102- id : WalletIds . Metamask ,
102+ id : LegacyWalletIds . Metamask ,
103103 title : 'Metamask' ,
104104 icon : `${ ASSET_CDN } /web/wallets/metamask.png` ,
105105 get installed ( ) {
@@ -112,7 +112,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
112112 downloadLink : 'https://metamask.app.link/dapp/pancakeswap.finance/' ,
113113 } ,
114114 {
115- id : WalletIds . Trust ,
115+ id : LegacyWalletIds . Trust ,
116116 title : 'Trust Wallet' ,
117117 icon : `${ ASSET_CDN } /web/wallets/trust.png` ,
118118 connectorId : ConnectorNames . TrustWallet ,
@@ -128,7 +128,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
128128 qrCode,
129129 } ,
130130 {
131- id : WalletIds . Okx ,
131+ id : LegacyWalletIds . Okx ,
132132 title : 'OKX Wallet' ,
133133 icon : `${ ASSET_CDN } /web/wallets/okx-wallet.png` ,
134134 connectorId : ConnectorNames . Injected ,
@@ -145,7 +145,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
145145 qrCode,
146146 } ,
147147 {
148- id : WalletIds . BinanceW3W ,
148+ id : LegacyWalletIds . BinanceW3W ,
149149 title : 'Binance Wallet' ,
150150 icon : `${ ASSET_CDN } /web/wallets/binance-w3w.png` ,
151151 connectorId : isBinanceWeb3WalletInstalled ( ) ? ConnectorNames . Injected : ConnectorNames . BinanceW3W ,
@@ -158,19 +158,19 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
158158 } ,
159159 } ,
160160 {
161- id : WalletIds . Coinbase ,
161+ id : LegacyWalletIds . Coinbase ,
162162 title : 'Coinbase Wallet' ,
163163 icon : `${ ASSET_CDN } /web/wallets/coinbase.png` ,
164164 connectorId : ConnectorNames . WalletLink ,
165165 } ,
166166 {
167- id : WalletIds . Walletconnect ,
167+ id : LegacyWalletIds . Walletconnect ,
168168 title : 'WalletConnect' ,
169169 icon : `${ ASSET_CDN } /web/wallets/walletconnect.png` ,
170170 connectorId : ConnectorNames . WalletConnect ,
171171 } ,
172172 {
173- id : WalletIds . Opera ,
173+ id : LegacyWalletIds . Opera ,
174174 title : 'Opera Wallet' ,
175175 icon : `${ ASSET_CDN } /web/wallets/opera.png` ,
176176 connectorId : ConnectorNames . Injected ,
@@ -180,7 +180,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
180180 downloadLink : 'https://www.opera.com/crypto/next' ,
181181 } ,
182182 {
183- id : WalletIds . Brave ,
183+ id : LegacyWalletIds . Brave ,
184184 title : 'Brave Wallet' ,
185185 icon : `${ ASSET_CDN } /web/wallets/brave.png` ,
186186 connectorId : ConnectorNames . Injected ,
@@ -190,7 +190,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
190190 downloadLink : 'https://brave.com/wallet/' ,
191191 } ,
192192 {
193- id : WalletIds . Rabby ,
193+ id : LegacyWalletIds . Rabby ,
194194 title : 'Rabby Wallet' ,
195195 icon : `${ ASSET_CDN } /web/wallets/rabby.png` ,
196196 get installed ( ) {
@@ -206,7 +206,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
206206 qrCode,
207207 } ,
208208 {
209- id : WalletIds . Math ,
209+ id : LegacyWalletIds . Math ,
210210 title : 'MathWallet' ,
211211 icon : `${ ASSET_CDN } /web/wallets/mathwallet.png` ,
212212 connectorId : ConnectorNames . Injected ,
@@ -216,7 +216,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
216216 qrCode,
217217 } ,
218218 {
219- id : WalletIds . Tokenpocket ,
219+ id : LegacyWalletIds . Tokenpocket ,
220220 title : 'TokenPocket' ,
221221 icon : `${ ASSET_CDN } /web/wallets/tokenpocket.png` ,
222222 connectorId : ConnectorNames . Injected ,
@@ -226,7 +226,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
226226 qrCode,
227227 } ,
228228 {
229- id : WalletIds . SafePal ,
229+ id : LegacyWalletIds . SafePal ,
230230 title : 'SafePal' ,
231231 icon : `${ ASSET_CDN } /web/wallets/safepal.png` ,
232232 connectorId : ConnectorNames . Injected ,
@@ -237,7 +237,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
237237 qrCode,
238238 } ,
239239 {
240- id : WalletIds . Coin98 ,
240+ id : LegacyWalletIds . Coin98 ,
241241 title : 'Coin98' ,
242242 icon : `${ ASSET_CDN } /web/wallets/coin98.png` ,
243243 connectorId : ConnectorNames . Injected ,
@@ -247,7 +247,7 @@ const walletsConfig = <config extends Config = Config, context = unknown>({
247247 qrCode,
248248 } ,
249249 {
250- id : WalletIds . Cyberwallet ,
250+ id : LegacyWalletIds . Cyberwallet ,
251251 title : 'CyberWallet' ,
252252 icon : `${ ASSET_CDN } /web/wallets/cyberwallet.png` ,
253253 connectorId : ConnectorNames . CyberWallet ,
@@ -289,7 +289,7 @@ export const createWallets = <config extends Config = Config, context = unknown>
289289 ...config ,
290290 // add injected icon if none of injected type wallets installed
291291 {
292- id : WalletIds . Injected ,
292+ id : LegacyWalletIds . Injected ,
293293 title : 'Injected' ,
294294 icon : WalletFilledIcon ,
295295 connectorId : ConnectorNames . Injected ,
0 commit comments