mirror of
https://github.com/pezkuwichain/pwap.git
synced 2026-06-24 11:01:08 +00:00
feat: Integrate Polkadot.js API and wallet connection
Major Changes: - Added @polkadot/api and related dependencies - Created PolkadotContext for blockchain connection - Implemented NetworkStats component with live data - Added PolkadotWalletButton for wallet integration - Connected to local validator node (ws://127.0.0.1:9944) Features: - Live block number and hash display - Real-time validator count - Network connection status monitoring - Polkadot.js extension integration - Multi-account support - Account switching capability Technical: - RPC endpoint: ws://127.0.0.1:9944 - Auto-reconnect on disconnect - TypeScript integration - React hooks for state management
This commit is contained in:
+9
-6
@@ -2,6 +2,7 @@ import { createRoot } from 'react-dom/client'
|
||||
import App from './App.tsx'
|
||||
import { WalletProvider } from './contexts/WalletContext'
|
||||
import { WebSocketProvider } from './contexts/WebSocketContext'
|
||||
import { PolkadotProvider } from './contexts/PolkadotContext'
|
||||
import './index.css'
|
||||
import './i18n/config'
|
||||
|
||||
@@ -14,9 +15,11 @@ declare global {
|
||||
|
||||
// Remove dark mode class addition
|
||||
createRoot(document.getElementById("root")!).render(
|
||||
<WalletProvider>
|
||||
<WebSocketProvider>
|
||||
<App />
|
||||
</WebSocketProvider>
|
||||
</WalletProvider>
|
||||
);
|
||||
<PolkadotProvider endpoint="ws://127.0.0.1:9944">
|
||||
<WalletProvider>
|
||||
<WebSocketProvider>
|
||||
<App />
|
||||
</WebSocketProvider>
|
||||
</WalletProvider>
|
||||
</PolkadotProvider>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user