Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/docs.json
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,10 @@
"smart-wallet/guides/sub-accounts",
"smart-wallet/guides/sub-accounts/setup",
"smart-wallet/guides/sub-accounts/using-sub-accounts",
"smart-wallet/guides/sub-accounts/sub-accounts-with-privy",
"smart-wallet/guides/sub-accounts/add-sub-accounts-to-onchainkit-minikit"
"smart-wallet/guides/sub-accounts/sub-accounts-with-privy"
]
},
"smart-wallet/guides/profiles",
"smart-wallet/guides/spend-permissions"
]
},
Expand Down
6 changes: 6 additions & 0 deletions docs/smart-wallet/guides/sub-accounts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,9 @@ If you want to skip ahead and just get the final code, you can find it here:
- Sending transactions with Spend Permissions using `useSendTransaction`
- Building a complete interface for wallet connection and transactions
- Understanding transaction limitations based on spend permissions

3. [Sub Accounts with Privy](/smart-wallet/guides/sub-accounts/sub-accounts-with-privy) - Learn how to use Sub Accounts with Privy. This guide demonstrates:

- Using Privy to create an Auto Sub Account on creation flow
- Using Privy to create a Spend Permission that goes with the Auto Sub Account
- Using Privy actions to send transactions with the Sub Account
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ By the end of this guide, you will:
- [Smart Wallet Sub Accounts](/smart-wallet/concepts/features/optional/sub-accounts) are **only available on the canary version** of the Coinbase Wallet SDK and on **Base Sepolia**
- For now, you must also use a specific beta version of `@privy-io/react-auth` (see below)

<Info>
**Make sure you have a Privy project**

This guide covers adding Sub Accounts to your Privy project.
It does not cover the setup and creation of a Privy project.
If you don't have a Privy project yet, check out the [Privy Quickstart](https://docs.privy.io/guide/quickstart) guide.
</Info>

## 1. Override Required Package Versions

Sub Accounts require the latest canary version of `@coinbase/wallet-sdk` and a specific beta version of Privy React Auth. **You must override these versions _before_ installing packages.**
Expand Down Expand Up @@ -69,8 +77,9 @@ import { toHex, parseEther } from "viem";
appId={process.env.NEXT_PUBLIC_PRIVY_APP_ID || ""}
config={{
embeddedWallets: {
createOnLogin: "all-users",
createOnLogin: "users-without-wallets",
},
defaultChain: baseSepolia,
externalWallets: {
coinbaseWallet: {
config: {
Expand Down Expand Up @@ -138,6 +147,7 @@ npm run dev

- [Sub Accounts Privy Demo](https://github.com/base/demos/tree/master/smart-wallet/sub-accounts-privy)
- [Sub Accounts Setup Guide](/smart-wallet/guides/sub-accounts/setup)
- [Sub Accounts Full Reference](/smart-wallet/guides/sub-accounts/sub-accounts-full-reference)
- [Smart Wallet Sub Accounts Feature](/smart-wallet/concepts/features/optional/sub-accounts)
- [Privy Quickstart](https://docs.privy.io/guide/quickstart)
- [Discord #smart-wallet](https://discord.com/invite/cdp) for questions or feedback