Skip to content
Open
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
6 changes: 6 additions & 0 deletions .changeset/famous-deers-sell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@status-im/status-network": patch
"hub": patch
---

add wallet connect
16 changes: 11 additions & 5 deletions apps/hub/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,24 +15,30 @@
},
"dependencies": {
"@status-im/colors": "workspace:*",
"@status-im/icons": "workspace:*",
"@status-im/components": "workspace:*",
"@status-im/icons": "workspace:*",
"@status-im/status-network": "workspace:*",
"@status-im/wallet": "workspace:*",
"@tanstack/react-query": "5.66.0",
"@vercel/analytics": "^1.5.0",
"connectkit": "^1.9.0",
"cva": "1.0.0-beta.1",
"framer-motion": "^12.0.6",
"next": "15.1.6",
"next": "15.3.0",
"next-mdx-remote": "^5.0.0",
"react": "^19.0.0",
"react-dom": "^19.0.0",
"pino-pretty": "^13.1.1",
"react": "^19.1.0",
"react-dom": "^19.1.0",
"rehype-slug": "^6.0.0",
"ts-pattern": "^5.6.2",
"viem": "2.x",
"wagmi": "2.15.2",
"zod": "^3.24.1"
},
"devDependencies": {
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@next/eslint-plugin-next": "15.3.0",
"@status-im/eslint-config": "workspace:*",
"@ianvs/prettier-plugin-sort-imports": "^4.3.1",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
Expand Down
4 changes: 2 additions & 2 deletions apps/hub/postcss.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ const config = {
plugins: {
tailwindcss: {},
},
};
}

export default config;
export default config
41 changes: 41 additions & 0 deletions apps/hub/src/app/_components/connect-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
'use client'

import { Button, ShortenAddress } from '@status-im/status-network/components'
import { ConnectKitButton } from 'connectkit'
import { useAccount } from 'wagmi'

import type { ComponentProps } from 'react'

type Props = {
size?: ComponentProps<typeof Button>['size']
label?: string
}

const ConnectButton = (props: Props) => {
const { size = '32', label = 'Connect wallet' } = props

const { address, isConnected } = useAccount()

return (
<ConnectKitButton.Custom>
{({ show }) => {
return (
<Button
onClick={show}
variant={isConnected ? 'secondary' : 'primary'}
size={size}
>
{address && isConnected ? (
<ShortenAddress address={address} />
) : (
label
)}
</Button>
)
}}
</ConnectKitButton.Custom>
)
}

export { ConnectButton }
export type { Props as ConnectButtonProps }
9 changes: 4 additions & 5 deletions apps/hub/src/app/_components/top-bar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@

import { Button, IconButton, Tag } from '@status-im/components'
import { SettingsIcon } from '@status-im/icons/20'
import {
Button as ButtonPrimary,
Link,
} from '@status-im/status-network/components'
import { Link } from '@status-im/status-network/components'
import Image from 'next/image'

import { ConnectButton } from './connect-button'

