+
@@ -230,7 +290,6 @@ button {
display: flex;
flex-direction: column;
justify-content: space-around;
- padding: var(--p-400);
overflow-x: hidden;
color: var(--fg-color);
background: var(--container-bg-color);
diff --git a/src/assets/images/fallback-logo-dark-mode.png b/src/assets/images/fallback-logo-dark-mode.png
new file mode 100644
index 00000000..a677d41f
Binary files /dev/null and b/src/assets/images/fallback-logo-dark-mode.png differ
diff --git a/src/assets/images/fallback-logo-light-mode.png b/src/assets/images/fallback-logo-light-mode.png
new file mode 100644
index 00000000..a677d41f
Binary files /dev/null and b/src/assets/images/fallback-logo-light-mode.png differ
diff --git a/src/components/AddNetwork.vue b/src/components/AddNetwork.vue
index b876dd13..4d522e38 100644
--- a/src/components/AddNetwork.vue
+++ b/src/components/AddNetwork.vue
@@ -37,44 +37,48 @@ function isExistingChain(chainId) {
}
async function handleSubmit() {
- const rpcUrl = rpcConfig.value.rpcUrl
- const chainId = rpcConfig.value.chainId
- const existingChain = isExistingChain(chainId)
- if (isExistingRpcUrl(rpcUrl)) {
- return toast.error(
- `RPC URL - ${rpcUrl} already exists, please use different one`
- )
- } else {
- const provider = new ethers.providers.JsonRpcProvider(
- rpcConfig.value.rpcUrl
- )
- const chainId = await provider.getNetwork()
- if (Number(chainId.chainId) !== Number(rpcConfig.value.chainId)) {
- return toast(`Incorrect combination of chainId and rpcUrl`)
- }
- if (existingChain) {
- rpcStore.setRpcConfig({
- ...existingChain,
- rpcUrls: [rpcConfig.value.rpcUrl],
- })
- rpcStore.setSelectedChainId(existingChain.chainId)
+ try {
+ const rpcUrl = rpcConfig.value.rpcUrl
+ const chainId = rpcConfig.value.chainId
+ const existingChain = isExistingChain(chainId)
+ if (isExistingRpcUrl(rpcUrl)) {
+ return toast.error(
+ `RPC URL - ${rpcUrl} already exists, please use different one`
+ )
} else {
- const payload = {
- chainName: rpcConfig.value.networkName,
- chainId: rpcConfig.value.chainId,
- blockExplorerUrls: [rpcConfig.value.explorerUrl],
- rpcUrls: [rpcConfig.value.rpcUrl],
- favicon: 'blockchain-icon',
- nativeCurrency: {
- symbol: rpcConfig.value.currencySymbol,
- decimals: 18,
- },
- isCustom: true,
+ const provider = new ethers.providers.StaticJsonRpcProvider(
+ rpcConfig.value.rpcUrl
+ )
+ const chainId = await provider.getNetwork()
+ if (Number(chainId.chainId) !== Number(rpcConfig.value.chainId)) {
+ return toast(`Incorrect combination of chain Id and RPC URL`)
+ }
+ if (existingChain) {
+ rpcStore.setRpcConfig({
+ ...existingChain,
+ rpcUrls: [rpcConfig.value.rpcUrl],
+ })
+ rpcStore.setSelectedChainId(existingChain.chainId)
+ } else {
+ const payload = {
+ chainName: rpcConfig.value.networkName,
+ chainId: rpcConfig.value.chainId,
+ blockExplorerUrls: [rpcConfig.value.explorerUrl],
+ rpcUrls: [rpcConfig.value.rpcUrl],
+ favicon: 'blockchain-icon',
+ nativeCurrency: {
+ symbol: rpcConfig.value.currencySymbol,
+ decimals: 18,
+ },
+ isCustom: true,
+ }
+ rpcStore.addNetwork(payload)
+ rpcStore.setSelectedChainId(payload.chainId)
}
- rpcStore.addNetwork(payload)
- rpcStore.setSelectedChainId(payload.chainId)
+ emit('close')
}
- emit('close')
+ } catch (e) {
+ toast.error('Invalid RPC URL')
}
}
diff --git a/src/components/AppFooter.vue b/src/components/AppFooter.vue
index 4cee2750..06625581 100644
--- a/src/components/AppFooter.vue
+++ b/src/components/AppFooter.vue
@@ -29,7 +29,7 @@ function getAppropriateIcon(iconName, pathName) {