Greenfield UploadKit is a React component library for easily uploading objects to BNB Greenfield.
- 💡 Typescript — Get types straight out of the box.
- 🌱 Ecosystem Standards — Built on top of @bnb-chain/greenfield-js-sdk, wagmi and viem.
- 🎨 Customization — Easily customizing themes.
For full documentation, visit here.
The following examples are provided in the examples folder of this repo.
- uploadkit-with-nextjs-walletkit
- uploadkit-with-nextjs-rainbowkit
- uploadkit-with-vite-walletkit
- uploadkit-with-remix-rainbowkit
npm i wagmi viem @node-real/greenfield-uploadkit @bnb-chain/greenfield-js-sdk @bnb-chain/greenfield-cosmos-types @bnb-chain/reed-solomon
Before using Greenfield UploadKit, you need to switch your network to the BNB Greenfield Chain. We recommend using @node-real/walletkit to connect your wallet and manage the network. This integration will ensure a seamless experience when working with Greenfield UploadKit.
import { WagmiConfig, createConfig } from 'wagmi';
import {
SwitchNetworkModal,
WalletKitButton,
WalletKitOptions,
WalletKitProvider,
getDefaultConfig,
} from '@node-real/walletkit';
import { trustWallet, metaMask, walletConnect } from '@node-real/walletkit/wallets';
import { UploadKitButton, UploadKitOptions, UploadKitProvider } from '@node-real/greenfield-uploadkit';
import { chains } from './chains';
import { client } from './client';
import '@node-real/greenfield-uploadkit/styles.css';
import '@node-real/walletkit/styles.css';
const config = createConfig(
getDefaultConfig({
autoConnect: true,
appName: 'WalletKit',
/* WC 2.0 requires a project ID (get one here: https://cloud.walletconnect.com/sign-in) */
walletConnectProjectId: '22d482af814af0b8d5ba3d394a28c5fc',
chains,
connectors: [trustWallet(), metaMask(), walletConnect()],
}),
);
const options: WalletKitOptions = {
initialChainId: 5600,
};
const uploadKitOptions: UploadKitOptions = {
client: client,
};
export default function App({ Component, pageProps }: AppProps) {
return (
<WagmiConfig config={config}>
<WalletKitProvider options={options} mode="light">
<UploadKitProvider options={uploadKitOptions} mode="light">
<WalletKitButton />
<UploadKitButton />
<Component {...pageProps} />
<SwitchNetworkModal />
</UploadKitProvider>
</WalletKitProvider>
</WagmiConfig>
);
}
Please follow our Greenfield UploadKit Contribution Guide.
See LICENSE for more information.