Skip to content

Extra beta examples #64

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

Merged
merged 3 commits into from
May 20, 2025
Merged
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
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
export const providerNames = "ExampleContext.Provider";
export const preConfigContent = `
import { createContext } from 'react';
export const ExampleContext = createContext("");
`;
export const providerProps = "value='Example'";
export const globalClassNames = "font-space-grotesk";

export const extraProviders = [
'$$createProvider(ExampleContext.Provider, {value: "Example"})$$'
]

// WARNING: Do it with caution
// Since SE-2 fundamentally relies on WagmiProvider, QueryClientProvider, ProgressBar and RainbowKitProvider don't forgot to include them
// overrideProviders allows you to change the order or props passed to default providers
/* export const overrideProviders = [
'$$createProvider(WagmiProvider, { config: wagmiConfig })$$',
'$$createProvider(ExampleContext.Provider, {value: "Example"})$$',
'$$createProvider(QueryClientProvider, { client: queryClient })$$',
'$$createProvider(ProgressBar, { height: "3px", color: "#2299dd" })$$',
'$$createProvider(RainbowKitProvider, { avatar: BlockieAvatar, theme: mounted ? (isDarkMode ? darkTheme() : lightTheme()) : lightTheme() })$$',
] */

3 changes: 3 additions & 0 deletions extension/packages/nextjs/scaffold.config.ts.args.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ export const configOverrides = {
onlyLocalBurnerWallet: false,
customApiKey: "$$CUSTOM_API_KEY$$",
};

// (default false) If true, then selected solidityFramework network will not be added in targetNetworks array.
export const skipLocalChainInTargetNetworks = false;
21 changes: 21 additions & 0 deletions extension/packages/nextjs/services/web3/wagmiConfig.tsx.args.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export const preConfigContent = `
import { arbitrum } from "viem/chains";
`

export const configOverrides = {
client: `$$({chain})=>{const alchemyHttpUrl=chain.id==(arbitrum.id as number)?"http://127.0.0.1:8545":getAlchemyHttpUrl(chain.id);const rpcFallbacks=alchemyHttpUrl?[http(),http(alchemyHttpUrl)]:[http()];return createClient({chain,transport:fallback(rpcFallbacks)})}$$`
}

// NOTE: While passing function you need to ensure it's in one line.
// You can use AI to format the code to one line. (check above example for reference)
/* export const configOverrides = {
client: `$$({ chain }) => {
const alchemyHttpUrl = chain.id == arbitrum.id ? "http://127.0.0.1:8545" : getAlchemyHttpUrl(chain.id);
const rpcFallbacks = alchemyHttpUrl ? [http(), http(alchemyHttpUrl)] : [http()];

return createClient({
chain,
transport: fallback(rpcFallbacks),
});
}$$`
} */