-
- All networks
-
-
-
) => setSearchQuery(e.target.value)}
- placeholder="Search networks"
- leftIcon={SearchIcon}
- className="w-full pr-10"
+
+
+
+ {chains.map(chain => (
+
-
-
-
- {mainnets.length > 0 && (
-
-
- Mainnets
-
-
- {mainnets.map(chain => (
-
- ))}
-
-
- )}
-
- {testnets.length > 0 && (
-
-
- Testnets
-
-
- {testnets.map(chain => (
-
- ))}
-
-
- )}
-
- {mainnets.length === 0 && testnets.length === 0 && (
-
-
- No networks found
-
-
- )}
+ ))}
diff --git a/examples/components/src/WalletListItem.tsx b/examples/components/src/WalletListItem.tsx
index 37aa08b9e..34472ee0c 100644
--- a/examples/components/src/WalletListItem.tsx
+++ b/examples/components/src/WalletListItem.tsx
@@ -1,5 +1,5 @@
-import { truncateAtMiddle } from '@0xsequence/connect'
import { Button, Card, cn, Text } from '@0xsequence/design-system'
+import { truncateAtMiddle } from '@0xsequence/web-sdk-core'
interface WalletListItemProps {
id: string
diff --git a/examples/next/next.config.mjs b/examples/next/next.config.mjs
index 969508ef0..b7cbd2e97 100644
--- a/examples/next/next.config.mjs
+++ b/examples/next/next.config.mjs
@@ -1,3 +1,7 @@
+import { createVanillaExtractPlugin } from '@vanilla-extract/next-plugin'
+
+const withVanillaExtract = createVanillaExtractPlugin()
+
/** @type {import('next').NextConfig} */
const nextConfig = {
webpack: config => {
@@ -14,6 +18,7 @@ const nextConfig = {
}
return config
}
+ // transpilePackages: ['@0xsequence/kit', '@0xsequence/kit-wallet', '@0xsequence/kit-connectors', '@0xsequence/checkout']
}
-export default nextConfig
+export default withVanillaExtract(nextConfig)
diff --git a/examples/next/public/discord.svg b/examples/next/public/discord.svg
new file mode 100644
index 000000000..b4ca26f48
--- /dev/null
+++ b/examples/next/public/discord.svg
@@ -0,0 +1,18 @@
+
+
diff --git a/examples/next/public/github.svg b/examples/next/public/github.svg
new file mode 100644
index 000000000..5a9a1f46c
--- /dev/null
+++ b/examples/next/public/github.svg
@@ -0,0 +1,21 @@
+
+
diff --git a/examples/next/public/kit-logo-text.svg b/examples/next/public/kit-logo-text.svg
new file mode 100644
index 000000000..2d6def521
--- /dev/null
+++ b/examples/next/public/kit-logo-text.svg
@@ -0,0 +1,5 @@
+
\ No newline at end of file
diff --git a/examples/next/public/kit-logo.svg b/examples/next/public/kit-logo.svg
new file mode 100644
index 000000000..cc49f75de
--- /dev/null
+++ b/examples/next/public/kit-logo.svg
@@ -0,0 +1,60 @@
+
\ No newline at end of file
diff --git a/examples/next/public/next.svg b/examples/next/public/next.svg
new file mode 100644
index 000000000..5174b28c5
--- /dev/null
+++ b/examples/next/public/next.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/examples/next/public/twitter.svg b/examples/next/public/twitter.svg
new file mode 100644
index 000000000..46a33e5f7
--- /dev/null
+++ b/examples/next/public/twitter.svg
@@ -0,0 +1,18 @@
+
+
diff --git a/examples/next/public/youtube.svg b/examples/next/public/youtube.svg
new file mode 100644
index 000000000..4f8014f94
--- /dev/null
+++ b/examples/next/public/youtube.svg
@@ -0,0 +1,11 @@
+
\ No newline at end of file
diff --git a/examples/next/src/app/components/EnvironmentSetter.tsx b/examples/next/src/app/components/EnvironmentSetter.tsx
new file mode 100644
index 000000000..b576faf69
--- /dev/null
+++ b/examples/next/src/app/components/EnvironmentSetter.tsx
@@ -0,0 +1,11 @@
+'use client'
+
+import { isDevSequenceApis } from '@0xsequence/react-connect'
+
+export const EnvironmentSetter = () => {
+ globalThis.__WEB_SDK_DEV_GLOBAL__ = false
+
+ console.log('is dev environment: ', isDevSequenceApis())
+
+ return null
+}
diff --git a/examples/next/src/app/components/Footer.tsx b/examples/next/src/app/components/Footer.tsx
new file mode 100644
index 000000000..889937ef3
--- /dev/null
+++ b/examples/next/src/app/components/Footer.tsx
@@ -0,0 +1,143 @@
+import React from 'react'
+import { Box, Button, Image, Text, useMediaQuery, useTheme } from '@0xsequence/design-system'
+
+interface BottomPageLink {
+ label: string
+ url: string
+}
+
+export const bottomPageLinks: BottomPageLink[] = [
+ {
+ label: 'Terms',
+ url: 'https://sequence.xyz/terms'
+ },
+ {
+ label: 'About',
+ url: 'https://github.com/0xsequence/kit'
+ },
+ {
+ label: 'Blog',
+ url: 'https://sequence.xyz/blog'
+ },
+ {
+ label: 'Builder',
+ url: 'https://sequence.build'
+ },
+ {
+ label: 'Docs',
+ url: 'https://docs.sequence.xyz/wallet/connectors/kit/kit/overview'
+ }
+]
+
+interface SocialLinks {
+ id: string
+ url: string
+ icon: string
+}
+
+export const socialLinks: SocialLinks[] = [
+ {
+ id: 'discord',
+ url: 'https://discord.gg/sequence',
+ icon: 'discord.svg'
+ },
+ {
+ id: 'twitter',
+ url: 'https://www.twitter.com/0xsequence',
+ icon: 'twitter.svg'
+ },
+ {
+ id: 'youtube',
+ url: 'https://www.youtube.com/channel/UC1zHgUyV-doddTcnFNqt62Q',
+ icon: 'youtube.svg'
+ },
+ {
+ id: 'github',
+ url: 'https://github.com/0xsequence',
+ icon: 'github.svg'
+ }
+]
+
+export const Footer = () => {
+ const { theme } = useTheme()
+ const isMobile = useMediaQuery('isMobile')
+
+ const onClickLinkUrl = (url: string) => {
+ if (typeof window !== 'undefined') {
+ window.open(url)
+ }
+ }
+
+ const Links = () => {
+ return (
+
+ {bottomPageLinks.map((link, index) => (
+
+ )
+ }
+
+ const Socials = () => {
+ return (
+
+ {socialLinks.map((socialLink, index) => {
+ return (
+ {
+ if (typeof window !== 'undefined') {
+ window.open(socialLink.url)
+ }
+ }}
+ >
+
+
+ )
+ })}
+
+ )
+ }
+
+ if (isMobile) {
+ return (
+
+
+
+
+ )
+ }
+
+ return (
+
+
+
+
+ )
+}
diff --git a/examples/next/src/app/components/Header.tsx b/examples/next/src/app/components/Header.tsx
new file mode 100644
index 000000000..5afc75c53
--- /dev/null
+++ b/examples/next/src/app/components/Header.tsx
@@ -0,0 +1,39 @@
+import { truncateAddress } from '@/utils'
+import { Box, Image, Text, GradientAvatar } from '@0xsequence/design-system'
+import { useAccount } from 'wagmi'
+
+export const Header = () => {
+ const { address, connector } = useAccount()
+
+ return (
+
+
+
+
+
+
+
+
+
+
+ {truncateAddress(String(address), 8)}
+
+
+
+
+ {connector?.name}
+
+
+
+
+
+ )
+}
diff --git a/examples/next/src/app/layout.tsx b/examples/next/src/app/layout.tsx
index 5a773abb5..545daf095 100644
--- a/examples/next/src/app/layout.tsx
+++ b/examples/next/src/app/layout.tsx
@@ -1,11 +1,12 @@
+import './globals.css'
+import '@0xsequence/design-system/styles.css'
+import { ThemeProvider } from '@0xsequence/design-system'
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import { headers } from 'next/headers'
import { cookieToInitialState } from 'wagmi'
-import './globals.css'
-
-import { config } from '../config'
+import { wagmiConfig } from '../config'
import { Providers } from './Providers'
@@ -21,12 +22,14 @@ export default function RootLayout({
}: Readonly<{
children: React.ReactNode
}>) {
- const initialState = cookieToInitialState(config.wagmiConfig, headers().get('cookie'))
+ const initialState = cookieToInitialState(wagmiConfig, headers().get('cookie'))
return (
-
{children}
+
+ {children}
+
)
diff --git a/examples/next/tsconfig.json b/examples/next/tsconfig.json
index 5776f5c17..475ede0a4 100644
--- a/examples/next/tsconfig.json
+++ b/examples/next/tsconfig.json
@@ -7,8 +7,8 @@
"strict": true,
"noEmit": true,
"esModuleInterop": true,
- "module": "ESNext",
- "moduleResolution": "Bundler",
+ "module": "esnext",
+ "moduleResolution": "bundler",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
diff --git a/examples/nextjs-pages/.eslintrc.json b/examples/nextjs-pages/.eslintrc.json
new file mode 100644
index 000000000..bffb357a7
--- /dev/null
+++ b/examples/nextjs-pages/.eslintrc.json
@@ -0,0 +1,3 @@
+{
+ "extends": "next/core-web-vitals"
+}
diff --git a/examples/nextjs-pages/.gitignore b/examples/nextjs-pages/.gitignore
new file mode 100644
index 000000000..fd3dbb571
--- /dev/null
+++ b/examples/nextjs-pages/.gitignore
@@ -0,0 +1,36 @@
+# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
+
+# dependencies
+/node_modules
+/.pnp
+.pnp.js
+.yarn/install-state.gz
+
+# testing
+/coverage
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env*.local
+
+# vercel
+.vercel
+
+# typescript
+*.tsbuildinfo
+next-env.d.ts
diff --git a/examples/nextjs-pages/README.md b/examples/nextjs-pages/README.md
new file mode 100644
index 000000000..a75ac5248
--- /dev/null
+++ b/examples/nextjs-pages/README.md
@@ -0,0 +1,40 @@
+This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+npm run dev
+# or
+yarn dev
+# or
+pnpm dev
+# or
+bun dev
+```
+
+Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+
+You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
+
+[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
+
+The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
+
+This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
+
+## Learn More
+
+To learn more about Next.js, take a look at the following resources:
+
+- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
+
+You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
+
+## Deploy on Vercel
+
+The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
+
+Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
diff --git a/examples/nextjs-pages/next.config.js b/examples/nextjs-pages/next.config.js
new file mode 100644
index 000000000..82fddfd55
--- /dev/null
+++ b/examples/nextjs-pages/next.config.js
@@ -0,0 +1,11 @@
+/** @type {import('next').NextConfig} */
+const nextConfig = {
+ reactStrictMode: true,
+ experimental: {
+ esmExternals: 'loose'
+ // appDir: true,
+ },
+ transpilePackages: ['@0xsequence/kit', '@0xsequence/kit-connectors']
+}
+
+module.exports = nextConfig
diff --git a/examples/nextjs-pages/package.json b/examples/nextjs-pages/package.json
new file mode 100644
index 000000000..065826901
--- /dev/null
+++ b/examples/nextjs-pages/package.json
@@ -0,0 +1,38 @@
+{
+ "name": "@0xsequence/kit-example-nextjs-pages",
+ "version": "0.1.0",
+ "private": true,
+ "homepage": "kit",
+ "scripts": {
+ "dev": "next dev",
+ "build": "next build",
+ "start": "next start",
+ "lint": "next lint"
+ },
+ "dependencies": {
+ "react": "^18",
+ "react-dom": "^18",
+ "next": "14.2.35",
+ "0xsequence": "^1.4.9",
+ "@0xsequence/kit": "workspace:*",
+ "@0xsequence/kit-checkout": "workspace:*",
+ "@0xsequence/kit-connectors": "workspace:*",
+ "@0xsequence/kit-wallet": "workspace:*",
+ "ethers": "^5.7.2",
+ "framer-motion": "^8.5.2",
+ "query-string": "^8.1.0",
+ "viem": "1.10.7",
+ "wagmi": "^1.3.9"
+ },
+ "devDependencies": {
+ "typescript": "^5",
+ "@types/node": "^20",
+ "@types/react": "^18",
+ "@types/react-dom": "^18",
+ "autoprefixer": "^10.0.1",
+ "postcss": "^8",
+ "tailwindcss": "^3.3.0",
+ "eslint": "^8",
+ "eslint-config-next": "14.0.4"
+ }
+}
diff --git a/examples/nextjs-pages/pages/_app.tsx b/examples/nextjs-pages/pages/_app.tsx
new file mode 100644
index 000000000..5a4373b85
--- /dev/null
+++ b/examples/nextjs-pages/pages/_app.tsx
@@ -0,0 +1,42 @@
+import '@/styles/globals.css'
+import type { AppProps } from 'next/app'
+
+import { KitProvider } from '@0xsequence/kit'
+import { configureChains, createConfig, WagmiConfig } from 'wagmi'
+import { publicProvider } from 'wagmi/providers/public'
+import { mainnet, polygon } from 'wagmi/chains'
+import { getDefaultConnectors } from '@0xsequence/kit-connectors'
+
+// eslint-disable-next-line import/no-default-export
+export default function App({ Component, pageProps }: AppProps) {
+ // return
+
+ return (
+
+
+
+ )
+}
+
+const { chains, publicClient, webSocketPublicClient } = configureChains([polygon, mainnet], [publicProvider()])
+
+const connectors = getDefaultConnectors({
+ chains,
+ walletConnectProjectId: 'project_id',
+ defaultChainId: 137
+})
+
+const config = createConfig({
+ autoConnect: true,
+ publicClient,
+ webSocketPublicClient,
+ connectors
+})
+
+const Providers = ({ children }: { children: React.ReactNode }) => {
+ return (
+
+ {children}
+
+ )
+}
diff --git a/examples/nextjs-pages/pages/_document.tsx b/examples/nextjs-pages/pages/_document.tsx
new file mode 100644
index 000000000..54e8bf3e2
--- /dev/null
+++ b/examples/nextjs-pages/pages/_document.tsx
@@ -0,0 +1,13 @@
+import { Html, Head, Main, NextScript } from 'next/document'
+
+export default function Document() {
+ return (
+
+
+
+