Build an App on KUB
What you will build
Start Building
Set up your project
npx create-next-app@latest my-kub-app --typescript --tailwind --app
cd my-kub-app
npm install wagmi viem @tanstack/react-queryDefine the KUB networks and configure Wagmi
// config/chains.ts
import { defineChain } from 'viem'
export const kubTestnet = defineChain({
id: 25925,
name: 'KUB Testnet',
nativeCurrency: { name: 'tKUB', symbol: 'tKUB', decimals: 18 },
rpcUrls: {
default: { http: ['https://rpc-testnet.kubchain.io'] },
},
blockExplorers: {
default: { name: 'KUB Scan Testnet', url: 'https://testnet.kubscan.com' },
},
testnet: true,
})
export const kubMainnet = defineChain({
id: 96,
name: 'KUB Mainnet',
nativeCurrency: { name: 'KUB', symbol: 'KUB', decimals: 18 },
rpcUrls: {
default: { http: ['https://rpc.kubchain.io'] },
},
blockExplorers: {
default: { name: 'KUB Scan', url: 'https://kubscan.com' },
},
})Wrap your app in the providers
Wire the providers into the root layout
Connect wallets
Deploy the contract
Read contract data
Write to the contract
Assemble the page
Optional: Reach KUB Wallet users with the NEXT SDK
Next Steps
Last updated