From d1c0e9b8b2dd60bea762100b6e8366c3c189e042 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Tue, 15 Oct 2024 04:57:16 -0400 Subject: [PATCH] chore: version packages (#2204) * chore: version packages * chore: tweaks * chore: tweak changelog --------- Co-authored-by: github-actions[bot] Co-authored-by: Daniel Sinclair --- .changeset/large-pans-watch.md | 21 -- .changeset/small-ladybugs-agree.md | 183 ----------------- .changeset/witty-knives-exercise.md | 82 -------- examples/with-create-react-app/CHANGELOG.md | 8 + examples/with-create-react-app/package.json | 2 +- examples/with-next-app-i18n/CHANGELOG.md | 8 + examples/with-next-app-i18n/package.json | 2 +- examples/with-next-app/CHANGELOG.md | 8 + examples/with-next-app/package.json | 2 +- examples/with-next-custom-button/CHANGELOG.md | 8 + examples/with-next-custom-button/package.json | 2 +- examples/with-next-mint-nft/CHANGELOG.md | 8 + examples/with-next-mint-nft/package.json | 2 +- .../with-next-rainbow-button/CHANGELOG.md | 7 + .../with-next-rainbow-button/package.json | 2 +- .../with-next-siwe-iron-session/CHANGELOG.md | 8 + .../with-next-siwe-iron-session/package.json | 2 +- .../with-next-siwe-next-auth/CHANGELOG.md | 10 + .../with-next-siwe-next-auth/package.json | 2 +- examples/with-next-wallet-button/CHANGELOG.md | 8 + examples/with-next-wallet-button/package.json | 2 +- examples/with-next/CHANGELOG.md | 8 + examples/with-next/package.json | 2 +- examples/with-remix/CHANGELOG.md | 8 + examples/with-remix/package.json | 2 +- examples/with-vite/CHANGELOG.md | 8 + examples/with-vite/package.json | 2 +- packages/create-rainbowkit/CHANGELOG.md | 6 + .../generated-test-app/CHANGELOG.md | 8 + .../generated-test-app/package.json | 2 +- packages/create-rainbowkit/package.json | 2 +- .../templates/next-app/CHANGELOG.md | 8 + .../templates/next-app/package.json | 2 +- packages/example/CHANGELOG.md | 11 ++ packages/example/package.json | 2 +- packages/rainbow-button/CHANGELOG.md | 7 + packages/rainbow-button/package.json | 2 +- .../rainbowkit-siwe-next-auth/CHANGELOG.md | 88 +++++++++ .../rainbowkit-siwe-next-auth/package.json | 4 +- packages/rainbowkit/CHANGELOG.md | 184 ++++++++++++++++++ packages/rainbowkit/package.json | 2 +- site/CHANGELOG.md | 8 + site/package.json | 2 +- 43 files changed, 438 insertions(+), 307 deletions(-) delete mode 100644 .changeset/large-pans-watch.md delete mode 100644 .changeset/small-ladybugs-agree.md delete mode 100644 .changeset/witty-knives-exercise.md diff --git a/.changeset/large-pans-watch.md b/.changeset/large-pans-watch.md deleted file mode 100644 index efe26e135d..0000000000 --- a/.changeset/large-pans-watch.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -"generated-test-app": patch -"rainbowkit-next-app": patch -"with-next-siwe-iron-session": patch -"with-next-rainbow-button": patch -"with-next-siwe-next-auth": patch -"with-next-custom-button": patch -"with-next-wallet-button": patch -"with-create-react-app": patch -"with-next-app-i18n": patch -"with-next-mint-nft": patch -"with-next-app": patch -"with-remix": patch -"with-next": patch -"with-vite": patch -"example": patch -"site": patch -"@rainbow-me/create-rainbowkit": patch ---- - -Upgraded `wagmi` to `^2.12.17` diff --git a/.changeset/small-ladybugs-agree.md b/.changeset/small-ladybugs-agree.md deleted file mode 100644 index fbdb88fe80..0000000000 --- a/.changeset/small-ladybugs-agree.md +++ /dev/null @@ -1,183 +0,0 @@ ---- -"@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 deleted file mode 100644 index 8600ff1ec1..0000000000 --- a/.changeset/witty-knives-exercise.md +++ /dev/null @@ -1,82 +0,0 @@ ---- -"@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-create-react-app/CHANGELOG.md b/examples/with-create-react-app/CHANGELOG.md index 9f070bc3ec..7774514757 100644 --- a/examples/with-create-react-app/CHANGELOG.md +++ b/examples/with-create-react-app/CHANGELOG.md @@ -1,5 +1,13 @@ # with-create-react-app +## 0.1.96 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.1.95 ### Patch Changes diff --git a/examples/with-create-react-app/package.json b/examples/with-create-react-app/package.json index 7949fb14af..5481ccf5c1 100644 --- a/examples/with-create-react-app/package.json +++ b/examples/with-create-react-app/package.json @@ -1,6 +1,6 @@ { "name": "with-create-react-app", - "version": "0.1.95", + "version": "0.1.96", "private": true, "dependencies": { "@rainbow-me/rainbowkit": "workspace:*", diff --git a/examples/with-next-app-i18n/CHANGELOG.md b/examples/with-next-app-i18n/CHANGELOG.md index 91eae48200..f31004f579 100644 --- a/examples/with-next-app-i18n/CHANGELOG.md +++ b/examples/with-next-app-i18n/CHANGELOG.md @@ -1,5 +1,13 @@ # with-next-app-i18n +## 0.0.45 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.44 ### Patch Changes diff --git a/examples/with-next-app-i18n/package.json b/examples/with-next-app-i18n/package.json index 02f46afad3..b997cdedad 100644 --- a/examples/with-next-app-i18n/package.json +++ b/examples/with-next-app-i18n/package.json @@ -1,7 +1,7 @@ { "name": "with-next-app-i18n", "private": true, - "version": "0.0.44", + "version": "0.0.45", "scripts": { "dev": "next dev", "build": "next build", diff --git a/examples/with-next-app/CHANGELOG.md b/examples/with-next-app/CHANGELOG.md index 279517b698..fdbf4b1034 100644 --- a/examples/with-next-app/CHANGELOG.md +++ b/examples/with-next-app/CHANGELOG.md @@ -1,5 +1,13 @@ # with-next-app +## 0.0.45 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.44 ### Patch Changes diff --git a/examples/with-next-app/package.json b/examples/with-next-app/package.json index 512fce014e..02aff2cacb 100644 --- a/examples/with-next-app/package.json +++ b/examples/with-next-app/package.json @@ -1,7 +1,7 @@ { "name": "with-next-app", "private": true, - "version": "0.0.44", + "version": "0.0.45", "scripts": { "dev": "next dev", "build": "next build", diff --git a/examples/with-next-custom-button/CHANGELOG.md b/examples/with-next-custom-button/CHANGELOG.md index 3a4609ff34..53aa0b5024 100644 --- a/examples/with-next-custom-button/CHANGELOG.md +++ b/examples/with-next-custom-button/CHANGELOG.md @@ -1,5 +1,13 @@ # with-next-custom-button +## 0.0.97 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.96 ### Patch Changes diff --git a/examples/with-next-custom-button/package.json b/examples/with-next-custom-button/package.json index e812a78847..3d3f0b608c 100644 --- a/examples/with-next-custom-button/package.json +++ b/examples/with-next-custom-button/package.json @@ -1,7 +1,7 @@ { "name": "with-next-custom-button", "private": true, - "version": "0.0.96", + "version": "0.0.97", "scripts": { "dev": "next dev", "build": "next build", diff --git a/examples/with-next-mint-nft/CHANGELOG.md b/examples/with-next-mint-nft/CHANGELOG.md index 8951b1b0e5..4b2fd618f1 100644 --- a/examples/with-next-mint-nft/CHANGELOG.md +++ b/examples/with-next-mint-nft/CHANGELOG.md @@ -1,5 +1,13 @@ # with-next-mint-nft +## 0.0.97 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.96 ### Patch Changes diff --git a/examples/with-next-mint-nft/package.json b/examples/with-next-mint-nft/package.json index a7c34d805b..bc92769fd4 100644 --- a/examples/with-next-mint-nft/package.json +++ b/examples/with-next-mint-nft/package.json @@ -1,7 +1,7 @@ { "name": "with-next-mint-nft", "private": true, - "version": "0.0.96", + "version": "0.0.97", "scripts": { "dev": "next dev", "build": "next build", diff --git a/examples/with-next-rainbow-button/CHANGELOG.md b/examples/with-next-rainbow-button/CHANGELOG.md index b3d149cade..097dbed9a2 100644 --- a/examples/with-next-rainbow-button/CHANGELOG.md +++ b/examples/with-next-rainbow-button/CHANGELOG.md @@ -1,5 +1,12 @@ # with-next-rainbow-button +## 0.0.26 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` + - @rainbow-me/rainbow-button@0.2.17 + ## 0.0.25 ### Patch Changes diff --git a/examples/with-next-rainbow-button/package.json b/examples/with-next-rainbow-button/package.json index 5ef362ed37..7c1868035a 100644 --- a/examples/with-next-rainbow-button/package.json +++ b/examples/with-next-rainbow-button/package.json @@ -1,7 +1,7 @@ { "name": "with-next-rainbow-button", "private": true, - "version": "0.0.25", + "version": "0.0.26", "scripts": { "dev": "next dev", "build": "next build", diff --git a/examples/with-next-siwe-iron-session/CHANGELOG.md b/examples/with-next-siwe-iron-session/CHANGELOG.md index 06d539c5ab..487fd8565a 100644 --- a/examples/with-next-siwe-iron-session/CHANGELOG.md +++ b/examples/with-next-siwe-iron-session/CHANGELOG.md @@ -1,5 +1,13 @@ # with-next-siwe-iron-session +## 0.0.79 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.78 ### Patch Changes diff --git a/examples/with-next-siwe-iron-session/package.json b/examples/with-next-siwe-iron-session/package.json index b983284093..4eed556850 100644 --- a/examples/with-next-siwe-iron-session/package.json +++ b/examples/with-next-siwe-iron-session/package.json @@ -1,7 +1,7 @@ { "name": "with-next-siwe-iron-session", "private": true, - "version": "0.0.78", + "version": "0.0.79", "scripts": { "dev": "next dev", "build": "next build", diff --git a/examples/with-next-siwe-next-auth/CHANGELOG.md b/examples/with-next-siwe-next-auth/CHANGELOG.md index 6402533575..2d3a870941 100644 --- a/examples/with-next-siwe-next-auth/CHANGELOG.md +++ b/examples/with-next-siwe-next-auth/CHANGELOG.md @@ -1,5 +1,15 @@ # with-next-siwe-next-auth +## 0.0.80 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + - @rainbow-me/rainbowkit-siwe-next-auth@0.5.0 + ## 0.0.79 ### Patch Changes diff --git a/examples/with-next-siwe-next-auth/package.json b/examples/with-next-siwe-next-auth/package.json index bbe2ca4563..07954e22aa 100644 --- a/examples/with-next-siwe-next-auth/package.json +++ b/examples/with-next-siwe-next-auth/package.json @@ -1,7 +1,7 @@ { "name": "with-next-siwe-next-auth", "private": true, - "version": "0.0.79", + "version": "0.0.80", "scripts": { "dev": "next dev", "build": "next build", diff --git a/examples/with-next-wallet-button/CHANGELOG.md b/examples/with-next-wallet-button/CHANGELOG.md index f788fbafb7..764fad1bf9 100644 --- a/examples/with-next-wallet-button/CHANGELOG.md +++ b/examples/with-next-wallet-button/CHANGELOG.md @@ -1,5 +1,13 @@ # with-next-wallet-button +## 0.0.26 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.25 ### Patch Changes diff --git a/examples/with-next-wallet-button/package.json b/examples/with-next-wallet-button/package.json index fe6ac6ef51..182c098f5f 100644 --- a/examples/with-next-wallet-button/package.json +++ b/examples/with-next-wallet-button/package.json @@ -1,7 +1,7 @@ { "name": "with-next-wallet-button", "private": true, - "version": "0.0.25", + "version": "0.0.26", "scripts": { "dev": "next dev", "build": "next build", diff --git a/examples/with-next/CHANGELOG.md b/examples/with-next/CHANGELOG.md index c3a9f42675..91a8cf1854 100644 --- a/examples/with-next/CHANGELOG.md +++ b/examples/with-next/CHANGELOG.md @@ -1,5 +1,13 @@ # with-next +## 0.0.97 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.96 ### Patch Changes diff --git a/examples/with-next/package.json b/examples/with-next/package.json index 482bbf6931..281f2340d1 100644 --- a/examples/with-next/package.json +++ b/examples/with-next/package.json @@ -1,7 +1,7 @@ { "name": "with-next", "private": true, - "version": "0.0.96", + "version": "0.0.97", "scripts": { "dev": "next dev", "build": "next build", diff --git a/examples/with-remix/CHANGELOG.md b/examples/with-remix/CHANGELOG.md index 23e2f1b18a..897567ce5a 100644 --- a/examples/with-remix/CHANGELOG.md +++ b/examples/with-remix/CHANGELOG.md @@ -1,5 +1,13 @@ # with-remix +## 0.0.96 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.95 ### Patch Changes diff --git a/examples/with-remix/package.json b/examples/with-remix/package.json index d31f04b56e..01b76b0102 100644 --- a/examples/with-remix/package.json +++ b/examples/with-remix/package.json @@ -1,7 +1,7 @@ { "name": "with-remix", "private": true, - "version": "0.0.95", + "version": "0.0.96", "type": "module", "scripts": { "build": "remix build", diff --git a/examples/with-vite/CHANGELOG.md b/examples/with-vite/CHANGELOG.md index 6e796ed8ba..c26fc0d3bc 100644 --- a/examples/with-vite/CHANGELOG.md +++ b/examples/with-vite/CHANGELOG.md @@ -1,5 +1,13 @@ # with-vite +## 0.0.85 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.84 ### Patch Changes diff --git a/examples/with-vite/package.json b/examples/with-vite/package.json index 827624b42b..f41f0d576f 100644 --- a/examples/with-vite/package.json +++ b/examples/with-vite/package.json @@ -1,7 +1,7 @@ { "name": "with-vite", "private": true, - "version": "0.0.84", + "version": "0.0.85", "type": "module", "scripts": { "dev": "vite dev", diff --git a/packages/create-rainbowkit/CHANGELOG.md b/packages/create-rainbowkit/CHANGELOG.md index d445d24e05..0a3d2ce2b2 100644 --- a/packages/create-rainbowkit/CHANGELOG.md +++ b/packages/create-rainbowkit/CHANGELOG.md @@ -1,5 +1,11 @@ # @rainbow-me/create-rainbowkit +## 0.3.8 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` + ## 0.3.7 ### Patch Changes diff --git a/packages/create-rainbowkit/generated-test-app/CHANGELOG.md b/packages/create-rainbowkit/generated-test-app/CHANGELOG.md index c3d14212c1..e7b89b6208 100644 --- a/packages/create-rainbowkit/generated-test-app/CHANGELOG.md +++ b/packages/create-rainbowkit/generated-test-app/CHANGELOG.md @@ -1,5 +1,13 @@ # generated-test-app +## 0.1.99 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.1.98 ### Patch Changes diff --git a/packages/create-rainbowkit/generated-test-app/package.json b/packages/create-rainbowkit/generated-test-app/package.json index 3294c26626..3df83dc641 100644 --- a/packages/create-rainbowkit/generated-test-app/package.json +++ b/packages/create-rainbowkit/generated-test-app/package.json @@ -1,7 +1,7 @@ { "name": "generated-test-app", "private": true, - "version": "0.1.98", + "version": "0.1.99", "scripts": { "dev": "next dev", "build": "next build", diff --git a/packages/create-rainbowkit/package.json b/packages/create-rainbowkit/package.json index 45c5344040..224cd11374 100644 --- a/packages/create-rainbowkit/package.json +++ b/packages/create-rainbowkit/package.json @@ -1,7 +1,7 @@ { "name": "@rainbow-me/create-rainbowkit", "description": "Scaffold a new RainbowKit project", - "version": "0.3.7", + "version": "0.3.8", "files": [ "dist", "templates" diff --git a/packages/create-rainbowkit/templates/next-app/CHANGELOG.md b/packages/create-rainbowkit/templates/next-app/CHANGELOG.md index 5f3e38e83d..19ca19fbab 100644 --- a/packages/create-rainbowkit/templates/next-app/CHANGELOG.md +++ b/packages/create-rainbowkit/templates/next-app/CHANGELOG.md @@ -1,5 +1,13 @@ # rainbowkit-next-app +## 0.0.99 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.98 ### Patch Changes diff --git a/packages/create-rainbowkit/templates/next-app/package.json b/packages/create-rainbowkit/templates/next-app/package.json index 4a40f8c31a..b34455b114 100644 --- a/packages/create-rainbowkit/templates/next-app/package.json +++ b/packages/create-rainbowkit/templates/next-app/package.json @@ -1,7 +1,7 @@ { "name": "rainbowkit-next-app", "private": true, - "version": "0.0.98", + "version": "0.0.99", "scripts": { "dev": "next dev", "build": "next build", diff --git a/packages/example/CHANGELOG.md b/packages/example/CHANGELOG.md index 8180212a7d..da4b15a0dd 100644 --- a/packages/example/CHANGELOG.md +++ b/packages/example/CHANGELOG.md @@ -1,5 +1,16 @@ # example +## 0.0.107 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + - @rainbow-me/rainbowkit-siwe-next-auth@0.5.0 + - @rainbow-me/rainbow-button@0.2.17 + ## 0.0.106 ### Patch Changes diff --git a/packages/example/package.json b/packages/example/package.json index 9a7a061276..6b50e8a7b4 100644 --- a/packages/example/package.json +++ b/packages/example/package.json @@ -1,6 +1,6 @@ { "name": "example", - "version": "0.0.106", + "version": "0.0.107", "description": "", "private": true, "main": "index.js", diff --git a/packages/rainbow-button/CHANGELOG.md b/packages/rainbow-button/CHANGELOG.md index f87fad1c46..478c5b8467 100644 --- a/packages/rainbow-button/CHANGELOG.md +++ b/packages/rainbow-button/CHANGELOG.md @@ -1,5 +1,12 @@ # @rainbow-me/rainbow-button +## 0.2.17 + +### Patch Changes + +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.2.16 ### Patch Changes diff --git a/packages/rainbow-button/package.json b/packages/rainbow-button/package.json index 3d24323684..b0ad620057 100644 --- a/packages/rainbow-button/package.json +++ b/packages/rainbow-button/package.json @@ -1,7 +1,7 @@ { "name": "@rainbow-me/rainbow-button", "description": "Rainbow connector button", - "version": "0.2.16", + "version": "0.2.17", "files": [ "dist", "styles.css" diff --git a/packages/rainbowkit-siwe-next-auth/CHANGELOG.md b/packages/rainbowkit-siwe-next-auth/CHANGELOG.md index 36d5398f7f..ae76a48955 100644 --- a/packages/rainbowkit-siwe-next-auth/CHANGELOG.md +++ b/packages/rainbowkit-siwe-next-auth/CHANGELOG.md @@ -1,5 +1,93 @@ # @rainbow-me/rainbowkit-siwe-next-auth +## 0.5.0 + +### Minor Changes + +- f02bced: 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. + +### Patch Changes + +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.4.1 ### Patch Changes diff --git a/packages/rainbowkit-siwe-next-auth/package.json b/packages/rainbowkit-siwe-next-auth/package.json index 75161517ed..16a385d6ec 100644 --- a/packages/rainbowkit-siwe-next-auth/package.json +++ b/packages/rainbowkit-siwe-next-auth/package.json @@ -1,6 +1,6 @@ { "name": "@rainbow-me/rainbowkit-siwe-next-auth", - "version": "0.4.1", + "version": "0.5.0", "description": "RainbowKit authentication adapter for Sign-In with Ethereum and NextAuth", "files": [ "dist" @@ -29,7 +29,7 @@ "author": "Rainbow", "license": "MIT", "peerDependencies": { - "@rainbow-me/rainbowkit": "2.0.x || 2.1.x", + "@rainbow-me/rainbowkit": "2.2.x", "next-auth": ">=4.21.0 <5", "react": ">=18" }, diff --git a/packages/rainbowkit/CHANGELOG.md b/packages/rainbowkit/CHANGELOG.md index 7f94fe8778..ffa5e7c10f 100644 --- a/packages/rainbowkit/CHANGELOG.md +++ b/packages/rainbowkit/CHANGELOG.md @@ -1,5 +1,189 @@ # @rainbow-me/rainbowkit +## 2.2.0 + +### Minor Changes + +- f02bced: 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. + ## 2.1.7 ### Patch Changes diff --git a/packages/rainbowkit/package.json b/packages/rainbowkit/package.json index 4e7d5731f2..b4cc69e2de 100644 --- a/packages/rainbowkit/package.json +++ b/packages/rainbowkit/package.json @@ -1,6 +1,6 @@ { "name": "@rainbow-me/rainbowkit", - "version": "2.1.7", + "version": "2.2.0", "description": "The best way to connect a wallet", "files": [ "dist", diff --git a/site/CHANGELOG.md b/site/CHANGELOG.md index 2585d1fa36..fabe67a83b 100644 --- a/site/CHANGELOG.md +++ b/site/CHANGELOG.md @@ -1,5 +1,13 @@ # site +## 0.0.107 + +### Patch Changes + +- dc31926: Upgraded `wagmi` to `^2.12.17` +- Updated dependencies [f02bced] + - @rainbow-me/rainbowkit@2.2.0 + ## 0.0.106 ### Patch Changes diff --git a/site/package.json b/site/package.json index e9540ed035..7e27a997f1 100644 --- a/site/package.json +++ b/site/package.json @@ -1,6 +1,6 @@ { "name": "site", - "version": "0.0.106", + "version": "0.0.107", "description": "Site and docs for RainbowKit.", "private": true, "dependencies": {