remove WC 1
This commit is contained in:
parent
a6eb90952a
commit
def44ad66e
1
.env
1
.env
@ -2,5 +2,4 @@ VITE_BASE_URL=https://v4.testnet.dydx.exchange
|
||||
|
||||
VITE_ALCHEMY_API_KEY=FP275q327Yh7qswtZWenbPXdZZdnAFmC
|
||||
|
||||
VITE_WALLETCONNECT1_BRIDGE=wss://api.dydx.exchange/wc/
|
||||
VITE_WALLETCONNECT2_PROJECT_ID=fbe94eaa691fa8d929561f8567062b32
|
||||
|
||||
@ -4,7 +4,6 @@ VITE_ALCHEMY_API_KEY=
|
||||
|
||||
VITE_PK_ENCRYPTION_KEY=
|
||||
|
||||
VITE_WALLETCONNECT1_BRIDGE=
|
||||
VITE_WALLETCONNECT2_PROJECT_ID=
|
||||
|
||||
VITE_V3_TOKEN_ADDRESS=
|
||||
@ -87,14 +87,6 @@ const injectedConnectorOptions = {
|
||||
},
|
||||
};
|
||||
|
||||
const walletconnect1ConnectorOptions = {
|
||||
chains,
|
||||
options: {
|
||||
bridge: import.meta.env.VITE_WALLETCONNECT1_BRIDGE,
|
||||
qrcode: true,
|
||||
},
|
||||
};
|
||||
|
||||
const walletconnect2ConnectorOptions: ConstructorParameters<typeof WalletConnectConnector>[0] = {
|
||||
chains,
|
||||
options: {
|
||||
@ -143,7 +135,6 @@ const connectors = [
|
||||
reloadOnDisconnect: false,
|
||||
},
|
||||
}),
|
||||
new WalletConnectLegacyConnector(walletconnect1ConnectorOptions),
|
||||
new WalletConnectConnector(walletconnect2ConnectorOptions),
|
||||
new InjectedConnector(injectedConnectorOptions),
|
||||
];
|
||||
@ -166,19 +157,6 @@ const createInjectedConnectorWithProvider = (provider: ExternalProvider) =>
|
||||
provider as unknown as Awaited<ReturnType<InjectedConnector['getProvider']>>;
|
||||
})(injectedConnectorOptions) as InjectedConnector;
|
||||
|
||||
// Create a custom wagmi WalletConnectLegacyConnector with a modal showing only wallet links matching the given name
|
||||
const createWalletConnect1ConnectorWithName = (walletconnect1Name: string) =>
|
||||
new WalletConnectLegacyConnector({
|
||||
...walletconnect1ConnectorOptions,
|
||||
options: {
|
||||
...walletconnect1ConnectorOptions.options,
|
||||
qrcodeModalOptions: {
|
||||
desktopLinks: [walletconnect1Name],
|
||||
mobileLinks: [walletconnect1Name],
|
||||
},
|
||||
},
|
||||
});
|
||||
|
||||
const createWalletConnect2ConnectorWithId = (walletconnect2Id: string) =>
|
||||
new WalletConnectConnector({
|
||||
...walletconnect2ConnectorOptions,
|
||||
@ -214,9 +192,6 @@ export const resolveWagmiConnector = ({
|
||||
|
||||
return walletConnection.type === WalletConnectionType.InjectedEip1193 && walletConnection.provider
|
||||
? createInjectedConnectorWithProvider(walletConnection.provider)
|
||||
: walletConnection.type === WalletConnectionType.WalletConnect1 &&
|
||||
walletConfig.walletconnect1Name
|
||||
? createWalletConnect1ConnectorWithName(walletConfig.walletconnect1Name)
|
||||
: walletConnection.type === WalletConnectionType.WalletConnect2 && walletConfig.walletconnect2Id
|
||||
? createWalletConnect2ConnectorWithId(walletConfig.walletconnect2Id)
|
||||
: connectors.find(({ id }: { id: string }) => id === walletConnectionConfig.wagmiConnectorId);
|
||||
|
||||
@ -45,12 +45,6 @@ export const getWalletConnection = ({
|
||||
break;
|
||||
}
|
||||
|
||||
case WalletConnectionType.WalletConnect1: {
|
||||
return {
|
||||
type: WalletConnectionType.WalletConnect1,
|
||||
};
|
||||
}
|
||||
|
||||
case WalletConnectionType.WalletConnect2: {
|
||||
return {
|
||||
type: WalletConnectionType.WalletConnect2,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user