-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
4e99638
commit c2f8400
Showing
12 changed files
with
213 additions
and
464 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
|
||
const { | ||
network, | ||
contractAddress, | ||
GAS_LIMIT, | ||
ENVIROMENT, | ||
TOKENS_ID, | ||
ChainID, | ||
QXTAGSLINK | ||
} = require("config.devnet"); | ||
|
||
export const tokensID = TOKENS_ID; | ||
export const environment = ENVIROMENT; | ||
export const contractAddr = contractAddress; | ||
export const gasLimit = GAS_LIMIT; | ||
export const ChainId = ChainID; | ||
export const QxTagsLink = QXTAGSLINK; | ||
export { network }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
export const contractAddress = { | ||
hoot: '', | ||
qxtags: "" | ||
} | ||
export const ENVIROMENT = "devnet"; | ||
|
||
export const ChainID = "D"; | ||
export const network = { | ||
id: "devnet", | ||
name: "Devnet", | ||
egldLabel: "xEGLD", | ||
walletAddress: "https://devnet-wallet.multiversx.com", | ||
apiAddress: "https://devnet-api.multiversx.com", | ||
gatewayAddress: "https://devnet-api.multiversx.com", | ||
explorerAddress: "http://devnet-explorer.multiversx.com", | ||
graphQlAddress: "https://devnet-exchange-graph.multiversx.com/graphql", | ||
apiTimeout: 10000, | ||
}; | ||
|
||
export const GAS_LIMIT = 60000000; | ||
|
||
//general configs | ||
export const apiTimeout = 6000; | ||
export const TOOLS_API_URL = "https://tools.multiversx.com"; | ||
export const sampleAuthenticatedDomains = [TOOLS_API_URL]; | ||
|
||
export const QXTAGSLINK = "https://quantum-original-dev.vercel.app/qtags" | ||
|
||
export const walletConnectBridge = "https://bridge.walletconnect.org"; | ||
|
||
export const walletConnectDeepLink = | ||
"https://maiar.page.link/?apn=com.multiversx.maiar.wallet&isi=1519405832&ibi=com.multiversx.maiar.wallet&link=https://maiar.com/"; | ||
|
||
export const TOKENS_ID = { | ||
wegld: "WEGLD-d7c6bb" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
export const contractAddress = { | ||
hoot: '', | ||
qxtags: "" | ||
} | ||
export const ENVIROMENT = "devnet"; | ||
|
||
export const ChainID = "D"; | ||
export const network = { | ||
id: "devnet", | ||
name: "Devnet", | ||
egldLabel: "xEGLD", | ||
walletAddress: "https://devnet-wallet.multiversx.com", | ||
apiAddress: "https://devnet-api.multiversx.com", | ||
gatewayAddress: "https://devnet-api.multiversx.com", | ||
explorerAddress: "http://devnet-explorer.multiversx.com", | ||
graphQlAddress: "https://devnet-exchange-graph.multiversx.com/graphql", | ||
apiTimeout: 10000, | ||
}; | ||
|
||
export const GAS_LIMIT = 60000000; | ||
|
||
//general configs | ||
export const apiTimeout = 6000; | ||
export const TOOLS_API_URL = "https://tools.multiversx.com"; | ||
export const sampleAuthenticatedDomains = [TOOLS_API_URL]; | ||
|
||
export const QXTAGSLINK = "https://quantum-original-dev.vercel.app/qtags" | ||
|
||
export const walletConnectBridge = "https://bridge.walletconnect.org"; | ||
|
||
export const walletConnectDeepLink = | ||
"https://maiar.page.link/?apn=com.multiversx.maiar.wallet&isi=1519405832&ibi=com.multiversx.maiar.wallet&link=https://maiar.com/"; | ||
|
||
export const TOKENS_ID = { | ||
wegld: "WEGLD-d7c6bb" | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
import React from 'react'; | ||
import { DappProvider } from '@multiversx/sdk-dapp/wrappers/DappProvider'; | ||
import type { AppProps } from 'next/app'; | ||
import { network } from "../api/net.config"; | ||
import dynamic from "next/dynamic"; | ||
import { AxiosInterceptorContext } from "@multiversx/sdk-dapp/wrappers/AxiosInterceptorContext"; | ||
import { sampleAuthenticatedDomains } from "../config"; | ||
|
||
const SignTransactionsModals: any = dynamic( | ||
async () => { | ||
return (await import("@multiversx/sdk-dapp/UI/SignTransactionsModals")) | ||
.SignTransactionsModals; | ||
}, | ||
{ ssr: false } | ||
); | ||
const NotificationModal: any = dynamic( | ||
async () => { | ||
return (await import("@multiversx/sdk-dapp/UI/NotificationModal")) | ||
.NotificationModal; | ||
}, | ||
{ ssr: false } | ||
); | ||
const TransactionsToastList: any = dynamic( | ||
async () => { | ||
return (await import("@multiversx/sdk-dapp/UI/TransactionsToastList")) | ||
.TransactionsToastList; | ||
}, | ||
{ ssr: false } | ||
); | ||
|
||
const withDappProvider = (WrappedComponent: React.ComponentType<AppProps>) => { | ||
const WithDappProvider: React.FC<AppProps> = (props) => { | ||
return ( | ||
<AxiosInterceptorContext.Provider> | ||
{/* @ts-ignore */} | ||
<AxiosInterceptorContext.Interceptor | ||
authenticatedDomanis={sampleAuthenticatedDomains} | ||
> | ||
<DappProvider | ||
environment={network.id} | ||
customNetworkConfig={{ | ||
name: "Hackathon Dapp", | ||
walletConnectV2ProjectId: "b2d85a1d5f8e40aa6d2858b1e2ed83d8", | ||
}} | ||
dappConfig={{ | ||
shouldUseWebViewProvider: true, | ||
}} | ||
> | ||
<> | ||
<TransactionsToastList /> | ||
<NotificationModal /> | ||
<SignTransactionsModals className="custom-class-for-modals" /> | ||
</> | ||
<AxiosInterceptorContext.Listener /> | ||
<WrappedComponent {...props} /> | ||
</DappProvider> | ||
</AxiosInterceptorContext.Interceptor> | ||
</AxiosInterceptorContext.Provider> | ||
); | ||
}; | ||
|
||
return WithDappProvider; | ||
}; | ||
export default withDappProvider; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { NextAuthOptions, User } from "next-auth"; | ||
import GoogleProvider from "next-auth/providers/google"; | ||
|
||
|
||
export const authConfig: NextAuthOptions = { | ||
providers: [ | ||
GoogleProvider({ | ||
clientId: process.env.GOOGLE_CLIENT_ID || "", | ||
clientSecret: process.env.GOOGLE_CLIENT_SECRET || "", | ||
}), | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
import '@/styles/globals.css' | ||
import { SessionProvider } from "next-auth/react" | ||
import type { AppProps } from 'next/app' | ||
|
||
export default function App({ Component, pageProps }: AppProps) { | ||
return <Component {...pageProps} /> | ||
} | ||
export default function App({ | ||
Component, | ||
pageProps: { session, ...pageProps }, | ||
}: AppProps) { | ||
return ( | ||
<SessionProvider session={session} refetchInterval={5 * 60}> | ||
<Component {...pageProps} /> | ||
</SessionProvider> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import NextAuth from "next-auth" | ||
import GoogleProvider from "next-auth/providers/google" | ||
|
||
export const authOptions = { | ||
providers: [ | ||
GoogleProvider({ | ||
clientId: process.env.GOOGLE_CLIENT_ID || "", | ||
clientSecret: process.env.GOOGLE_CLIENT_SECRET || "", | ||
}), | ||
], | ||
} | ||
|
||
export default NextAuth(authOptions) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,114 +1,22 @@ | ||
import Head from 'next/head' | ||
import Image from 'next/image' | ||
import { Inter } from 'next/font/google' | ||
import styles from '@/styles/Home.module.css' | ||
|
||
const inter = Inter({ subsets: ['latin'] }) | ||
import { useSession, signIn, signOut } from "next-auth/react" | ||
|
||
export default function Home() { | ||
|
||
const { data: session } = useSession() | ||
console.log(session); | ||
|
||
if (session) { | ||
return ( | ||
<> | ||
Signed in as {session?.user?.email} <br /> | ||
<button onClick={() => signOut()}>Sign out</button> | ||
</> | ||
) | ||
} | ||
return ( | ||
<> | ||
<Head> | ||
<title>Create Next App</title> | ||
<meta name="description" content="Generated by create next app" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
<link rel="icon" href="/favicon.ico" /> | ||
</Head> | ||
<main className={`${styles.main} ${inter.className}`}> | ||
<div className={styles.description}> | ||
<p> | ||
Get started by editing | ||
<code className={styles.code}>src/pages/index.tsx</code> | ||
</p> | ||
<div> | ||
<a | ||
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
By{' '} | ||
<Image | ||
src="/vercel.svg" | ||
alt="Vercel Logo" | ||
className={styles.vercelLogo} | ||
width={100} | ||
height={24} | ||
priority | ||
/> | ||
</a> | ||
</div> | ||
</div> | ||
|
||
<div className={styles.center}> | ||
<Image | ||
className={styles.logo} | ||
src="/next.svg" | ||
alt="Next.js Logo" | ||
width={180} | ||
height={37} | ||
priority | ||
/> | ||
</div> | ||
|
||
<div className={styles.grid}> | ||
<a | ||
href="https://nextjs.org/docs?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" | ||
className={styles.card} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2> | ||
Docs <span>-></span> | ||
</h2> | ||
<p> | ||
Find in-depth information about Next.js features and API. | ||
</p> | ||
</a> | ||
|
||
<a | ||
href="https://nextjs.org/learn?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" | ||
className={styles.card} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2> | ||
Learn <span>-></span> | ||
</h2> | ||
<p> | ||
Learn about Next.js in an interactive course with quizzes! | ||
</p> | ||
</a> | ||
|
||
<a | ||
href="https://vercel.com/templates?framework=next.js&utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" | ||
className={styles.card} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2> | ||
Templates <span>-></span> | ||
</h2> | ||
<p> | ||
Discover and deploy boilerplate example Next.js projects. | ||
</p> | ||
</a> | ||
|
||
<a | ||
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app" | ||
className={styles.card} | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
<h2> | ||
Deploy <span>-></span> | ||
</h2> | ||
<p> | ||
Instantly deploy your Next.js site to a shareable URL | ||
with Vercel. | ||
</p> | ||
</a> | ||
</div> | ||
</main> | ||
Not signed in <br /> | ||
<button onClick={() => signIn()}>Sign in</button> | ||
</> | ||
) | ||
} |
Oops, something went wrong.