-
Notifications
You must be signed in to change notification settings - Fork 45
add wallet connect #804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
jkbktl
wants to merge
18
commits into
main
Choose a base branch
from
feat/wallet-connect
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
add wallet connect #804
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
94b33e9
add connectkit
jkbktl 1f77f16
shared providers
jkbktl c4fa2a0
move turbopack from experimental
jkbktl 9b1f197
Update ignoreCommand in vercel.json
felicio 9a438fc
add button to portfolio, add wallet connect
jkbktl ad4c84e
f builds
jkbktl 5d9b97b
f
jkbktl f09ab88
f shared
jkbktl f1a7cb9
clean up
jkbktl 4d06181
u
jkbktl 2149f8d
Add wallet connect feature
jkbktl ddd77f7
u
jkbktl dfbe03c
u
jkbktl 4ae0414
update patches
jkbktl b8dd5c0
update turbo.json
jkbktl f2e7acf
fix barrel file
jkbktl 97b3a75
fix build
jkbktl 7880ee8
fix
jkbktl File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@status-im/status-network": patch | ||
"hub": patch | ||
--- | ||
|
||
add wallet connect |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,6 @@ const config = { | |
plugins: { | ||
tailwindcss: {}, | ||
}, | ||
}; | ||
} | ||
|
||
export default config; | ||
export default config |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
) | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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} ./", | ||
"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..." | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,6 @@ | |
"packages/wallet", | ||
"packages/status-network", | ||
"apps/hub", | ||
"apps/status.app", | ||
"apps/status.network", | ||
"apps/connector", | ||
"apps/portfolio", | ||
"apps/wallet", | ||
|
@@ -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", | ||
|
@@ -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": { | ||
|
@@ -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", | ||
|
@@ -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]", | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jkbktl marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
packages/status-network/src/components/shorten-address/index.tsx
jkbktl marked this conversation as resolved.
Show resolved
Hide resolved
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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.