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."
Refer to [`createWallet`](/references/typescript/v5/createWallet) and [`injectedProvider`](/references/typescript/v5/injectedProvider) for more information.
47
+
## Creating Wallets
48
48
49
-
## Post Connection
49
+
You can create any wallet by id with auto completion using the [`createWallet`](/references/typescript/v5/createWallet) function. Or use one of the first party wallets like [`inAppWallet`](/references/typescript/v5/inAppWallet) or [`ecosystemWallet`](/references/typescript/v5/ecosystemWallet).
50
50
51
-
Once the wallet is connected, you can use the [Wallet Connection hooks](/references/typescript/v5/hooks#wallet-connection) to get information about the connected wallet like getting the address, account, etc
51
+
<ArticleIconCard
52
+
title="inAppWallet"
53
+
icon={Wallet}
54
+
href="/references/typescript/v5/inAppWallet"
55
+
description="Create an in app wallet"
56
+
/>
57
+
58
+
<ArticleIconCard
59
+
title="ecosystemWallet"
60
+
icon={Wallet}
61
+
href="/references/typescript/v5/ecosystemWallet"
62
+
description="Create an ecosystem wallet"
63
+
/>
64
+
65
+
<ArticleIconCard
66
+
title="createWallet"
67
+
icon={Wallet}
68
+
href="/references/typescript/v5/createWallet"
69
+
description="Create any external wallet by id with auto completion"
70
+
/>
71
+
72
+
## Pre Connection Hooks
73
+
74
+
Use these hooks to trigger and manage wallet wallet connection within your own UI. Refer to [wallet connection hooks reference](/references/typescript/v5/useConnect) for more information.
75
+
76
+
<Stack>
77
+
78
+
<ArticleIconCard
79
+
title="useConnect"
80
+
icon={ReactIcon}
81
+
href="/references/typescript/v5/useConnect"
82
+
description="Hook to connect any created wallet"
83
+
/>
84
+
85
+
<ArticleIconCard
86
+
title="useAutoConnect"
87
+
icon={ReactIcon}
88
+
href="/references/typescript/v5/useConnect"
89
+
description="Hook to auto connect a previously connected wallet"
90
+
/>
91
+
92
+
<ArticleIconCard
93
+
title="useConnectModal"
94
+
icon={ReactIcon}
95
+
href="/references/typescript/v5/useConnectModal"
96
+
description="Hook to open a prebuilt connection modal UI from anywhere"
description="Hook to switch the active wallet chain"
104
+
/>
105
+
106
+
<ArticleIconCard
107
+
title="useDisconnect"
108
+
icon={ReactIcon}
109
+
href="/references/typescript/v5/useDisconnect"
110
+
description="Hook to disconnect the wallet"
111
+
/>
112
+
113
+
</Stack>
114
+
115
+
## Post Connection Hooks
116
+
117
+
Once the wallet is connected, you can use the [wallet connection hooks](/references/typescript/v5/hooks#wallet-connection) to get information about the connected wallet like getting the address, account, etc.
0 commit comments