-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: include all supported connectors in the create fuels template (#…
…2691) Co-authored-by: Chad Nehemiah <[email protected]>
- Loading branch information
Showing
40 changed files
with
764 additions
and
1,360 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"create-fuels": patch | ||
--- | ||
|
||
chore: include all supported connectors in the create fuels template |
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 |
---|---|---|
@@ -1,6 +1,2 @@ | ||
NEXT_PUBLIC_HAS_CONTRACT=true | ||
NEXT_PUBLIC_HAS_PREDICATE=false | ||
NEXT_PUBLIC_HAS_SCRIPT=false | ||
NEXT_PUBLIC_FUEL_NODE_PORT=4000 | ||
NEXT_PUBLIC_DAPP_ENVIRONMENT=local | ||
NEXT_PUBLIC_TESTNET_CONTRACT_ID=0x9310ab0b757826b745d601cb682c1b4f35abde02cddd67f8535c0b5bfb296d25 | ||
NEXT_PUBLIC_DAPP_ENVIRONMENT=local |
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
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,66 @@ | ||
"use client"; | ||
|
||
import { Layout } from "@/components/Layout"; | ||
import "@/styles/globals.css"; | ||
import { FuelProvider } from "@fuels/react"; | ||
import React, { ReactNode, useEffect, useMemo, useState } from "react"; | ||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
import { Provider } from "fuels"; | ||
import { | ||
BakoSafeConnector, | ||
BurnerWalletConnector, | ||
FuelWalletConnector, | ||
FuelWalletDevelopmentConnector, | ||
FueletWalletConnector, | ||
WalletConnectConnector, | ||
} from "@fuels/connectors"; | ||
import { NODE_URL } from "@/lib"; | ||
import { ActiveWalletProvider } from "@/hooks/useActiveWallet"; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
interface RootLayoutProps { | ||
children: ReactNode; | ||
} | ||
|
||
export default function RootLayout({ children }: RootLayoutProps) { | ||
const [isMounted, setIsMounted] = useState(false); | ||
const providerToUse = useMemo(() => Provider.create(NODE_URL), [NODE_URL]); | ||
|
||
useEffect(() => { | ||
setIsMounted(true); | ||
}, []); | ||
|
||
if (!isMounted) return null; | ||
|
||
return ( | ||
<html lang="en" className="bg-black text-white"> | ||
<body> | ||
<React.StrictMode> | ||
<QueryClientProvider client={queryClient}> | ||
<FuelProvider | ||
fuelConfig={{ | ||
connectors: [ | ||
new FuelWalletConnector(), | ||
new BurnerWalletConnector({ | ||
fuelProvider: providerToUse, | ||
}), | ||
new WalletConnectConnector({ | ||
fuelProvider: providerToUse, | ||
}), | ||
new BakoSafeConnector(), | ||
new FueletWalletConnector(), | ||
new FuelWalletDevelopmentConnector(), | ||
], | ||
}} | ||
> | ||
<ActiveWalletProvider> | ||
<Layout>{children}</Layout> | ||
</ActiveWalletProvider> | ||
</FuelProvider> | ||
</QueryClientProvider> | ||
</React.StrictMode> | ||
</body> | ||
</html> | ||
); | ||
} |
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
Oops, something went wrong.