Skip to content

Commit bb495c5

Browse files
author
James Bartnik
committed
Remove web3 wallets
1 parent f24a783 commit bb495c5

File tree

10 files changed

+606
-5937
lines changed

10 files changed

+606
-5937
lines changed

apps/vanguard-client-desktop/electron/main.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@ function createWindow() {
3030
icon: path.join(process.env.VITE_PUBLIC, 'xai-logo.svg'),
3131
webPreferences: {
3232
preload: path.join(__dirname, 'preload.js'),
33-
nodeIntegration: true,
34-
contextIsolation: false,
3533
},
3634
})
3735

apps/vanguard-client-desktop/package.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,16 +10,12 @@
1010
"preview": "vite preview"
1111
},
1212
"dependencies": {
13-
"@metamask/sdk-react": "^0.8.0",
14-
"@web3modal/ethereum": "^2.7.1",
15-
"@web3modal/react": "^2.7.1",
1613
"react": "^18.2.0",
1714
"react-dom": "^18.2.0",
1815
"react-icons": "^4.11.0",
1916
"react-router-dom": "^6.16.0",
2017
"tailwindcss": "^3.3.3",
21-
"viem": "^1.15.1",
22-
"wagmi": "^1.4.3"
18+
"viem": "^1.15.1"
2319
},
2420
"devDependencies": {
2521
"@types/react": "^18.2.21",

apps/vanguard-client-desktop/src/components/buttons/MetamaskButton.tsx

Lines changed: 0 additions & 36 deletions
This file was deleted.

apps/vanguard-client-desktop/src/components/buttons/WalletConnectButton.tsx

Lines changed: 0 additions & 18 deletions
This file was deleted.

apps/vanguard-client-desktop/src/features/home/ConnectWallet.tsx

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import {RiKey2Line} from "react-icons/ri";
22
import {FiGift, FiGitCommit} from "react-icons/fi";
3-
import {Dispatch, SetStateAction, useEffect} from "react";
4-
import {useAccount} from 'wagmi'
5-
import {WalletConnectButton} from "../../components/buttons/WalletConnectButton.tsx";
3+
import {Dispatch, SetStateAction} from "react";
64

75
const body = [
86
{
@@ -27,13 +25,13 @@ interface ConnectWalletProps {
2725
}
2826

2927
export function ConnectWallet({setConnected}: ConnectWalletProps) {
30-
const {isConnected} = useAccount()
31-
32-
useEffect(() => {
33-
if (isConnected) {
34-
setConnected(true);
35-
}
36-
}, [isConnected, setConnected])
28+
// const {isConnected} = useAccount()
29+
//
30+
// useEffect(() => {
31+
// if (isConnected) {
32+
// setConnected(true);
33+
// }
34+
// }, [isConnected, setConnected])
3735

3836
function getBody() {
3937
return body.map((item, i) => {
@@ -48,7 +46,6 @@ export function ConnectWallet({setConnected}: ConnectWalletProps) {
4846
</div>
4947
)
5048
})
51-
5249
}
5350

5451
return (
@@ -60,7 +57,12 @@ export function ConnectWallet({setConnected}: ConnectWalletProps) {
6057
challenges
6158
</p>
6259
<div className="flex flex-col justify-center items-center mt-8 gap-2">
63-
<WalletConnectButton className="w-[27.25rem] h-16"/>
60+
<button
61+
className={`w-full bg-[#F30919] text-white p-3 uppercase font-semibold mt-2`}
62+
onClick={() => setConnected(true)}
63+
>
64+
Connect Wallet
65+
</button>
6466
<p className="text-xs text-[#525252]">This will open WalletConnect in a browser</p>
6567
</div>
6668
</div>

apps/vanguard-client-desktop/src/features/home/Home.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,8 @@
1-
import {Dispatch, SetStateAction, useEffect} from "react";
2-
import {useAccount} from "wagmi";
31
import {Blockpass} from "../../components/blockpass/Blockpass.tsx";
42

5-
interface HomeProps {
6-
setConnected: Dispatch<SetStateAction<boolean>>
7-
}
8-
9-
export function Home({setConnected}: HomeProps) {
10-
const {isConnected} = useAccount()
11-
12-
useEffect(() => {
13-
if (!isConnected) {
14-
setConnected(false);
15-
}
16-
}, [isConnected, setConnected])
17-
3+
export function Home() {
184
return (
195
<div className="w-full h-screen flex justify-center items-center">
20-
21-
{/* todo: temp placement to allow for users to disconnect wallet */}
226
<div className="absolute flex flex-col gap-4 right-0 top-0 p-4">
237
<h1>Home</h1>
248
</div>

apps/vanguard-client-desktop/src/features/home/Homepage.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@ export function Homepage() {
88
return (
99
<div className="w-full h-screen">
1010
{connected ? (
11-
<Home
12-
setConnected={setConnected}
13-
/>
11+
<Home/>
1412
) : (
1513
<ConnectWallet
1614
setConnected={setConnected}

apps/vanguard-client-desktop/src/features/sidebar/SidebarRoot.tsx

Lines changed: 8 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,29 @@ import {Link} from 'react-router-dom';
22
import {FaDiscord} from 'react-icons/fa';
33
import {FiGitCommit} from "react-icons/fi";
44
import {RiKey2Line, RiTwitterXFill} from "react-icons/ri";
5-
import {AiOutlineCloudUpload, AiOutlineGift} from "react-icons/ai";
5+
import {AiOutlineCloudUpload} from "react-icons/ai";
66
import {SiGitbook} from "react-icons/si";
7-
import {useAccount} from "wagmi";
8-
import {HiOutlineComputerDesktop} from "react-icons/hi2";
9-
import {WalletConnectButton} from "../../components/buttons/WalletConnectButton.tsx";
107

118
/**
129
* Sidebar component
1310
* @returns JSX.Element
1411
*/
1512
export function Sidebar() {
16-
17-
const {isConnected} = useAccount()
18-
1913
return (
2014
<div className="sticky h-screen w-64 bg-white border-r border-gray-200 text-gray-600 p-5 z-10">
21-
22-
{/* todo: for dev purposes only, delete once persisting storage is implemented */}
23-
<div className="h-1/4 mb-5">
24-
<h2 className="text-gray-400 text-base mb-2 uppercase">Authenticate</h2>
25-
{/*<MetamaskButton/>*/}
26-
<div className="mb-2">
27-
<WalletConnectButton/>
28-
</div>
29-
30-
{isConnected && (
31-
<div>
32-
<Link
33-
to="/licenses"
34-
className="flex items-center mb-2 text-gray-600 hover:text-gray-400 cursor-pointer">
35-
<RiKey2Line className="mr-2"/> Licenses
36-
{/*<span className="ml-auto bg-red-500 text-xs text-white rounded-full px-2">1</span>*/}
37-
</Link>
38-
<Link
39-
to="/licenses"
40-
className="flex items-center mb-2 text-gray-600 hover:text-gray-400 cursor-pointer">
41-
<HiOutlineComputerDesktop className="mr-2"/> Operators
42-
</Link>
43-
<Link
44-
to="/licenses"
45-
className="flex items-center mb-2 text-gray-600 hover:text-gray-400 cursor-pointer">
46-
<AiOutlineGift className="mr-2"/> Rewards
47-
</Link>
48-
</div>
49-
)}
50-
</div>
51-
52-
<div className="h-2/4 flex flex-col gap-5">
15+
<div className="h-full flex flex-col gap-5">
5316
<div>
5417
<h2 className="text-gray-400 text-base mb-2 uppercase">Vanguard Node</h2>
5518
<Link to="/" className="flex items-center mb-2 text-gray-600 hover:text-gray-400 cursor-pointer">
5619
<FiGitCommit className="mr-2"/> Home
5720
</Link>
5821

59-
{/*<Link*/}
60-
{/* to="/licenses"*/}
61-
{/* className="flex items-center mb-2 text-gray-600 hover:text-gray-400 cursor-pointer">*/}
62-
{/* <RiKey2Line className="mr-2"/> Licenses <span*/}
63-
{/* className="ml-auto bg-red-500 text-xs text-white rounded-full px-2">1</span>*/}
64-
{/*</Link>*/}
22+
<Link
23+
to="/licenses"
24+
className="flex items-center mb-2 text-gray-600 hover:text-gray-400 cursor-pointer">
25+
<RiKey2Line className="mr-2"/> Licenses <span
26+
className="ml-auto bg-red-500 text-xs text-white rounded-full px-2">1</span>
27+
</Link>
6528
</div>
6629

6730
<div>

apps/vanguard-client-desktop/src/main.tsx

Lines changed: 1 addition & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -2,47 +2,14 @@
22
import {StrictMode} from 'react'
33
import ReactDOM from 'react-dom/client'
44
import {AppRoutes} from './features/router'
5-
import {EthereumClient, w3mConnectors, w3mProvider} from '@web3modal/ethereum'
6-
import {Web3Modal} from '@web3modal/react'
7-
import {configureChains, createConfig, WagmiConfig} from 'wagmi'
8-
import {arbitrum, mainnet} from 'wagmi/chains'
95
import "./index.css";
10-
import {MetaMaskProvider} from "@metamask/sdk-react";
11-
12-
const chains = [arbitrum, mainnet]
13-
const projectId = '8f5121741edc292ac7e4203b648d61e2'
14-
15-
const {publicClient} = configureChains(chains, [w3mProvider({projectId})])
16-
const wagmiConfig = createConfig({
17-
autoConnect: true,
18-
connectors: w3mConnectors({projectId, chains}),
19-
publicClient
20-
})
21-
22-
const ethereumClient = new EthereumClient(wagmiConfig, chains)
236

247
const rootElement = document.getElementById('root')!
258
if (!rootElement.innerHTML) {
269
const root = ReactDOM.createRoot(rootElement)
2710
root.render(
2811
<StrictMode>
29-
<WagmiConfig config={wagmiConfig}>
30-
<MetaMaskProvider debug={false} sdkOptions={{
31-
logging: {
32-
developerMode: false,
33-
},
34-
checkInstallationImmediately: false, // This will automatically connect to MetaMask on page load
35-
dappMetadata: {
36-
name: "Xai Sentry Node",
37-
url: window.location.host,
38-
}
39-
}}>
40-
41-
<AppRoutes/>
42-
</MetaMaskProvider>
43-
</WagmiConfig>
44-
45-
<Web3Modal projectId={projectId} ethereumClient={ethereumClient}/>
12+
<AppRoutes/>
4613
</StrictMode>,
4714
)
4815
}

0 commit comments

Comments
 (0)