Skip to content

Commit 2ce732f

Browse files
chore: removed hardcoded network
1 parent 8390b7b commit 2ce732f

File tree

4 files changed

+4
-12
lines changed

4 files changed

+4
-12
lines changed

templates/nextjs/src/app/layout.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { FuelProvider } from "@fuels/react";
44
import React, { ReactNode, useEffect, useState } from "react";
55
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
66
import { ToastContainer } from "react-toastify";
7-
import { FuelConnector, Network, Provider } from "fuels";
7+
import { FuelConnector, Provider } from "fuels";
88
import { defaultConnectors } from "@fuels/connectors";
99

10-
import { chainId, providerUrl } from "../lib";
10+
import { providerUrl } from "../lib";
1111

1212
import "react-toastify/dist/ReactToastify.css";
1313
import "@/styles/globals.css";
@@ -19,8 +19,6 @@ const connectors: FuelConnector[] = defaultConnectors({
1919
fuelProvider: Provider.create(providerUrl),
2020
});
2121

22-
const networks: Network[] = [{ url: providerUrl, chainId }];
23-
2422
interface RootLayoutProps {
2523
children: ReactNode;
2624
}
@@ -48,7 +46,6 @@ export default function RootLayout({ children }: RootLayoutProps) {
4846
theme="dark"
4947
fuelConfig={{ connectors }}
5048
uiConfig={{ suggestBridge: false }}
51-
networks={networks}
5249
>
5350
{" "}
5451
<ToastContainer theme="dark" />

templates/nextjs/src/lib.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const isTestnet = environment === environments.TESTNET;
1010
export const localProviderUrl = `http://127.0.0.1:${process.env.VITE_FUEL_NODE_PORT || 4000}/v1/graphql`;
1111
export const testnetProviderUrl = "https://testnet.fuel.network/v1/graphql";
1212
export const providerUrl = isLocal ? localProviderUrl : testnetProviderUrl;
13-
export const chainId = 0; // Local and testnet are both on chain 0
1413
export const playgroundUrl = providerUrl.replace("v1/graphql", "v1/playground");
1514

1615
export const localContractId = contractIds.testContract;

templates/vite/src/lib.tsx

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export const isTestnet = environment === environments.TESTNET;
1010
export const localProviderUrl = `http://127.0.0.1:${process.env.VITE_FUEL_NODE_PORT || 4000}/v1/graphql`;
1111
export const testnetProviderUrl = "https://testnet.fuel.network/v1/graphql";
1212
export const providerUrl = isLocal ? localProviderUrl : testnetProviderUrl;
13-
export const chainId = 0; // Local and testnet are both on chain 0
1413
export const playgroundUrl = providerUrl.replace("v1/graphql", "v1/playground");
1514

1615
export const localContractId = contractIds.testContract;

templates/vite/src/main.tsx

+2-5
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ import { FuelProvider } from "@fuels/react";
44
import { StrictMode } from "react";
55
import { createRoot } from "react-dom/client";
66
import { ToastContainer } from "react-toastify";
7-
import { FuelConnector, Network, Provider } from "fuels";
7+
import { FuelConnector, Provider } from "fuels";
88

99
import App from "./App.tsx";
10-
import { chainId, providerUrl } from "./lib.tsx";
10+
import { providerUrl } from "./lib.tsx";
1111

1212
import "react-toastify/dist/ReactToastify.css";
1313
import "./index.css";
@@ -19,16 +19,13 @@ const connectors: FuelConnector[] = defaultConnectors({
1919
fuelProvider: Provider.create(providerUrl),
2020
});
2121

22-
const networks: Network[] = [{ url: providerUrl, chainId }];
23-
2422
createRoot(document.getElementById("root")!).render(
2523
<StrictMode>
2624
<QueryClientProvider client={queryClient}>
2725
<FuelProvider
2826
theme="dark"
2927
fuelConfig={{ connectors }}
3028
uiConfig={{ suggestBridge: false }}
31-
networks={networks}
3229
>
3330
<App />
3431
<ToastContainer theme="dark" />

0 commit comments

Comments
 (0)