Skip to content

Commit b4ab8cd

Browse files
committed
AA Session Keys docs - small updates (#4451)
## Problem solved Short description of the bug fixed or feature added <!-- start pr-codex --> --- ## PR-Codex overview This PR updates the user operation signing process and renames `smartWallet` to `wallet` for consistency. ### Detailed summary - Updated user operation signing to be asynchronous - Renamed `smartWallet` to `wallet` for consistency - Changed `addAdmin` import to `addSessionKey` > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
1 parent 775ab6d commit b4ab8cd

File tree

2 files changed

+8
-7
lines changed
  • apps/portal/src/app/connect/account-abstraction/permissions
  • packages/thirdweb/src/wallets/smart/lib

2 files changed

+8
-7
lines changed

apps/portal/src/app/connect/account-abstraction/permissions/page.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ import { addAdmin } from "thirdweb/extensions/erc4337";
6666
import { smartWallet } from "thirdweb/wallets";
6767
import { sendTransaction, getContract } from "thirdweb";
6868

69-
const smartWallet = new smartWallet(config);
70-
const smartAccount = await smartWallet.connect({
69+
const wallet = new smartWallet(config);
70+
const smartAccount = await wallet.connect({
7171
client,
7272
personalAccount,
7373
});
@@ -134,7 +134,7 @@ const onClick = () => {
134134
client,
135135
}),
136136
account: smartAccount,
137-
sessionKeyAddress: "0x...", // the address of the new session key
137+
sessionKeyAddress: "0x...", // the address of the account allowed to use the session key
138138
permissions: {
139139
approvedTargets: "*", // the addresses of allowed contracts, or '*' for any contract
140140
nativeTokenLimitPerTransaction: 0.1, // the maximum amount of native token (in ETH) that the session key can spend per transaction
@@ -151,11 +151,11 @@ const onClick = () => {
151151
<TabsContent value="typescript">
152152

153153
```ts
154-
import { addAdmin } from "thirdweb/extensions/erc4337";
155-
import { smartWallet } from "thirdweb/wallets";
154+
import { addSessionKey } from "thirdweb/extensions/erc4337";
155+
import { wallet } from "thirdweb/wallets";
156156
import { sendTransaction, getContract } from "thirdweb";
157157

158-
const smartWallet = new smartWallet(config);
158+
const wallet = new smartWallet(config);
159159
const smartAccount = await smartWallet.connect({
160160
client,
161161
personalAccount,

packages/thirdweb/src/wallets/smart/lib/userop.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,9 +486,10 @@ async function populateUserOp_v0_6(args: {
486486
* ```ts
487487
* import { signUserOp } from "thirdweb/wallets/smart";
488488
*
489-
* const userOp = createUnsignedUserOp(...);
489+
* const userOp = await createUnsignedUserOp(...);
490490
*
491491
* const signedUserOp = await signUserOp({
492+
* client,
492493
* userOp,
493494
* chain,
494495
* adminAccount,

0 commit comments

Comments
 (0)