You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/base-account/improve-ux/sub-accounts.mdx
-27Lines changed: 0 additions & 27 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -51,35 +51,8 @@ bun add @base-org/account
51
51
```
52
52
</CodeGroup>
53
53
54
-
## Quickstart
55
-
56
-
The fastest way to adopt Sub Accounts is to enable automatic Sub Accounts by setting `subAccounts.mode` to `auto` in the SDK configuration.
57
-
58
-
```tsx
59
-
const sdk =createBaseAccountSDK({
60
-
// ...
61
-
subAccounts: {
62
-
mode: 'auto',
63
-
}
64
-
});
65
-
```
66
-
67
-
This will automatically create a Sub Account for the user when they connect their Base Account and transactions will automatically be sent from the Sub Account unless you specify the `from` parameter in your transaction request to be the universal account address. Spend Permissions will also be automatically requested for the Sub Account as your app needs them.
68
-
69
-
This is what the user will see when they connect their Base Account and automatic Sub Accounts are enabled:
We recommend using a [Paymaster](/base-account/improve-ux/sponsor-gas/paymasters) to sponsor gas to ensure the best user experience when integrating Sub Accounts. You can set a paymaster to be used for all transactions by configuring the `paymasterUrls` parameter in the SDK configuration. See the [createBaseAccount](/base-account/reference/core/createBaseAccount#param-paymaster-urls) reference for more information.
77
-
</Tip>
78
-
79
54
## Using Sub Accounts
80
55
81
-
If you don't want to use automatic Sub Accounts, you can create and manage them manually.
82
-
83
56
### Initialize the SDK
84
57
85
58
First, set up the Base Account SDK. Be sure to customize the `appName` and `appLogoUrl` to match your app as this will be displayed in the wallet connection popup and in the account.base.app dashboard. You can also customize the `appChainIds` to be the chains that your app supports.
0 commit comments