-
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: upgrade Fuel frontend packages (#2077)
- Loading branch information
1 parent
6cf0051
commit 5daeea4
Showing
18 changed files
with
423 additions
and
771 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,5 @@ | ||
--- | ||
"create-fuels": minor | ||
--- | ||
|
||
chore: upgrade Fuel frontend packages |
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
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,11 +1,17 @@ | ||
import { BN, WalletLocked, WalletUnlocked } from 'fuels'; | ||
import { Account, BN } from 'fuels'; | ||
|
||
export const NODE_URL = `http://127.0.0.1:${ | ||
process.env.NEXT_PUBLIC_FUEL_NODE_PORT || 4000 | ||
}/graphql`; | ||
|
||
/** | ||
* Enable the Fuel dev connector. | ||
* @see {@link https://docs.fuel.network/docs/wallet/dev/getting-started/#using-default-connectors} | ||
*/ | ||
export const ENABLE_FUEL_DEV_CONNECTOR = process.env.NEXT_PUBLIC_ENABLE_FUEL_DEV_CONNECTOR === 'true'; | ||
|
||
export interface AppWallet { | ||
wallet?: WalletLocked | WalletUnlocked; | ||
wallet?: Account; | ||
walletBalance?: BN; | ||
refreshWalletBalance?: () => Promise<void>; | ||
} |
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,14 +1,35 @@ | ||
import { Layout } from "@/components/Layout"; | ||
import "@/styles/globals.css"; | ||
import { FuelProvider } from "@fuel-wallet/react"; | ||
import { FuelProvider } from "@fuels/react"; | ||
import type { AppProps } from "next/app"; | ||
import { QueryClient, QueryClientProvider } from '@tanstack/react-query' | ||
import type { FuelConfig } from "fuels"; | ||
import { defaultConnectors } from "@fuels/connectors"; | ||
import { ENABLE_FUEL_DEV_CONNECTOR } from "@/lib"; | ||
import React, { useEffect } from "react"; | ||
|
||
const queryClient: QueryClient = new QueryClient() | ||
|
||
export default function App({ Component, pageProps }: AppProps) { | ||
let fuelConfig: FuelConfig = {}; | ||
|
||
useEffect(() => { | ||
fuelConfig = { | ||
connectors: defaultConnectors({ | ||
devMode: ENABLE_FUEL_DEV_CONNECTOR | ||
}) | ||
} | ||
}, []) | ||
|
||
return ( | ||
<FuelProvider> | ||
<Layout> | ||
<Component {...pageProps} /> | ||
</Layout> | ||
</FuelProvider> | ||
<React.StrictMode> | ||
<QueryClientProvider client={queryClient}> | ||
<FuelProvider fuelConfig={fuelConfig}> | ||
<Layout> | ||
<Component {...pageProps} /> | ||
</Layout> | ||
</FuelProvider> | ||
</QueryClientProvider> | ||
</React.StrictMode> | ||
); | ||
} |
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,13 +1,24 @@ | ||
import "@/styles/globals.css"; | ||
import { FuelProvider } from "@fuel-wallet/react"; | ||
// #region wallet-sdk-react-provider | ||
import { defaultConnectors } from '@fuels/connectors'; | ||
import { FuelProvider } from "@fuels/react"; | ||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query"; | ||
import type { AppProps } from "next/app"; | ||
import React from "react"; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
// #region wallet-sdk-react-provider | ||
export default function App({ Component, pageProps }: AppProps) { | ||
return ( | ||
<FuelProvider> | ||
<Component {...pageProps} /> | ||
</FuelProvider> | ||
<React.StrictMode> | ||
<QueryClientProvider client={queryClient}> | ||
<FuelProvider fuelConfig={{ connectors: defaultConnectors({ devMode: true }) }}> | ||
<Component { ...pageProps } /> | ||
</FuelProvider> | ||
</QueryClientProvider> | ||
</React.StrictMode> | ||
); | ||
} | ||
// #endregion wallet-sdk-react-provider | ||
|
||
|
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
Oops, something went wrong.