diff --git a/.changeset/small-ladybugs-agree.md b/.changeset/small-ladybugs-agree.md new file mode 100644 index 0000000000..fbdb88fe80 --- /dev/null +++ b/.changeset/small-ladybugs-agree.md @@ -0,0 +1,183 @@ +--- +"@rainbow-me/rainbowkit": minor +--- + +The Authentication API now supports ERC-1271 and ERC-6492 for smart contract signature verification to enable Sign-in with Ethereum for Smart Contract Wallets, including Coinbase Smart Wallet and Argent. + +We have also deprecated the `siwe` and `ethers` peer dependencies in favor of `viem/siwe` to make RainbowKit even more seamless. + +No changes are necessary for dApps that don't rely on the Authentication API. + +Follow the appropriate steps below to migrate. + +** NextAuth Authentication ** + +1. Remove `siwe` and `ethers` + +```bash +npm uninstall siwe ethers +``` + +2. Upgrade RainbowKit, `rainbowkit-siwe-next-auth`, and `viem` + +```bash +npm i @rainbow-me/rainbowkit@^2.2.0 rainbow-me/rainbowkit-siwe-next-auth@^0.5.0 viem@^2.12.0 +``` + +3. Create a Public Client + +This allows `viem` to verify smart contract signatures. + +```diff +const config = getDefaultConfig({ + /* your config */ +}); ++ const publicClient = config.getClient().extend(publicActions); +``` + +4. Adjust your `authorize` implementation in `/api/auth/[...nextauth].ts` + +```diff +- import { SiweMessage } from 'siwe'; ++ import { ++ type SiweMessage, ++ parseSiweMessage, ++ validateSiweMessage, ++ } from 'viem/siwe'; + +export function getAuthOptions(req: IncomingMessage): NextAuthOptions { + const providers = [ + CredentialsProvider({ + async authorize(credentials: any) { + +- const siwe = new SiweMessage( +- JSON.parse(credentials?.message || '{}'), +- ); ++ const siweMessage = parseSiweMessage( ++ credentials?.message, ++ ) as SiweMessage; + ++ if (!validateSiweMessage({ ++ address: siweMessage?.address, ++ message: siweMessage, ++ })) { ++ return null; ++ } + + /* ... */ + +- await siwe.verify({ signature: credentials?.signature || '' }); ++ const valid = await publicClient.verifyMessage({ ++ address: siweMessage?.address, ++ message: credentials?.message, ++ signature: credentials?.signature, ++ }); + ++ if (!valid) { ++ return null; ++ } + }, + /* ... */ + }) + ] +} +``` + +Reference the [with-next-siwe-next-auth](https://github.com/rainbow-me/rainbowkit/tree/main/examples/with-next-siwe-next-auth) example for more guidance. + +** Custom Authentication ** + +1. Remove `siwe` and `ethers` + +```bash +npm uninstall siwe ethers +``` + +2. Upgrade RainbowKit and `viem` + +```bash +npm i @rainbow-me/rainbowkit@^2.2.0 viem@^2.12.0 +``` + +3. Create a Public Client + +This allows `viem` to verify smart contract signatures. + +```diff +const config = getDefaultConfig({ + /* your config */ +}); + ++ const publicClient = config.getClient().extend(publicActions); +``` + +4. Adjust your `createAuthenticationAdapter` implementation + +```diff +- import { SiweMessage } from 'siwe'; ++ import { createSiweMessage } from 'viem/siwe'; + +createAuthenticationAdapter({ + getNonce: async () => { + const response = await fetch('/api/nonce'); + return await response.text(); + }, + + createMessage: ({ nonce, address, chainId }) => { +- return new SiweMessage({ ++ return createSiweMessage({ + domain: window.location.host, + address, + statement: 'Sign in with Ethereum to the app.', + uri: window.location.origin, + version: '1', + chainId, + nonce, + }); + }, + +- getMessageBody: ({ message }) => { +- return message.prepareMessage(); +- }, + + /* ... */ +}) +``` + +5. Adopt `generateSiweNonce` + +```diff +- import { generateNonce } from 'siwe'; ++ import { generateSiweNonce } from 'viem/siwe'; + +- req.session.nonce = generateNonce(); ++ req.session.nonce = generateSiweNonce(); +``` + +6. Adopt `parseSiweMessage` and `verifyMessage` if your Verify handler + +```diff +- import { SiweMessage } from 'siwe'; ++ import { parseSiweMessage, type SiweMessage } from 'viem/siwe'; + +const { message, signature } = req.body; +- const siweMessage = new SiweMessage(message); +- const { success, error, data } = await siweMessage.verify({ +- signature, +- }); ++ const siweMessage = parseSiweMessage(message) as SiweMessage; ++ const success = await publicClient.verifyMessage({ ++ address: siweMessage.address, ++ message, ++ signature, ++ }); + +- if (!success) throw error; ++ if (!success) throw new Error('Invalid signature.'); + +- if (data.nonce !== req.session.nonce) ++ if (siweMessage.nonce !== req.session.nonce) ++ return res.status(422).json({ message: 'Invalid nonce.' }); +``` + +Reference the [with-next-siwe-iron-session](https://github.com/rainbow-me/rainbowkit/tree/main/examples/with-next-siwe-iron-session) example for more guidance. \ No newline at end of file diff --git a/.changeset/witty-knives-exercise.md b/.changeset/witty-knives-exercise.md new file mode 100644 index 0000000000..8600ff1ec1 --- /dev/null +++ b/.changeset/witty-knives-exercise.md @@ -0,0 +1,82 @@ +--- +"@rainbow-me/rainbowkit-siwe-next-auth": minor +--- + +The Authentication API now supports ERC-1271 and ERC-6492 for smart contract signature verification to enable Sign-in with Ethereum for Smart Contract Wallets. + +We have also deprecated the `siwe` and `ethers` peer dependencies in favor of `viem/siwe`. + +Follow the appropriate steps below to migrate. + +1. Remove `siwe` and `ethers` + +```bash +npm uninstall siwe ethers +``` + +2. Upgrade RainbowKit, `rainbowkit-siwe-next-auth`, and `viem` + +```bash +npm i @rainbow-me/rainbowkit@^2.2.0 rainbow-me/rainbowkit-siwe-next-auth@^0.5.0 viem@^2.12.0 +``` + +3. Create a Public Client + +This allows `viem` to verify smart contract signatures. + +```diff +const config = getDefaultConfig({ + /* your config */ +}); ++ const publicClient = config.getClient().extend(publicActions); +``` + +4. Adjust your `authorize` implementation in `/api/auth/[...nextauth].ts` + +```diff +- import { SiweMessage } from 'siwe'; ++ import { ++ type SiweMessage, ++ parseSiweMessage, ++ validateSiweMessage, ++ } from 'viem/siwe'; + +export function getAuthOptions(req: IncomingMessage): NextAuthOptions { + const providers = [ + CredentialsProvider({ + async authorize(credentials: any) { + +- const siwe = new SiweMessage( +- JSON.parse(credentials?.message || '{}'), +- ); ++ const siweMessage = parseSiweMessage( ++ credentials?.message, ++ ) as SiweMessage; + ++ if (!validateSiweMessage({ ++ address: siweMessage?.address, ++ message: siweMessage, ++ })) { ++ return null; ++ } + + /* ... */ + +- await siwe.verify({ signature: credentials?.signature || '' }); ++ const valid = await publicClient.verifyMessage({ ++ address: siweMessage?.address, ++ message: credentials?.message, ++ signature: credentials?.signature, ++ }); + ++ if (!valid) { ++ return null; ++ } + }, + /* ... */ + }) + ] +} +``` + +Reference the [with-next-siwe-next-auth](https://github.com/rainbow-me/rainbowkit/tree/main/examples/with-next-siwe-next-auth) example for more guidance. \ No newline at end of file diff --git a/examples/with-next-siwe-iron-session/package.json b/examples/with-next-siwe-iron-session/package.json index 95d9f19d8a..b983284093 100644 --- a/examples/with-next-siwe-iron-session/package.json +++ b/examples/with-next-siwe-iron-session/package.json @@ -9,12 +9,10 @@ }, "dependencies": { "@rainbow-me/rainbowkit": "workspace:*", - "ethers": "^5.6.8", "iron-session": "^6.3.1", "next": "^14.2.10", "react": "^18.3.1", "react-dom": "^18.3.1", - "siwe": "^2.1.4", "viem": "2.17.0", "wagmi": "^2.12.17", "@tanstack/react-query": "^5.55.3" diff --git a/examples/with-next-siwe-iron-session/src/pages/_app.tsx b/examples/with-next-siwe-iron-session/src/pages/_app.tsx index b52cbb22a7..46d9f002d5 100644 --- a/examples/with-next-siwe-iron-session/src/pages/_app.tsx +++ b/examples/with-next-siwe-iron-session/src/pages/_app.tsx @@ -13,7 +13,7 @@ import { RainbowKitAuthenticationProvider, AuthenticationStatus, } from '@rainbow-me/rainbowkit'; -import { SiweMessage } from 'siwe'; +import { createSiweMessage } from 'viem/siwe'; import { config } from '../wagmi'; @@ -60,7 +60,7 @@ export default function App({ Component, pageProps }: AppProps) { }, createMessage: ({ nonce, address, chainId }) => { - return new SiweMessage({ + return createSiweMessage({ domain: window.location.host, address, statement: 'Sign in with Ethereum to the app.', @@ -71,10 +71,6 @@ export default function App({ Component, pageProps }: AppProps) { }); }, - getMessageBody: ({ message }) => { - return message.prepareMessage(); - }, - verify: async ({ message, signature }) => { verifyingRef.current = true; diff --git a/examples/with-next-siwe-iron-session/src/pages/api/nonce.ts b/examples/with-next-siwe-iron-session/src/pages/api/nonce.ts index fa46c07818..9f82501a62 100644 --- a/examples/with-next-siwe-iron-session/src/pages/api/nonce.ts +++ b/examples/with-next-siwe-iron-session/src/pages/api/nonce.ts @@ -1,13 +1,14 @@ import { withIronSessionApiRoute } from 'iron-session/next'; import { NextApiRequest, NextApiResponse } from 'next'; -import { generateNonce } from 'siwe'; +import { generateSiweNonce } from 'viem/siwe'; + import { ironOptions } from '../../../lib/iron'; const handler = async (req: NextApiRequest, res: NextApiResponse) => { const { method } = req; switch (method) { case 'GET': - req.session.nonce = generateNonce(); + req.session.nonce = generateSiweNonce(); await req.session.save(); res.setHeader('Content-Type', 'text/plain'); res.send(req.session.nonce); diff --git a/examples/with-next-siwe-iron-session/src/pages/api/verify.ts b/examples/with-next-siwe-iron-session/src/pages/api/verify.ts index 54cdd7d6df..9e879cee9d 100644 --- a/examples/with-next-siwe-iron-session/src/pages/api/verify.ts +++ b/examples/with-next-siwe-iron-session/src/pages/api/verify.ts @@ -1,7 +1,9 @@ import { withIronSessionApiRoute } from 'iron-session/next'; import { NextApiRequest, NextApiResponse } from 'next'; -import { SiweMessage } from 'siwe'; +import { parseSiweMessage, type SiweMessage } from 'viem/siwe'; + import { ironOptions } from '../../../lib/iron'; +import { publicClient } from '../../wagmi'; const handler = async (req: NextApiRequest, res: NextApiResponse) => { const { method } = req; @@ -9,17 +11,20 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { case 'POST': try { const { message, signature } = req.body; - const siweMessage = new SiweMessage(message); - const { success, error, data } = await siweMessage.verify({ + const siweMessage = parseSiweMessage(message) as SiweMessage; + + const success = await publicClient.verifyMessage({ + address: siweMessage.address, + message, signature, }); - if (!success) throw error; + if (!success) throw new Error('Invalid signature.'); - if (data.nonce !== req.session.nonce) + if (siweMessage.nonce !== req.session.nonce) return res.status(422).json({ message: 'Invalid nonce.' }); - req.session.siwe = data; + req.session.siwe = siweMessage; await req.session.save(); res.json({ ok: true }); } catch (_error) { diff --git a/examples/with-next-siwe-iron-session/src/wagmi.ts b/examples/with-next-siwe-iron-session/src/wagmi.ts index 6b7cd65cf5..cf4e757368 100644 --- a/examples/with-next-siwe-iron-session/src/wagmi.ts +++ b/examples/with-next-siwe-iron-session/src/wagmi.ts @@ -1,4 +1,5 @@ import { getDefaultConfig } from '@rainbow-me/rainbowkit'; +import { publicActions } from 'viem'; import { arbitrum, base, @@ -21,3 +22,5 @@ export const config = getDefaultConfig({ ], ssr: true, }); + +export const publicClient = config.getClient().extend(publicActions); diff --git a/examples/with-next-siwe-iron-session/types/iron-session.d.ts b/examples/with-next-siwe-iron-session/types/iron-session.d.ts index 298873b71a..403fe527b0 100644 --- a/examples/with-next-siwe-iron-session/types/iron-session.d.ts +++ b/examples/with-next-siwe-iron-session/types/iron-session.d.ts @@ -1,5 +1,5 @@ import 'iron-session'; -import { SiweMessage } from 'siwe'; +import type { SiweMessage } from 'viem/siwe'; declare module 'iron-session' { interface IronSessionData { diff --git a/examples/with-next-siwe-next-auth/package.json b/examples/with-next-siwe-next-auth/package.json index d2587780c4..bbe2ca4563 100644 --- a/examples/with-next-siwe-next-auth/package.json +++ b/examples/with-next-siwe-next-auth/package.json @@ -10,12 +10,10 @@ "dependencies": { "@rainbow-me/rainbowkit": "workspace:*", "@rainbow-me/rainbowkit-siwe-next-auth": "workspace:*", - "ethers": "^5.6.8", "next": "^14.2.10", "next-auth": "4.24.5", "react": "^18.3.1", "react-dom": "^18.3.1", - "siwe": "^2.1.4", "viem": "2.17.0", "wagmi": "^2.12.17", "@tanstack/react-query": "^5.55.3" diff --git a/examples/with-next-siwe-next-auth/src/pages/_app.tsx b/examples/with-next-siwe-next-auth/src/pages/_app.tsx index 0d1f39c84c..40f8beba69 100644 --- a/examples/with-next-siwe-next-auth/src/pages/_app.tsx +++ b/examples/with-next-siwe-next-auth/src/pages/_app.tsx @@ -13,7 +13,6 @@ import { GetSiweMessageOptions, } from '@rainbow-me/rainbowkit-siwe-next-auth'; - import { config } from '../wagmi'; const getSiweMessageOptions: GetSiweMessageOptions = () => ({ diff --git a/examples/with-next-siwe-next-auth/src/pages/api/auth/[...nextauth].ts b/examples/with-next-siwe-next-auth/src/pages/api/auth/[...nextauth].ts index fd1ab7026b..ce58556c16 100644 --- a/examples/with-next-siwe-next-auth/src/pages/api/auth/[...nextauth].ts +++ b/examples/with-next-siwe-next-auth/src/pages/api/auth/[...nextauth].ts @@ -1,22 +1,33 @@ -// Code in this file is based on https://docs.login.xyz/integrations/nextauth.js -// with added process.env.VERCEL_URL detection to support preview deployments -// and with auth option logic extracted into a 'getAuthOptions' function so it -// can be used to get the session server-side with 'getServerSession' import { IncomingMessage } from 'http'; import { NextApiRequest, NextApiResponse } from 'next'; import NextAuth, { NextAuthOptions } from 'next-auth'; import CredentialsProvider from 'next-auth/providers/credentials'; import { getCsrfToken } from 'next-auth/react'; -import { SiweMessage } from 'siwe'; +import { + type SiweMessage, + parseSiweMessage, + validateSiweMessage, +} from 'viem/siwe'; + +import { publicClient } from '../../../wagmi'; export function getAuthOptions(req: IncomingMessage): NextAuthOptions { const providers = [ CredentialsProvider({ - async authorize(credentials) { + async authorize(credentials: any) { try { - const siwe = new SiweMessage( - JSON.parse(credentials?.message || '{}') - ); + const siweMessage = parseSiweMessage( + credentials?.message, + ) as SiweMessage; + + if ( + !validateSiweMessage({ + address: siweMessage?.address, + message: siweMessage, + }) + ) { + return null; + } const nextAuthUrl = process.env.NEXTAUTH_URL || @@ -28,20 +39,29 @@ export function getAuthOptions(req: IncomingMessage): NextAuthOptions { } const nextAuthHost = new URL(nextAuthUrl).host; - if (siwe.domain !== nextAuthHost) { + if (siweMessage.domain !== nextAuthHost) { return null; } if ( - siwe.nonce !== + siweMessage.nonce !== (await getCsrfToken({ req: { headers: req.headers } })) ) { return null; } - await siwe.verify({ signature: credentials?.signature || '' }); + const valid = await publicClient.verifyMessage({ + address: siweMessage?.address, + message: credentials?.message, + signature: credentials?.signature, + }); + + if (!valid) { + return null; + } + return { - id: siwe.address, + id: siweMessage.address, }; } catch (e) { return null; @@ -57,7 +77,7 @@ export function getAuthOptions(req: IncomingMessage): NextAuthOptions { label: 'Signature', placeholder: '0x0', type: 'text', - }, + } }, name: 'Ethereum', }), diff --git a/examples/with-next-siwe-next-auth/src/wagmi.ts b/examples/with-next-siwe-next-auth/src/wagmi.ts index ffd1dd06cb..cf4e757368 100644 --- a/examples/with-next-siwe-next-auth/src/wagmi.ts +++ b/examples/with-next-siwe-next-auth/src/wagmi.ts @@ -1,4 +1,5 @@ import { getDefaultConfig } from '@rainbow-me/rainbowkit'; +import { publicActions } from 'viem'; import { arbitrum, base, @@ -20,4 +21,6 @@ export const config = getDefaultConfig({ ...(process.env.NEXT_PUBLIC_ENABLE_TESTNETS === 'true' ? [sepolia] : []), ], ssr: true, -}); \ No newline at end of file +}); + +export const publicClient = config.getClient().extend(publicActions); diff --git a/package.json b/package.json index 9d4307dd6c..0bbcc99fac 100644 --- a/package.json +++ b/package.json @@ -59,7 +59,6 @@ "dotenv": "^16.4.5", "esbuild": "^0.20.2", "esbuild-plugin-replace": "^1.4.0", - "ethers": "^5.6.8", "husky": "^9.1.5", "jsdom": "^25.0.0", "next": "^14.2.10", diff --git a/packages/example/package.json b/packages/example/package.json index 43d0ac6aac..9a7a061276 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -9,12 +9,10 @@ "@rainbow-me/rainbowkit-siwe-next-auth": "workspace:*", "@rainbow-me/rainbow-button": "workspace:*", "@tanstack/react-query": "^5.55.3", - "ethers": "^5.6.8", "next": "^14.2.10", "next-auth": "4.24.5", "react": "^18.3.1", "react-dom": "^18.3.1", - "siwe": "^2.1.4", "viem": "2.17.0", "wagmi": "^2.12.17" }, diff --git a/packages/example/src/pages/api/auth/[...nextauth].ts b/packages/example/src/pages/api/auth/[...nextauth].ts index bb79cf6228..eb4f27bbfc 100644 --- a/packages/example/src/pages/api/auth/[...nextauth].ts +++ b/packages/example/src/pages/api/auth/[...nextauth].ts @@ -1,22 +1,33 @@ -// Code in this file is based on https://docs.login.xyz/integrations/nextauth.js -// with added process.env.VERCEL_URL detection to support preview deployments -// and with auth option logic extracted into a 'getAuthOptions' function so it -// can be used to get the session server-side with 'getServerSession' import type { IncomingMessage } from 'node:http'; import type { NextApiRequest, NextApiResponse } from 'next'; import NextAuth, { type NextAuthOptions } from 'next-auth'; import CredentialsProvider from 'next-auth/providers/credentials'; import { getCsrfToken } from 'next-auth/react'; -import { SiweMessage } from 'siwe'; +import { + type SiweMessage, + parseSiweMessage, + validateSiweMessage, +} from 'viem/siwe'; + +import { publicClient } from '../../../wagmi'; export function getAuthOptions(req: IncomingMessage): NextAuthOptions { const providers = [ CredentialsProvider({ - async authorize(credentials) { + async authorize(credentials: any) { try { - const siwe = new SiweMessage( - JSON.parse(credentials?.message || '{}'), - ); + const siweMessage = parseSiweMessage( + credentials?.message, + ) as SiweMessage; + + if ( + !validateSiweMessage({ + address: siweMessage?.address, + message: siweMessage, + }) + ) { + return null; + } const nextAuthUrl = process.env.NEXTAUTH_URL || @@ -28,20 +39,29 @@ export function getAuthOptions(req: IncomingMessage): NextAuthOptions { } const nextAuthHost = new URL(nextAuthUrl).host; - if (siwe.domain !== nextAuthHost) { + if (siweMessage.domain !== nextAuthHost) { return null; } if ( - siwe.nonce !== + siweMessage.nonce !== (await getCsrfToken({ req: { headers: req.headers } })) ) { return null; } - await siwe.verify({ signature: credentials?.signature || '' }); + const valid = await publicClient.verifyMessage({ + address: siweMessage?.address, + message: credentials?.message, + signature: credentials?.signature, + }); + + if (!valid) { + return null; + } + return { - id: siwe.address, + id: siweMessage.address, }; } catch (e) { console.error('siwe authorization failed', e); diff --git a/packages/example/src/wagmi.ts b/packages/example/src/wagmi.ts index 6c6b460511..c7c958579d 100644 --- a/packages/example/src/wagmi.ts +++ b/packages/example/src/wagmi.ts @@ -59,6 +59,7 @@ import { zealWallet, zerionWallet, } from '@rainbow-me/rainbowkit/wallets'; +import { publicActions } from 'viem'; import { arbitrum, arbitrumSepolia, @@ -242,3 +243,5 @@ export const config = getDefaultConfig({ ], ssr: true, }); + +export const publicClient = config.getClient().extend(publicActions); diff --git a/packages/rainbowkit-siwe-next-auth/README.md b/packages/rainbowkit-siwe-next-auth/README.md index b0b0e72fb3..7f3e2372d3 100644 --- a/packages/rainbowkit-siwe-next-auth/README.md +++ b/packages/rainbowkit-siwe-next-auth/README.md @@ -4,26 +4,20 @@ # rainbowkit-siwe-next-auth -[Sign-In with Ethereum](https://login.xyz) and [NextAuth.js](https://next-auth.js.org) authentication adapter for [RainbowKit](https://www.rainbowkit.com). - -This package is designed to work with the [official Sign-In with Ethereum boilerplate for NextAuth.js.](https://docs.login.xyz/integrations/nextauth.js) +[Sign-In with Ethereum](https://login.xyz) and [NextAuth](https://next-auth.js.org) authentication adapter for [RainbowKit](https://www.rainbowkit.com). ## Usage -### Set up Sign-In with Ethereum and NextAuth.js - -If you haven't already, first set up your [Next.js](https://nextjs.org) project with the [official Sign-In with Ethereum boilerplate for NextAuth.js.](https://docs.login.xyz/integrations/nextauth.js) +### Set up Sign-In with Ethereum and NextAuth ### Install -Install the `@rainbow-me/rainbowkit-siwe-next-auth` package and its peer dependency, [ethers](https://docs.ethers.org/v5/). +Install the `@rainbow-me/rainbowkit-siwe-next-auth` package. ```bash -npm install @rainbow-me/rainbowkit-siwe-next-auth siwe@^2 ethers@^5 +npm install @rainbow-me/rainbowkit-siwe-next-auth ``` -> Note: `siwe` requires the [ethers](https://docs.ethers.org/v5/) peer dependency, while [wagmi](https://wagmi.sh/) now relies on the alternative [viem](https://viem.sh). - ### Set up the provider In your `App` component, import `RainbowKitSiweNextAuthProvider`. @@ -66,7 +60,7 @@ With `RainbowKitSiweNextAuthProvider` in place, your users will now be prompted ### Customize the SIWE message options -You can customize the [SIWE message options](https://github.com/spruceid/siwe/blob/v1.1.6/packages/siwe/lib/client.ts#L29) by passing a function to the `getSiweMessageOptions` prop on `RainbowKitSiweNextAuthProvider`. +You can customize the [SIWE message options](https://viem.sh/docs/siwe/utilities/createSiweMessage#parameters) by passing a function to the `getSiweMessageOptions` prop on `RainbowKitSiweNextAuthProvider`. This function will be called whenever a new message is created. Options returned from this function will be merged with the defaults. @@ -133,7 +127,7 @@ export default function AuthenticatedPage({ address }: AuthenticatedPageProps) { For more information about managing the session, you can refer to the following documentation: - [Next.js authentication guide](https://nextjs.org/docs/authentication) -- [NextAuth.js documentation](https://next-auth.js.org) +- [NextAuth documentation](https://next-auth.js.org) ## Contributing diff --git a/packages/rainbowkit-siwe-next-auth/package.json b/packages/rainbowkit-siwe-next-auth/package.json index 581662150d..75161517ed 100644 --- a/packages/rainbowkit-siwe-next-auth/package.json +++ b/packages/rainbowkit-siwe-next-auth/package.json @@ -1,7 +1,7 @@ { "name": "@rainbow-me/rainbowkit-siwe-next-auth", "version": "0.4.1", - "description": "RainbowKit authentication adapter for Sign-In with Ethereum and NextAuth.js", + "description": "RainbowKit authentication adapter for Sign-In with Ethereum and NextAuth", "files": [ "dist" ], @@ -31,13 +31,10 @@ "peerDependencies": { "@rainbow-me/rainbowkit": "2.0.x || 2.1.x", "next-auth": ">=4.21.0 <5", - "react": ">=18", - "siwe": "^2.1.4" + "react": ">=18" }, "devDependencies": { - "@rainbow-me/rainbowkit": "workspace:*", - "ethers": "^5.6.8", - "siwe": "^2.1.4" + "@rainbow-me/rainbowkit": "workspace:*" }, "repository": { "type": "git", diff --git a/packages/rainbowkit-siwe-next-auth/src/RainbowKitSiweNextAuthProvider.tsx b/packages/rainbowkit-siwe-next-auth/src/RainbowKitSiweNextAuthProvider.tsx index b0219cba30..4c13e6a3f8 100644 --- a/packages/rainbowkit-siwe-next-auth/src/RainbowKitSiweNextAuthProvider.tsx +++ b/packages/rainbowkit-siwe-next-auth/src/RainbowKitSiweNextAuthProvider.tsx @@ -4,10 +4,11 @@ import { } from '@rainbow-me/rainbowkit'; import { getCsrfToken, signIn, signOut, useSession } from 'next-auth/react'; import React, { type ReactNode, useMemo } from 'react'; -import { SiweMessage } from 'siwe'; +import type { Address } from 'viem'; +import { type SiweMessage, createSiweMessage } from 'viem/siwe'; type UnconfigurableMessageOptions = { - address: string; + address: Address; chainId: number; nonce: string; }; @@ -36,7 +37,12 @@ export function RainbowKitSiweNextAuthProvider({ () => createAuthenticationAdapter({ createMessage: ({ address, chainId, nonce }) => { - const defaultConfigurableOptions: ConfigurableMessageOptions = { + const defaultConfigurableOptions: Required< + Pick< + ConfigurableMessageOptions, + 'domain' | 'uri' | 'version' | 'statement' + > + > = { domain: window.location.host, statement: 'Sign in with Ethereum to the app.', uri: window.location.origin, @@ -49,7 +55,7 @@ export function RainbowKitSiweNextAuthProvider({ nonce, }; - return new SiweMessage({ + return createSiweMessage({ ...defaultConfigurableOptions, // Spread custom SIWE message options provided by the consumer @@ -60,8 +66,6 @@ export function RainbowKitSiweNextAuthProvider({ }); }, - getMessageBody: ({ message }) => message.prepareMessage(), - getNonce: async () => { const nonce = await getCsrfToken(); if (!nonce) throw new Error(); @@ -74,9 +78,9 @@ export function RainbowKitSiweNextAuthProvider({ verify: async ({ message, signature }) => { const response = await signIn('credentials', { - message: JSON.stringify(message), - redirect: false, + message, signature, + redirect: false, }); return response?.ok ?? false; diff --git a/packages/rainbowkit/src/components/RainbowKitProvider/AuthenticationContext.tsx b/packages/rainbowkit/src/components/RainbowKitProvider/AuthenticationContext.tsx index ab0708a479..bc1c9972fb 100644 --- a/packages/rainbowkit/src/components/RainbowKitProvider/AuthenticationContext.tsx +++ b/packages/rainbowkit/src/components/RainbowKitProvider/AuthenticationContext.tsx @@ -6,6 +6,7 @@ import React, { useMemo, useState, } from 'react'; +import type { Address } from 'viem'; import { type Config, useAccount, useAccountEffect } from 'wagmi'; export type AuthenticationStatus = @@ -17,10 +18,9 @@ export interface AuthenticationAdapter { getNonce: () => Promise; createMessage: (args: { nonce: string; - address: string; + address: Address; chainId: number; }) => Message; - getMessageBody: (args: { message: Message }) => string; verify: (args: { message: Message; signature: string }) => Promise; signOut: () => Promise; } diff --git a/packages/rainbowkit/src/components/SignIn/SignIn.tsx b/packages/rainbowkit/src/components/SignIn/SignIn.tsx index a1aabdb728..e0ec3f5f33 100644 --- a/packages/rainbowkit/src/components/SignIn/SignIn.tsx +++ b/packages/rainbowkit/src/components/SignIn/SignIn.tsx @@ -77,7 +77,7 @@ export function SignIn({ try { signature = await signMessageAsync({ - message: authAdapter.getMessageBody({ message }), + message, }); } catch (error) { if (error instanceof UserRejectedRequestError) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6fb5c0055e..8d1f032c59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -64,9 +64,6 @@ importers: esbuild-plugin-replace: specifier: ^1.4.0 version: 1.4.0 - ethers: - specifier: ^5.6.8 - version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) husky: specifier: ^9.1.5 version: 9.1.5 @@ -172,9 +169,6 @@ importers: iron-session: specifier: ^6.3.1 version: 6.3.1(express@4.19.2)(next@14.2.10(@babel/core@7.25.2)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1)) - siwe: - specifier: ^2.1.4 - version: 2.3.2(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)) examples/with-next-siwe-next-auth: dependencies: @@ -184,9 +178,6 @@ importers: '@rainbow-me/rainbowkit-siwe-next-auth': specifier: workspace:* version: link:../../packages/rainbowkit-siwe-next-auth - siwe: - specifier: ^2.1.4 - version: 2.3.2(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)) examples/with-next-wallet-button: dependencies: @@ -286,9 +277,6 @@ importers: '@tanstack/react-query': specifier: ^5.55.3 version: 5.59.0(react@18.3.1) - ethers: - specifier: ^5.6.8 - version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) next: specifier: ^14.2.10 version: 14.2.10(@babel/core@7.25.2)(@opentelemetry/api@1.9.0)(babel-plugin-macros@3.1.0)(react-dom@18.3.1(react@18.3.1))(react@18.3.1) @@ -301,9 +289,6 @@ importers: react-dom: specifier: ^18.3.1 version: 18.3.1(react@18.3.1) - siwe: - specifier: ^2.1.4 - version: 2.3.2(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)) viem: specifier: 2.17.0 version: 2.17.0(bufferutil@4.0.8)(typescript@5.5.2)(utf-8-validate@5.0.10)(zod@3.23.8) @@ -420,12 +405,6 @@ importers: '@rainbow-me/rainbowkit': specifier: workspace:* version: link:../rainbowkit - ethers: - specifier: ^5.6.8 - version: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - siwe: - specifier: ^2.1.4 - version: 2.3.2(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)) site: dependencies: @@ -785,7 +764,6 @@ packages: '@babel/plugin-proposal-class-properties@7.18.6': resolution: {integrity: sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-class-properties instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -804,28 +782,24 @@ packages: '@babel/plugin-proposal-nullish-coalescing-operator@7.18.6': resolution: {integrity: sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-nullish-coalescing-operator instead. peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-proposal-numeric-separator@7.18.6': resolution: {integrity: sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-numeric-separator instead. peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-proposal-optional-chaining@7.21.0': resolution: {integrity: sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead. peerDependencies: '@babel/core': ^7.0.0-0 '@babel/plugin-proposal-private-methods@7.18.6': resolution: {integrity: sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -838,7 +812,6 @@ packages: '@babel/plugin-proposal-private-property-in-object@7.21.11': resolution: {integrity: sha512-0QZ8qP/3RLDVBwBFoWAwCtgcDZJVwA5LUJRZU8x2YFfKNuFq161wK3cuGrALu5yiPu+vzwTAg/sMWVNeWeNyaw==} engines: {node: '>=6.9.0'} - deprecated: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-property-in-object instead. peerDependencies: '@babel/core': ^7.0.0-0 @@ -2193,96 +2166,6 @@ packages: resolution: {integrity: sha512-zQ0IqbdX8FZ9aw11vP+dZkKDkS+kgIvQPHnSAXzP9pLu+Rfu3D3XEeLbicvoXJTYnhZiPmsZUxgdzXwNKxRPbA==} engines: {node: '>=14'} - '@ethersproject/abi@5.7.0': - resolution: {integrity: sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==} - - '@ethersproject/abstract-provider@5.7.0': - resolution: {integrity: sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==} - - '@ethersproject/abstract-signer@5.7.0': - resolution: {integrity: sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==} - - '@ethersproject/address@5.7.0': - resolution: {integrity: sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==} - - '@ethersproject/base64@5.7.0': - resolution: {integrity: sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==} - - '@ethersproject/basex@5.7.0': - resolution: {integrity: sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==} - - '@ethersproject/bignumber@5.7.0': - resolution: {integrity: sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==} - - '@ethersproject/bytes@5.7.0': - resolution: {integrity: sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==} - - '@ethersproject/constants@5.7.0': - resolution: {integrity: sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==} - - '@ethersproject/contracts@5.7.0': - resolution: {integrity: sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==} - - '@ethersproject/hash@5.7.0': - resolution: {integrity: sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==} - - '@ethersproject/hdnode@5.7.0': - resolution: {integrity: sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==} - - '@ethersproject/json-wallets@5.7.0': - resolution: {integrity: sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==} - - '@ethersproject/keccak256@5.7.0': - resolution: {integrity: sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==} - - '@ethersproject/logger@5.7.0': - resolution: {integrity: sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==} - - '@ethersproject/networks@5.7.1': - resolution: {integrity: sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==} - - '@ethersproject/pbkdf2@5.7.0': - resolution: {integrity: sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==} - - '@ethersproject/properties@5.7.0': - resolution: {integrity: sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==} - - '@ethersproject/providers@5.7.2': - resolution: {integrity: sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==} - - '@ethersproject/random@5.7.0': - resolution: {integrity: sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==} - - '@ethersproject/rlp@5.7.0': - resolution: {integrity: sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==} - - '@ethersproject/sha2@5.7.0': - resolution: {integrity: sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==} - - '@ethersproject/signing-key@5.7.0': - resolution: {integrity: sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==} - - '@ethersproject/solidity@5.7.0': - resolution: {integrity: sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==} - - '@ethersproject/strings@5.7.0': - resolution: {integrity: sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==} - - '@ethersproject/transactions@5.7.0': - resolution: {integrity: sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==} - - '@ethersproject/units@5.7.0': - resolution: {integrity: sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==} - - '@ethersproject/wallet@5.7.0': - resolution: {integrity: sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==} - - '@ethersproject/web@5.7.1': - resolution: {integrity: sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==} - - '@ethersproject/wordlists@5.7.0': - resolution: {integrity: sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==} - '@fal-works/esbuild-plugin-global-externals@2.1.2': resolution: {integrity: sha512-cEee/Z+I12mZcFJshKcCqC8tuX5hG3s+d+9nZ3LabqKF1vKdF41B92pJVCBggjAGORAeOzyyDDKrZwIkLffeOQ==} @@ -2649,7 +2532,6 @@ packages: '@motionone/vue@10.16.4': resolution: {integrity: sha512-z10PF9JV6SbjFq+/rYabM+8CVlMokgl8RFGvieSGNTmrkQanfHn+15XBrhG3BgUfvmTeSeyShfOHpG0i9zEdcg==} - deprecated: Motion One for Vue is deprecated. Use Oku Motion instead https://oku-ui.com/motion '@next/env@13.5.6': resolution: {integrity: sha512-Yac/bV5sBGkkEXmAX5FWPS9Mmo2rthrOPRQQNfycJPkjUAUclomCPH7QFVCDQ4Mp2k2K1SSM6m0zrxYrOwtFQw==} @@ -3701,9 +3583,6 @@ packages: '@socket.io/component-emitter@3.1.2': resolution: {integrity: sha512-9BCxFwvbGg/RsZK9tjXd8s4UcwR0MWeFQ1XEKIQVVvAGJyINdrqKMcTRyLoK8Rse1GjzLV9cwjWV1olXRWEXVA==} - '@spruceid/siwe-parser@2.1.2': - resolution: {integrity: sha512-d/r3S1LwJyMaRAKQ0awmo9whfXeE88Qt00vRj91q5uv5ATtWIQEGJ67Yr5eSZw5zp1/fZCXZYuEckt8lSkereQ==} - '@stablelib/aead@1.0.1': resolution: {integrity: sha512-q39ik6sxGHewqtO0nP4BuSe3db5G1fEJE8ukvngS2gLkBXyy6E7pLubhbYgnkDFv6V8cWaxcE4Xn0t6LWcJkyg==} @@ -4443,7 +4322,6 @@ packages: abab@2.0.6: resolution: {integrity: sha512-j2afSsaIENvHZN2B8GOpF566vZ5WVk5opAiMTvWgaQT8DkbOqsTfvNAvHoRGU2zzP8cPoqys+xHTRDWW8L+/BA==} - deprecated: Use your platform's native atob() and btoa() methods instead abitype@1.0.5: resolution: {integrity: sha512-YzDhti7cjlfaBhHutMaboYB21Ha3rXR9QTkNJFzYC4kC8YclaiwPBBBJY8ejFdu2wnJeZCVZSMlQJ7fi8S6hsw==} @@ -4499,9 +4377,6 @@ packages: resolution: {integrity: sha512-OXwN5b9pCUXNQHJpwwD2qP40byEmSgzj8B4ydSN0uMNYWiFmJ6x6KwUllMmfk8Rwu/HJDFR7U8ubsWBoN0Xp0A==} engines: {node: '>=8.9'} - aes-js@3.0.0: - resolution: {integrity: sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==} - agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -4604,9 +4479,6 @@ packages: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} engines: {node: '>= 8'} - apg-js@4.4.0: - resolution: {integrity: sha512-fefmXFknJmtgtNEXfPwZKYkMFX4Fyeyz+fNF6JWp87biGOPslJbCBVU158zvKRZfHBKnJDy8CMM40oLFGkXT8Q==} - appdirsjs@1.2.7: resolution: {integrity: sha512-Quji6+8kLBC3NnBeo14nPDq0+2jUs5s3/xEye+udFHumHhRk4M7aAMXp/PBJqkKYGuuyR9M/6Dq7d2AViiGmhw==} @@ -4832,9 +4704,6 @@ packages: batch@0.6.1: resolution: {integrity: sha512-x+VAiMRL6UPkx+kudNvxTl6hB2XNNCG2r+7wixVfIYwu/2HKRXimwQyaumLjMveWvT2Hkd/cAJw+QBMfJ/EKVw==} - bech32@1.1.4: - resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} - better-path-resolve@1.0.0: resolution: {integrity: sha512-pbnl5XzGBdrFU/wT4jqmJVPn2B6UHPBOhzMQkY/SPUPB6QtUXtmBHBIwCbXJol93mOpGMnQyP/+BB19q04xj7g==} engines: {node: '>=4'} @@ -5772,7 +5641,6 @@ packages: domexception@2.0.1: resolution: {integrity: sha512-yxJ2mFy/sibVQlu5qHjOkf9J3K6zgmCxgJ94u2EdvDOV09H+32LtRswEcUsmUWN72pVLOEnTSRaIVVzVQgS0dg==} engines: {node: '>=8'} - deprecated: Use your platform's native DOMException instead domhandler@4.3.1: resolution: {integrity: sha512-GrwoxYN+uWlzO8uhUXRl0P+kHE4GtVPfYzVLcUxPL7KNdHKj66vvlhiweIHqYYXWlw+T8iLMp42Lm67ghw4WMQ==} @@ -5828,9 +5696,6 @@ packages: electron-to-chromium@1.5.13: resolution: {integrity: sha512-lbBcvtIJ4J6sS4tb5TLp1b4LyfCdMkwStzXPyAgVgTRAsep4bvrAGaBOP7ZJtQMNJpSQ9SqG4brWOroNaQtm7Q==} - elliptic@6.5.4: - resolution: {integrity: sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==} - elliptic@6.5.7: resolution: {integrity: sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==} @@ -6121,7 +5986,6 @@ packages: eslint@8.57.0: resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. hasBin: true espree@9.6.1: @@ -6225,9 +6089,6 @@ packages: ethereum-cryptography@2.2.1: resolution: {integrity: sha512-r/W8lkHSiTLxUxW8Rf3u4HGB0xQweG2RyETjywylKZSzLWoWAijRz8WCuOtJ6wah+avllXBqZuk29HCCvhEIRg==} - ethers@5.7.2: - resolution: {integrity: sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==} - eval@0.1.8: resolution: {integrity: sha512-EzV94NYKoO09GLXGjXj9JIlXijVck4ONSr5wiCWDvhsvj5jxSrzTmRU/9C1DyB6uToszLs8aifA6NQ7lEQdvFw==} engines: {node: '>= 0.8'} @@ -6605,7 +6466,6 @@ packages: glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} - deprecated: Glob versions prior to v9 are no longer supported global-directory@4.0.1: resolution: {integrity: sha512-wHTUcDUoZ1H5/0iVqEudYW4/kAlN5cZ3j/bXn0Dpbizl9iaUVeWSHqiOjsgk6OW2bkLclbBjzewBz6weQ1zA2Q==} @@ -6972,7 +6832,6 @@ packages: inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} - deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. inherits@2.0.3: resolution: {integrity: sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw==} @@ -7557,9 +7416,6 @@ packages: jose@4.15.9: resolution: {integrity: sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==} - js-sha3@0.8.0: - resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} - js-tokens@4.0.0: resolution: {integrity: sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==} @@ -9562,10 +9418,6 @@ packages: q@1.5.1: resolution: {integrity: sha512-kV/CThkXo6xyFEZUugw/+pIOywXcDbFYgSct5cT3gqlbkBE1SJdwy6UQoZvodiWF/ckQLZyDE/Bu1M6gVu5lVw==} engines: {node: '>=0.6.0', teleport: '>=0.2.0'} - deprecated: |- - You or someone you depend on is using Q, the JavaScript Promise library that gave JavaScript developers strong feelings about promises. They can almost certainly migrate to the native JavaScript promise now. Thank you literally everyone for joining me in this bet against the odds. Be excellent to each other. - - (For a CapTP with native promises, see @endo/eventual-send and @endo/captp) qr-code-styling@1.6.0-rc.1: resolution: {integrity: sha512-ModRIiW6oUnsP18QzrRYZSc/CFKFKIdj7pUs57AEVH20ajlglRpN3HukjHk0UbNMTlKGuaYl7Gt6/O5Gg2NU2Q==} @@ -9981,12 +9833,10 @@ packages: rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} - deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true rollup-plugin-terser@7.0.2: resolution: {integrity: sha512-w3iIaU4OxcF52UUXiZNsNeuXIMDvFrr+ZXK6bFZ0Q60qyVfq4uLptoS4bbq3paG3x216eQllFZX7zt6TIImguQ==} - deprecated: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser peerDependencies: rollup: ^2.0.0 @@ -10102,9 +9952,6 @@ packages: resolution: {integrity: sha512-L0jRsrPpjdckP3oPug3/VxNKt2trR8TcabrM6FOAAlvC/9Phcmm+cuAgTlxBqdBR1WJx7Naj9WHw+aOmheSVbw==} engines: {node: '>= 12.13.0'} - scrypt-js@3.0.1: - resolution: {integrity: sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==} - search-insights@2.17.0: resolution: {integrity: sha512-AskayU3QNsXQzSL6v4LTYST7NNfs2HWyHHB+sdORP9chsytAhro5XRfToAMI/LAVYgNbzowVZTMfBRodgbUHKg==} @@ -10222,11 +10069,6 @@ packages: sisteransi@1.0.5: resolution: {integrity: sha512-bLGGlR1QxBcynn2d5YmDX4MGjlZvy2MRBDRNHLJ8VI6l6+9FUiyTFNJ0IveOSP0bcXgVDPRcfGqA0pjaqUpfVg==} - siwe@2.3.2: - resolution: {integrity: sha512-aSf+6+Latyttbj5nMu6GF3doMfv2UYj83hhwZgUF20ky6fTS83uVhkQABdIVnEuS8y1bBdk7p6ltb9SmlhTTlA==} - peerDependencies: - ethers: ^5.6.8 || ^6.0.8 - slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -10287,7 +10129,6 @@ packages: sourcemap-codec@1.4.8: resolution: {integrity: sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==} - deprecated: Please use @jridgewell/sourcemap-codec instead space-separated-tokens@2.0.2: resolution: {integrity: sha512-PEGlAwrG8yXGXRjW32fGbg66JAlOAwbObuqVoJpv/mRgoWDQfgH1wDPvtzWyUSNAXBGSk8h755YDbbcEy3SH2Q==} @@ -10331,7 +10172,6 @@ packages: stable@0.1.8: resolution: {integrity: sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==} - deprecated: 'Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility' stack-utils@2.0.6: resolution: {integrity: sha512-XlkWvfIm6RmsWtNJx+uqtKLS8eqFbxUg0ZzLXqY0caEy9l7hruX8IpiDnjsLavoBgqCCR71TqWO8MaXYheJ3RQ==} @@ -10556,7 +10396,6 @@ packages: svgo@1.3.2: resolution: {integrity: sha512-yhy/sQYxR5BkC98CY7o31VGsg014AKLEPxdfhora76l36hD9Rdy5NZA/Ocn6yayNPgSamYdtX2rFJdcv07AYVw==} engines: {node: '>=4.0.0'} - deprecated: This SVGO version is no longer supported. Upgrade to v2.x.x. hasBin: true svgo@2.8.0: @@ -11114,9 +10953,6 @@ packages: resolution: {integrity: sha512-FGtKtv3xIpR6BYhvgH8MI/y78oT7d8Au3ww4QIxymrCtZEh5b8gCw2siywE+puhEmuWKDtmfrvF5UlB298ut3w==} engines: {node: '>=10.12.0'} - valid-url@1.0.9: - resolution: {integrity: sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==} - validate-npm-package-license@3.0.4: resolution: {integrity: sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==} @@ -11238,7 +11074,6 @@ packages: w3c-hr-time@1.0.2: resolution: {integrity: sha512-z8P5DvDNjKDoFIHK7q8r8lackT6l+jo/Ye3HOle7l9nICP9lf1Ci25fy9vHd0JOWewkIFzXIEig3TdKT7JQ5fQ==} - deprecated: Use your platform's native performance.now() and performance.timeOrigin. w3c-xmlserializer@2.0.0: resolution: {integrity: sha512-4tzD0mF8iSiMiNs30BiLO3EpfGLZUT2MSX/G+o7ZywDzliWQ3OPtTZ0PTC3B3ca1UAf4cJMHB+2Bf56EriJuRA==} @@ -11444,7 +11279,6 @@ packages: workbox-cacheable-response@6.6.0: resolution: {integrity: sha512-JfhJUSQDwsF1Xv3EV1vWzSsCOZn4mQ38bWEBR3LdvOxSPgB65gAM6cS2CX8rkkKHRgiLrN7Wxoyu+TuH67kHrw==} - deprecated: workbox-background-sync@6.6.0 workbox-core@6.6.0: resolution: {integrity: sha512-GDtFRF7Yg3DD859PMbPAYPeJyg5gJYXuBQAC+wyrWuuXgpfoOrIQIvFRZnQ7+czTIQjIr1DhLEGFzZanAT/3bQ==} @@ -11454,7 +11288,6 @@ packages: workbox-google-analytics@6.6.0: resolution: {integrity: sha512-p4DJa6OldXWd6M9zRl0H6vB9lkrmqYFkRQ2xEiNdBFp9U0LhsGO7hsBscVEyH9H2/3eZZt8c97NB2FD9U2NJ+Q==} - deprecated: It is not compatible with newer versions of GA starting with v4, as long as you are using GAv3 it should be ok, but the package is not longer being maintained workbox-navigation-preload@6.6.0: resolution: {integrity: sha512-utNEWG+uOfXdaZmvhshrh7KzhDu/1iMHyQOV6Aqup8Mm78D286ugu5k9MFD9SzBT5TcwgwSORVvInaXWbvKz9Q==} @@ -11521,18 +11354,6 @@ packages: utf-8-validate: optional: true - ws@7.4.6: - resolution: {integrity: sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==} - engines: {node: '>=8.3.0'} - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - ws@7.5.10: resolution: {integrity: sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==} engines: {node: '>=8.3.0'} @@ -13570,261 +13391,6 @@ snapshots: ethereum-cryptography: 2.2.1 micro-ftch: 0.3.1 - '@ethersproject/abi@5.7.0': - dependencies: - '@ethersproject/address': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - - '@ethersproject/abstract-provider@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/networks': 5.7.1 - '@ethersproject/properties': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/web': 5.7.1 - - '@ethersproject/abstract-signer@5.7.0': - dependencies: - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - - '@ethersproject/address@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/rlp': 5.7.0 - - '@ethersproject/base64@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - - '@ethersproject/basex@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/properties': 5.7.0 - - '@ethersproject/bignumber@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - bn.js: 5.2.1 - - '@ethersproject/bytes@5.7.0': - dependencies: - '@ethersproject/logger': 5.7.0 - - '@ethersproject/constants@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - - '@ethersproject/contracts@5.7.0': - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/transactions': 5.7.0 - - '@ethersproject/hash@5.7.0': - dependencies: - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/base64': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - - '@ethersproject/hdnode@5.7.0': - dependencies: - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/basex': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/pbkdf2': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/wordlists': 5.7.0 - - '@ethersproject/json-wallets@5.7.0': - dependencies: - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/hdnode': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/pbkdf2': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/random': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/transactions': 5.7.0 - aes-js: 3.0.0 - scrypt-js: 3.0.1 - - '@ethersproject/keccak256@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - js-sha3: 0.8.0 - - '@ethersproject/logger@5.7.0': {} - - '@ethersproject/networks@5.7.1': - dependencies: - '@ethersproject/logger': 5.7.0 - - '@ethersproject/pbkdf2@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/sha2': 5.7.0 - - '@ethersproject/properties@5.7.0': - dependencies: - '@ethersproject/logger': 5.7.0 - - '@ethersproject/providers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)': - dependencies: - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/base64': 5.7.0 - '@ethersproject/basex': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/networks': 5.7.1 - '@ethersproject/properties': 5.7.0 - '@ethersproject/random': 5.7.0 - '@ethersproject/rlp': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/web': 5.7.1 - bech32: 1.1.4 - ws: 7.4.6(bufferutil@4.0.8)(utf-8-validate@5.0.10) - transitivePeerDependencies: - - bufferutil - - utf-8-validate - - '@ethersproject/random@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - - '@ethersproject/rlp@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - - '@ethersproject/sha2@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - hash.js: 1.1.7 - - '@ethersproject/signing-key@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - bn.js: 5.2.1 - elliptic: 6.5.4 - hash.js: 1.1.7 - - '@ethersproject/solidity@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/strings': 5.7.0 - - '@ethersproject/strings@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/logger': 5.7.0 - - '@ethersproject/transactions@5.7.0': - dependencies: - '@ethersproject/address': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/rlp': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - - '@ethersproject/units@5.7.0': - dependencies: - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/logger': 5.7.0 - - '@ethersproject/wallet@5.7.0': - dependencies: - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/hdnode': 5.7.0 - '@ethersproject/json-wallets': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/random': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/wordlists': 5.7.0 - - '@ethersproject/web@5.7.1': - dependencies: - '@ethersproject/base64': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - - '@ethersproject/wordlists@5.7.0': - dependencies: - '@ethersproject/bytes': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@fal-works/esbuild-plugin-global-externals@2.1.2': {} '@floating-ui/core@1.6.7': @@ -15745,13 +15311,6 @@ snapshots: '@socket.io/component-emitter@3.1.2': {} - '@spruceid/siwe-parser@2.1.2': - dependencies: - '@noble/hashes': 1.4.0 - apg-js: 4.4.0 - uri-js: 4.4.1 - valid-url: 1.0.9 - '@stablelib/aead@1.0.1': {} '@stablelib/binary@1.0.1': @@ -15961,7 +15520,7 @@ snapshots: '@types/accepts@1.3.7': dependencies: - '@types/node': 20.14.8 + '@types/node': 20.16.5 '@types/acorn@4.0.6': dependencies: @@ -16012,7 +15571,7 @@ snapshots: '@types/conventional-commits-parser@5.0.0': dependencies: - '@types/node': 20.14.8 + '@types/node': 20.16.5 '@types/cookie@0.5.4': {} @@ -16023,7 +15582,7 @@ snapshots: '@types/connect': 3.4.38 '@types/express': 4.17.21 '@types/keygrip': 1.0.6 - '@types/node': 20.14.8 + '@types/node': 20.16.5 '@types/debounce@1.2.4': {} @@ -16120,7 +15679,7 @@ snapshots: '@types/http-errors': 2.0.4 '@types/keygrip': 1.0.6 '@types/koa-compose': 3.2.8 - '@types/node': 20.14.8 + '@types/node': 20.16.5 '@types/mdast@3.0.15': dependencies: @@ -17063,8 +16622,6 @@ snapshots: loader-utils: 2.0.4 regex-parser: 2.3.0 - aes-js@3.0.0: {} - agent-base@6.0.2: dependencies: debug: 4.3.7 @@ -17175,8 +16732,6 @@ snapshots: normalize-path: 3.0.0 picomatch: 2.3.1 - apg-js@4.4.0: {} - appdirsjs@1.2.7: {} arg@5.0.2: {} @@ -17493,8 +17048,6 @@ snapshots: batch@0.6.1: {} - bech32@1.1.4: {} - better-path-resolve@1.0.0: dependencies: is-windows: 1.0.2 @@ -18500,16 +18053,6 @@ snapshots: electron-to-chromium@1.5.13: {} - elliptic@6.5.4: - dependencies: - bn.js: 4.12.0 - brorand: 1.1.0 - hash.js: 1.1.7 - hmac-drbg: 1.0.1 - inherits: 2.0.4 - minimalistic-assert: 1.0.1 - minimalistic-crypto-utils: 1.0.1 - elliptic@6.5.7: dependencies: bn.js: 4.12.0 @@ -19150,45 +18693,9 @@ snapshots: '@scure/bip32': 1.4.0 '@scure/bip39': 1.3.0 - ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10): - dependencies: - '@ethersproject/abi': 5.7.0 - '@ethersproject/abstract-provider': 5.7.0 - '@ethersproject/abstract-signer': 5.7.0 - '@ethersproject/address': 5.7.0 - '@ethersproject/base64': 5.7.0 - '@ethersproject/basex': 5.7.0 - '@ethersproject/bignumber': 5.7.0 - '@ethersproject/bytes': 5.7.0 - '@ethersproject/constants': 5.7.0 - '@ethersproject/contracts': 5.7.0 - '@ethersproject/hash': 5.7.0 - '@ethersproject/hdnode': 5.7.0 - '@ethersproject/json-wallets': 5.7.0 - '@ethersproject/keccak256': 5.7.0 - '@ethersproject/logger': 5.7.0 - '@ethersproject/networks': 5.7.1 - '@ethersproject/pbkdf2': 5.7.0 - '@ethersproject/properties': 5.7.0 - '@ethersproject/providers': 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - '@ethersproject/random': 5.7.0 - '@ethersproject/rlp': 5.7.0 - '@ethersproject/sha2': 5.7.0 - '@ethersproject/signing-key': 5.7.0 - '@ethersproject/solidity': 5.7.0 - '@ethersproject/strings': 5.7.0 - '@ethersproject/transactions': 5.7.0 - '@ethersproject/units': 5.7.0 - '@ethersproject/wallet': 5.7.0 - '@ethersproject/web': 5.7.1 - '@ethersproject/wordlists': 5.7.0 - transitivePeerDependencies: - - bufferutil - - utf-8-validate - eval@0.1.8: dependencies: - '@types/node': 20.14.8 + '@types/node': 20.16.5 require-like: 0.1.2 event-target-shim@5.0.1: {} @@ -20925,8 +20432,6 @@ snapshots: jose@4.15.9: {} - js-sha3@0.8.0: {} - js-tokens@4.0.0: {} js-yaml@3.14.1: @@ -24292,8 +23797,6 @@ snapshots: ajv-formats: 2.1.1(ajv@8.17.1) ajv-keywords: 5.1.0(ajv@8.17.1) - scrypt-js@3.0.1: {} - search-insights@2.17.0: {} secp256k1@5.0.0: @@ -24431,14 +23934,6 @@ snapshots: sisteransi@1.0.5: {} - siwe@2.3.2(ethers@5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10)): - dependencies: - '@spruceid/siwe-parser': 2.1.2 - '@stablelib/random': 1.0.2 - ethers: 5.7.2(bufferutil@4.0.8)(utf-8-validate@5.0.10) - uri-js: 4.4.1 - valid-url: 1.0.9 - slash@3.0.0: {} slash@4.0.0: {} @@ -25369,8 +24864,6 @@ snapshots: convert-source-map: 1.9.0 source-map: 0.7.4 - valid-url@1.0.9: {} - validate-npm-package-license@3.0.4: dependencies: spdx-correct: 3.2.0 @@ -26089,11 +25582,6 @@ snapshots: bufferutil: 4.0.8 utf-8-validate: 5.0.10 - ws@7.4.6(bufferutil@4.0.8)(utf-8-validate@5.0.10): - optionalDependencies: - bufferutil: 4.0.8 - utf-8-validate: 5.0.10 - ws@7.5.10(bufferutil@4.0.8)(utf-8-validate@5.0.10): optionalDependencies: bufferutil: 4.0.8 diff --git a/site/data/en-US/docs/authentication.mdx b/site/data/en-US/docs/authentication.mdx index cba0823ec2..e7b36bac44 100644 --- a/site/data/en-US/docs/authentication.mdx +++ b/site/data/en-US/docs/authentication.mdx @@ -9,22 +9,18 @@ description: Authenticating your users You can optionally enforce that users sign a message with their wallet during the connection process, proving that they own the connected account and allowing you to create an authenticated user session with privileged access to your application. -While it's possible to [integrate with custom back-ends and message formats,](/docs/custom-authentication) RainbowKit provides first-class support for [Sign-In with Ethereum](https://login.xyz) and [NextAuth.js.](https://next-auth.js.org) +While it's possible to [integrate with custom back-ends and message formats,](/docs/custom-authentication) RainbowKit provides first-class support for [Sign-In with Ethereum](https://login.xyz) and [NextAuth](https://next-auth.js.org). -### Set up Sign-In with Ethereum and NextAuth.js - -If you haven't already, first set up your [Next.js](https://nextjs.org) project with the [official Sign-In with Ethereum boilerplate for NextAuth.js.](https://docs.login.xyz/integrations/nextauth.js) +### Set up Sign-In with Ethereum and NextAuth #### Install -Install the `@rainbow-me/rainbowkit-siwe-next-auth` package and its peer dependency, [ethers](https://docs.ethers.org/v5/). +Install the `@rainbow-me/rainbowkit-siwe-next-auth` package. ```bash -npm install @rainbow-me/rainbowkit-siwe-next-auth siwe@^2 ethers@^5 +npm install @rainbow-me/rainbowkit-siwe-next-auth ``` -> Note: `siwe` requires the [ethers](https://docs.ethers.org/v5/) peer dependency, while [wagmi](https://wagmi.sh/) now relies on the alternative [viem](https://viem.sh). - #### Set up the provider In your `App` component, import `RainbowKitSiweNextAuthProvider`. @@ -75,7 +71,7 @@ With `RainbowKitSiweNextAuthProvider` in place, your users will now be prompted #### Customize the SIWE message options -You can customize the [SIWE message options](https://github.com/spruceid/siwe/blob/v1.1.6/packages/siwe/lib/client.ts#L29) by passing a function to the `getSiweMessageOptions` prop on `RainbowKitSiweNextAuthProvider`. +You can customize the [SIWE message options](https://viem.sh/docs/siwe/utilities/createSiweMessage#parameters) by passing a function to the `getSiweMessageOptions` prop on `RainbowKitSiweNextAuthProvider`. This function will be called whenever a new message is created. Options returned from this function will be merged with the defaults. @@ -146,4 +142,4 @@ export default function AuthenticatedPage({ For more information about managing the session, you can refer to the following documentation: - [Next.js authentication guide](https://nextjs.org/docs/authentication) -- [NextAuth.js documentation](https://next-auth.js.org) +- [NextAuth documentation](https://next-auth.js.org) diff --git a/site/data/en-US/docs/custom-authentication.mdx b/site/data/en-US/docs/custom-authentication.mdx index d2b5dc2f21..f47c745b6c 100644 --- a/site/data/en-US/docs/custom-authentication.mdx +++ b/site/data/en-US/docs/custom-authentication.mdx @@ -7,17 +7,17 @@ description: Connect to your own authentication back-end ## Connect to your own authentication back-end -While RainbowKit provides [first-class support for Sign-In with Ethereum and NextAuth.js,](/docs/authentication#set-up-sign-in-with-ethereum-and-nextauthjs) you can also integrate with custom back-ends and message formats. +While RainbowKit provides [first-class support for Sign-In with Ethereum and NextAuth,](/docs/authentication#set-up-sign-in-with-ethereum-and-nextauth) you can also integrate with custom back-ends and message formats. ### Creating a custom adapter First create an authentication adapter. This allows RainbowKit to create/prepare messages and communicate with your back-end. -As an example, we could make an authentication adapter that lets us use [Sign-In with Ethereum](https://login.xyz) against some [custom API endpoints.](https://wagmi.sh/examples/sign-in-with-ethereum) +As an example, we could make an authentication adapter that lets us use [Sign-In with Ethereum](https://login.xyz) against some custom API endpoints, like [iron-session](https://github.com/rainbow-me/rainbowkit/tree/main/examples/with-next-siwe-iron-session). ```tsx import { createAuthenticationAdapter } from '@rainbow-me/rainbowkit'; -import { SiweMessage } from 'siwe'; +import { createSiweMessage } from 'viem/siwe'; const authenticationAdapter = createAuthenticationAdapter({ getNonce: async () => { @@ -26,7 +26,7 @@ const authenticationAdapter = createAuthenticationAdapter({ }, createMessage: ({ nonce, address, chainId }) => { - return new SiweMessage({ + return createSiweMessage({ domain: window.location.host, address, statement: 'Sign in with Ethereum to the app.', @@ -37,10 +37,6 @@ const authenticationAdapter = createAuthenticationAdapter({ }); }, - getMessageBody: ({ message }) => { - return message.prepareMessage(); - }, - verify: async ({ message, signature }) => { const verifyRes = await fetch('/api/verify', { method: 'POST', diff --git a/site/data/en-US/docs/migration-guide.mdx b/site/data/en-US/docs/migration-guide.mdx index 264d3cc8d8..a169861d8d 100644 --- a/site/data/en-US/docs/migration-guide.mdx +++ b/site/data/en-US/docs/migration-guide.mdx @@ -223,8 +223,6 @@ wagmi v1 requires the `viem` peer dependency. Install it with the following comm npm i viem ``` -Note: wagmi no longer uses the `ethers` package internally. But if you rely on the [Authentication](https://www.rainbowkit.com/docs/authentication) API, `siwe` will still require `ethers` as a peer dependency. - **3. Ensure bundler and polyfill compatibility** In previous versions of wagmi that relied on [ethers](https://docs.ethers.org/v5/), the `fs`, `net`, and `tls` modules required by WalletConnect were automatically polyfilled. This is no longer the case with RainbowKit v1 + wagmi v1, which are built on [viem](https://viem.sh/).