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,79 @@ 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>
127
158
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
+
## Pre Connection Hooks
48
48
49
-
## Post Connection
49
+
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.
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
+
<Stack>
52
+
53
+
<ArticleIconCard
54
+
title="createWallet"
55
+
icon={Wallet}
56
+
href="/references/typescript/v5/createWallet"
57
+
description="Create any external wallet by id with auto completion"
58
+
/>
59
+
60
+
<ArticleIconCard
61
+
title="useConnect"
62
+
icon={Wallet}
63
+
href="/references/typescript/v5/useConnect"
64
+
description="Hook to connect any created wallet"
65
+
/>
66
+
67
+
<ArticleIconCard
68
+
title="useAutoConnect"
69
+
icon={Wallet}
70
+
href="/references/typescript/v5/useConnect"
71
+
description="Hook to auto connect a previously connected wallet"
72
+
/>
73
+
74
+
<ArticleIconCard
75
+
title="useConnectModal"
76
+
icon={Wallet}
77
+
href="/references/typescript/v5/useConnectModal"
78
+
description="Hook to open a prebuilt connection modal from your own components "
79
+
/>
80
+
81
+
</Stack>
82
+
83
+
## Post Connection Hooks
84
+
85
+
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.
You can use [`ConnectButton`](/react/v5/ConnectButton) or [`ConnectEmbed`](/react/v5/ConnectEmbed) component for a quick, easy and customizable UI.
19
19
20
-
These components provide a beautiful UI for connecting various wallets and take care of a lot of wallet-specific edge cases - so you can focus on building your app.
20
+
These components provide a prebuilt UI for connecting various wallets and take care of a lot of wallet-specific edge cases - so you can focus on building your app.
21
21
22
-
These components support over 300+ wallets, including support in-app wallets and account abstraction.
0 commit comments