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
Obtain an API key from the [thirdweb dashboard Settings page](https://thirdweb.com/create-api-key).
36
+
To set up sponsored transactions, set the `sponsorGas` option to `true` in the smart account configuration.
37
+
All transactions performed with the smart account will then be sponsored by your application. Testnet transactions are free, but you need a valid credit card on file for mainnet transactions.
39
38
40
-
The API key lets you access thirdweb's bundler and paymaster infrastructure, which is required for smart accounts to operate and optionally enable [gasless transactions](/glossary/gasless-transactions).
39
+
</Callout>
41
40
42
-
Learn more about creating an API key and restricting which contracts the smart account can interact with [here](/api-keys).
41
+
## Live Playground
43
42
44
-
</Step>
45
-
<Steptitle="Connect smart accounts in your application">
43
+
Try out in-app wallets for yourself in the [in-app wallet live playground](https://playground.thirdweb.com/connect/account-abstraction/connect)
46
44
47
-
The easiest way to get started with account abstraction is to use the [ConnectButton](/connect/sign-in/ConnectButton) component. Simply add the `accountAbstraction` property with the desired chain and whether to sponsor gas for your users.
45
+
<Stack>
48
46
49
-
With this property, all connected wallets will be automatically converted to smart accounts. The connected wallet will be the admin wallet of the smart account.
To set up sponsored transactions, set the `sponsorGas` option to `true` in the smart account configuration.
54
-
All transactions performed with the smart account will then be sponsored by your application. Testnet transactions are free, but you need a valid credit card on file for mainnet transactions.
56
+
## Usage with Connect UI components
55
57
56
-
</Callout>
58
+
The easiest way to get started with account abstraction is to use the [ConnectButton](/connect/sign-in/ConnectButton) component. Simply add the `accountAbstraction` property with the desired chain and whether to sponsor gas for your users.
59
+
60
+
With this property, all connected wallets will be automatically converted to smart accounts. The connected wallet will be the admin wallet of the smart account.
57
61
58
62
```tsx
59
63
import { createThirdwebClient } from"thirdweb";
@@ -77,56 +81,90 @@ return (
77
81
);
78
82
}
79
83
```
80
-
</Step>
81
-
<Steptitle="Executing Transactions with Smart Accounts">
82
84
83
-
Once setup, you can use the rest of the Connect [React SDK](/react/latest)to deploy contracts, perform transactions, and manipulate smart accounts like any other wallet.
85
+
You can also make it so *only* in-app wallets get converted to smart accounts, by configuring the in-app wallet individually. Other external wallets will not be converted to smart accounts with this setup.
<Callouttitle="Auto connection of smart accounts"variant="info">
156
+
When building your own UI, remember to also pass the `accountAbstraction` prop to `useAutoConnect` to always reconnect to the smart account on page reload.
157
+
</Callout>
123
158
124
-
### Demos
159
+
Refer to the [Smart Wallet API reference](/references/typescript/v5/smartWallet) for more advanced configuration of your smart accounts.
125
160
126
-
Learn by example with these open-source demos:
161
+
<Stack>
127
162
128
-
<OpenSourceCard
129
-
title="Account Abstraction Demos"
130
-
description="A reference implementation to create and interact with smart accounts."
All of the account contracts - [Simple](https://thirdweb.com/thirdweb.eth/AccountFactory) and [Managed](https://thirdweb.com/thirdweb.eth/ManagedAccountFactory) - share the same permission model. In this section, we'll describe this permission model in detail.
18
+
A [smart account](/react/v5/account-abstraction/get-started) can have two types of actors: _Session Keys_ and _Admins_.
18
19
19
-
An account recognizes only two types of actors: _Session Keys_ and _Admins_.
20
-
21
-
## 1. Admins
20
+
## Admins
22
21
23
22
Admins have **unrestricted access** to the account; call any functions on the contract, use the contract without going through the ERC-4337 infrastructure (bundlers, EntryPoint, etc.), withdraw the account's native token balance, and so on.
24
23
@@ -49,7 +48,33 @@ const onClick = () => {
49
48
};
50
49
```
51
50
52
-
## 2. Session Keys
51
+
Check out the [API reference](/references/typescript/v5/erc4337/addAdmin) function for more information.
52
+
53
+
<Stack>
54
+
55
+
<ArticleIconCard
56
+
title="addAdmin"
57
+
icon={TypeScriptIcon}
58
+
href="/references/typescript/v5/erc4337/addAdmin"
59
+
description="Function to add a new admin to the account"
description="Function to remove an admin from the account"
74
+
/>
75
+
</Stack>
76
+
77
+
## Session Keys
53
78
54
79
Session Keys are additional authorized signers that must go through ERC-4337 infrastructure (bundlers, EntryPoint, etc.) to use an account to execute transactions. Session keys can use an account under certain restrictions.
55
80
@@ -91,3 +116,36 @@ const onClick = () => {
91
116
sendTransaction(transaction);
92
117
};
93
118
```
119
+
120
+
Check out the [API reference](/references/typescript/v5/erc4337/addSessionKey) for more information.
0 commit comments