Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Origin/feat/walletconnect #313

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { NestFactory } from "@nestjs/core"
import { SwaggerModule, DocumentBuilder } from "@nestjs/swagger"
import { ironSession } from "iron-session/express"
import { AppModule } from "./app/app.module"
import fetch from 'node-fetch';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is not necessary

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 definitely not!


async function bootstrap() {
const app = await NestFactory.create(AppModule)
Expand Down
4 changes: 3 additions & 1 deletion apps/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"@emotion/react": "^11.10.6",
"@emotion/styled": "^11.10.6",
"@fontsource-variable/unbounded": "^5.0.5",
"@rainbow-me/rainbowkit": "^1.0.11",
"@semaphore-protocol/identity": "3.10.1",
"@web3-react/core": "^6.1.9",
"@web3-react/injected-connector": "^6.0.7",
Expand All @@ -24,7 +25,8 @@
"react-dom": "^18.2.0",
"react-icons": "^4.10.1",
"react-router-dom": "^6.8.1",
"regenerator-runtime": "^0.13.11"
"regenerator-runtime": "^0.13.11",
"wagmi": "^1.4.2"
},
"devDependencies": {
"@types/react": "^18.0.27",
Expand Down
31 changes: 31 additions & 0 deletions apps/client/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,46 @@ import { providers } from "ethers"
import * as ReactDOM from "react-dom/client"
import Routes from "./routes"
import theme from "./styles"
import './polyfills';
import '@rainbow-me/rainbowkit/styles.css';

import { getDefaultWallets, RainbowKitProvider } from '@rainbow-me/rainbowkit';
import { configureChains,createConfig, WagmiConfig } from 'wagmi';
import { mainnet, polygon, optimism, arbitrum, base, zora } from 'wagmi/chains';
import { publicProvider } from 'wagmi/providers/public';
import React from 'react';

const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement)

const { chains, publicClient } = configureChains(
[mainnet, polygon, optimism, arbitrum, base, zora],
[publicProvider()]
);

const { connectors } = getDefaultWallets({
appName: 'RainbowKit demo',
projectId: 'YOUR_PROJECT_ID',
chains,
});

const config = createConfig({
autoConnect: false,
connectors,
publicClient,
});


root.render(
<Web3ReactProvider
getLibrary={(provider) => new providers.Web3Provider(provider)}
>
<WagmiConfig config={config}>
<RainbowKitProvider chains={chains}>
<ChakraProvider theme={theme}>
<Routes />
</ChakraProvider>
</RainbowKitProvider>
</WagmiConfig>
</Web3ReactProvider>
)

18 changes: 12 additions & 6 deletions apps/client/src/pages/home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ import {
isGroupMember
} from "../utils/api"

import { ConnectButton } from '@rainbow-me/rainbowkit';

const injectedConnector = new InjectedConnector({})

export default function HomePage(): JSX.Element {
Expand Down Expand Up @@ -181,13 +183,17 @@ export default function HomePage(): JSX.Element {
</Heading>

{!active ? (
<Button
colorScheme="secondary"
variant="solid"
onClick={() => activate(injectedConnector)}
<div
style={{
display: 'flex',
justifyContent: 'flex-end',
padding: 12,
}}
>
Connect Metamask
</Button>
<ConnectButton />
</div>


) : (
<VStack w="400px" spacing="5">
<VStack align="left" w="100%">
Expand Down
10 changes: 9 additions & 1 deletion apps/client/src/polyfills.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,13 @@
*
* See: https://github.com/zloirock/core-js#babel
*/
import "core-js/stable"
// import "core-js/stable"
import "regenerator-runtime/runtime"

import { Buffer } from 'buffer';

window.global = window.global ?? window;
window.Buffer = window.Buffer ?? Buffer;
window.process = window.process ?? { env: {} }; // Minimal process polyfill

export {};
2 changes: 1 addition & 1 deletion yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -21463,4 +21463,4 @@ __metadata:
optional: true
checksum: fc443abf5bc9deac0d4e375847e7914e44c7ffc9f7f09b60e466cb9bbbcf5a46706bf2f9c8b9e6e6c9a1c5aea0bd6123cbf9fbcd39788ae27d8494d505969ae8
languageName: node
linkType: hard
linkType: hard
Loading