interface TopBarProps {
onMenuToggle: () => void
}
Expand Down Expand Up @@ -64,7 +63,7 @@ export function TopBar({ onMenuToggle }: TopBarProps) {
</div>

{/* Connect Wallet Button */}
<ButtonPrimary size="32">Connect Wallet</ButtonPrimary>
<ConnectButton />

{/* Settings Button */}
<IconButton variant="ghost" icon={<SettingsIcon />} />
Expand Down
15 changes: 15 additions & 0 deletions apps/hub/src/app/_providers/connectkit-provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
'use client'

import { ConnectKitProvider as ConnectKit } from 'connectkit'

type ConnectKitProviderProps = {
children: React.ReactNode
}

export function ConnectKitProvider({ children }: ConnectKitProviderProps) {
return (
<ConnectKit theme="auto" mode="light">
{children}
</ConnectKit>
)
}
19 changes: 19 additions & 0 deletions apps/hub/src/app/_providers/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
'use client'

import { ConnectKitProvider } from './connectkit-provider'
import { QueryClientProvider } from './query-client-provider'
import { WagmiProvider } from './wagmi-provider'

interface ProvidersProps {
children: React.ReactNode
}

export function Providers({ children }: ProvidersProps) {
return (
<WagmiProvider>
<QueryClientProvider>
<ConnectKitProvider>{children}</ConnectKitProvider>
</QueryClientProvider>
</WagmiProvider>
)
}
31 changes: 31 additions & 0 deletions apps/hub/src/app/_providers/query-client-provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
'use client'

import { QueryClient, QueryClientProvider } from '@tanstack/react-query'

import type React from 'react'

const queryClient = new QueryClient({
defaultOptions: {
queries: {
retry: false,
retryOnMount: false,
refetchOnMount: false,
refetchOnWindowFocus: false,
refetchOnReconnect: false,
},
},
})

type Props = {
children: React.ReactNode
}

function _QueryClientProvider(props: Props) {
const { children } = props

return (
<QueryClientProvider client={queryClient}>{children}</QueryClientProvider>
)
}

export { _QueryClientProvider as QueryClientProvider }
45 changes: 45 additions & 0 deletions apps/hub/src/app/_providers/wagmi-provider.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
'use client'

import { createConfig, http, WagmiProvider as WagmiProviderBase } from 'wagmi'
import { mainnet } from 'wagmi/chains'
import { injected } from 'wagmi/connectors'

import type React from 'react'

export const config = createConfig({
chains: [mainnet],
ssr: false,
connectors: [injected()],
transports: {
// todo: replace public clients
[mainnet.id]: http(),
},
})

declare module 'wagmi' {
interface Register {
config: typeof config
}
}

type Props = {
children: React.ReactNode
}

function WagmiProvider(props: Props) {
const { children } = props

return (
<WagmiProviderBase
config={
config as unknown as React.ComponentProps<
typeof WagmiProviderBase
>['config']
}
>
{children}
</WagmiProviderBase>
)
}

export { config as wagmiConfig, WagmiProvider }
6 changes: 5 additions & 1 deletion apps/hub/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ import './globals.css'

import { Inter } from 'next/font/google'

import { Providers } from './_providers'

import type { Metadata } from 'next'

const inter = Inter({
Expand All @@ -22,7 +24,9 @@ export default function RootLayout({
}) {
return (
<html lang="en" className={inter.variable}>
<body className="font-inter antialiased">{children}</body>
<body className="font-inter antialiased">
<Providers>{children}</Providers>
</body>
</html>
)
}
2 changes: 1 addition & 1 deletion apps/hub/vercel.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"$schema": "https://openapi.vercel.sh/vercel.json",
"ignoreCommand": "git diff --quiet HEAD^ HEAD ../../{patches,package.json,turbo.json} ../../packages/{colors,icons} ./",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First manually triggered the build. And then added these dependencies.

"ignoreCommand": "git diff --quiet HEAD^ HEAD ../../{patches,package.json,turbo.json} ../../packages/{colors,icons,components,wallet,status-network} ./",
"installCommand": "pnpm install --dir ../../ --frozen-lockfile",
"buildCommand": "turbo run build --cwd ../../ --filter=./apps/hub..."
}
22 changes: 12 additions & 10 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
"packages/wallet",
"packages/status-network",
"apps/hub",
"apps/status.app",
"apps/status.network",
"apps/connector",
"apps/portfolio",
"apps/wallet",
Expand All @@ -24,7 +22,7 @@
"preinstall": "npx only-allow pnpm",
"prepare": "husky install",
"test": "turbo run test --filter=@status-im/* --filter=./apps/* -- --run",
"dev": "turbo run dev dev:next dev:content --filter=@status-im/* --filter=./apps/*",
"dev": "turbo run dev --filter=@status-im/* --filter=./apps/*",
"build": "turbo run build --filter=@status-im/* --filter=./apps/*",
"lint": "turbo run lint --filter=@status-im/* --filter=./apps/*",
"typecheck": "turbo run typecheck",
Expand All @@ -35,13 +33,17 @@
},
"resolutions": {
"@types/react": "19.1.0",
"@types/react-dom": "19.1.1",
"@types/react-dom": "19.1.0",
"react": "19.1.0",
"react-dom": "19.1.0",
"viem": "2.29.1",
"wagmi": "2.15.2",
"zod": "3.23.8",
"vite": "6.3.5",
"vitest": "3.1.4",
"vite-node": "3.1.4",
"protons-runtime": "3.1.0",
"it-length-prefixed": "9.0.3",
"it-length-prefixed": "9.1.1",
"remark-lint": "9.1.2"
},
"devDependencies": {
Expand All @@ -56,9 +58,9 @@
"lint-staged": "^15.2.10",
"prettier": "^3.3.3",
"prettier-plugin-tailwindcss": "^0.6.6",
"react": "^18.3.1",
"react": "^19.1.0",
"react-devtools": "^6.1.5",
"react-dom": "^18.3.1",
"react-dom": "^19.1.0",
"rimraf": "^4.4.1",
"turbo": "^2.5.6",
"typescript": "^5.6.2",
Expand All @@ -74,9 +76,9 @@
},
"pnpm": {
"patchedDependencies": {
"@achingbrain/ssdp@4.0.1": "patches/@achingbrain__ssdp@4.0.1.patch",
"@libp2p/[email protected].10": "patches/@[email protected].10.patch",
"it-length-prefixed@9.0.3": "patches/it-length-prefixed@9.0.3.patch",
"@achingbrain/ssdp@4.2.4": "patches/@achingbrain__ssdp@4.2.4.patch",
"@libp2p/[email protected].12": "patches/@[email protected].12.patch",
"it-length-prefixed@9.1.1": "patches/it-length-prefixed@9.1.1.patch",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
"[email protected]": "patches/[email protected]",
Expand Down
1 change: 1 addition & 0 deletions packages/status-network/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@
"@status-im/colors": "workspace:*",
"@status-im/components": "workspace:*",
"@status-im/icons": "workspace:*",
"connectkit": "^1.9.0",
"cva": "^1.0.0-beta.1",
"framer-motion": "^12.0.6",
"next": "15.1.6",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ export { GameCard } from './cards'
export { Divider } from './divider'
export { Footer } from './footer'
export { Link } from './link'
export { ShortenAddress } from './shorten-address'
19 changes: 19 additions & 0 deletions packages/status-network/src/components/shorten-address/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
type Props = {
address: string
}

export const shortenAddress = (address: string) => {
const prefix = address.slice(0, 5)
const suffix = address.slice(-4)

return `${prefix}...${suffix}`
}

const ShortenAddress = ({ address }: Props) => {
const shortenedAddress = shortenAddress(address)

return shortenedAddress
}

export { ShortenAddress }
export type { Props as ShortenAddressProps }
2 changes: 1 addition & 1 deletion packages/status-network/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export default defineConfig(({ mode }) => {
target: 'es2020',
lib: {
entry: {
'components/index': './src/components/index.tsx',
'components/index': './src/components/index.ts',
'config/index': './src/config/index.ts',
'tailwind.config': './tailwind.config.ts',
'hooks/index': './src/hooks/index.ts',
Expand Down
17 changes: 0 additions & 17 deletions patches/@[email protected]

This file was deleted.

15 changes: 15 additions & 0 deletions patches/@[email protected]
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
diff --git a/dist/src/ssdp.js b/dist/src/ssdp.js
index f186aa77bb50bc85650e220c842238b1b9da16d9..203b1b7142fb4c63983d9f096354b7211e1c810b 100644
--- a/dist/src/ssdp.js
+++ b/dist/src/ssdp.js
@@ -10,8 +10,8 @@ import { discover } from './discover/index.js';
import { searchResponse } from './discover/search-response.js';
import { parseSsdpMessage } from './parse-ssdp-message.js';
import { sendSsdpMessage } from './send-ssdp-message.js';
-const req = createRequire(import.meta.url);
-const { name, version } = req('../../package.json');
+const name = '@achingbrain/ssdp';
+const version = '4.2.4';
const DEFAULT_SSDP_SIGNATURE = `node.js/${process.version.substring(1)} UPnP/1.1 ${name}/${version}`;
export class SSDP extends EventEmitter {
udn;
Loading
Loading