Skip to content
This repository was archived by the owner on Jun 4, 2025. It is now read-only.

Commit f992c8c

Browse files
authored
feat: opt example code (#30)
1 parent 3db25ce commit f992c8c

File tree

1 file changed

+3
-42
lines changed
  • examples/uploadkit-with-nextjs-walletkit/src/app

1 file changed

+3
-42
lines changed
Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,10 @@
11
'use client';
22
import { WalletKitButton } from '@totejs/walletkit';
33
import { UploadKitButton } from '@node-real/greenfield-uploadkit';
4-
import { chainList } from './chains';
5-
import { WagmiConfig, createConfig } from 'wagmi';
6-
import {
7-
SwitchNetworkModal,
8-
WalletKitOptions,
9-
WalletKitProvider,
10-
getDefaultConfig,
11-
} from '@totejs/walletkit';
12-
import { trustWallet, metaMask, walletConnect } from '@totejs/walletkit/wallets';
13-
import { UploadKitOptions, UploadKitProvider } from '@node-real/greenfield-uploadkit';
14-
import { client } from './client';
154

165
import '@node-real/greenfield-uploadkit/styles.css';
176
import '@totejs/walletkit/styles.css';
187

19-
const config = createConfig(
20-
getDefaultConfig({
21-
autoConnect: true,
22-
appName: 'WalletKit',
23-
24-
/* WC 2.0 requires a project ID (get one here: https://cloud.walletconnect.com/sign-in) */
25-
walletConnectProjectId: '22d482af814af0b8d5ba3d394a28c5fc',
26-
27-
chains: chainList,
28-
connectors: [trustWallet(), metaMask(), walletConnect()],
29-
}),
30-
);
31-
32-
const options: WalletKitOptions = {
33-
initialChainId: 5600,
34-
};
35-
36-
const uploadOptions: UploadKitOptions = {
37-
client: client,
38-
visibility: 'VISIBILITY_TYPE_PRIVATE',
39-
};
408
export default function Home() {
419
return (
4210
<main
@@ -45,16 +13,9 @@ export default function Home() {
4513
minHeight: '100vh',
4614
}}
4715
>
48-
<WagmiConfig config={config}>
49-
<WalletKitProvider options={options} mode="light">
50-
<UploadKitProvider options={uploadOptions} mode="light">
51-
<WalletKitButton />
52-
<div style={{ height: 16 }}></div>
53-
<UploadKitButton />
54-
<SwitchNetworkModal />
55-
</UploadKitProvider>
56-
</WalletKitProvider>
57-
</WagmiConfig>
16+
<WalletKitButton />
17+
<div style={{ height: 16 }}></div>
18+
<UploadKitButton />
5819
</main>
5920
);
6021
}

0 commit comments

Comments
 (0)