From e4c279ee06a343e2d725036083d8b0accad48999 Mon Sep 17 00:00:00 2001 From: alchemy-bot <80712764+alchemy-bot@users.noreply.github.com> Date: Mon, 1 Jun 2026 19:10:07 +0000 Subject: [PATCH 1/6] [docs-agent] Fix weekly link-check: 4 broken wallets links Weekly link-check workflow flagged 4 broken `alchemy.com/docs/wallets/...` links. Each is repointed to the correct existing path (privy, aa-sdk/core) or an external official equivalent (ERC-7677 EIP for third-party paymasters; v5 session keys reference page). Refs DOCS-105 --- .../pages/low-level-infra/third-party-infrastructure/chains.mdx | 2 +- content/wallets/pages/recipes/smart-wallets-aave.mdx | 2 +- .../smart-contracts/modular-account-v2/getting-started.mdx | 2 +- .../modular-account-v2/session-keys/using-session-keys.mdx | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/content/wallets/pages/low-level-infra/third-party-infrastructure/chains.mdx b/content/wallets/pages/low-level-infra/third-party-infrastructure/chains.mdx index 03d3af7b3..33ceb27e6 100644 --- a/content/wallets/pages/low-level-infra/third-party-infrastructure/chains.mdx +++ b/content/wallets/pages/low-level-infra/third-party-infrastructure/chains.mdx @@ -46,4 +46,4 @@ const hash = await bundlerClient.sendUserOperation({ }); ``` -To add gas sponsorship via a third-party paymaster on this chain, see [Third Party Paymasters](/docs/wallets/low-level-infra/third-party-infrastructure/paymasters). +To add gas sponsorship via a third-party paymaster on this chain, configure viem's bundler client with that provider's [ERC-7677](https://eips.ethereum.org/EIPS/eip-7677) paymaster RPC. diff --git a/content/wallets/pages/recipes/smart-wallets-aave.mdx b/content/wallets/pages/recipes/smart-wallets-aave.mdx index 60cd2e35a..5d05fa2c5 100644 --- a/content/wallets/pages/recipes/smart-wallets-aave.mdx +++ b/content/wallets/pages/recipes/smart-wallets-aave.mdx @@ -9,7 +9,7 @@ slug: wallets/recipes/smart-wallets-aave -Learn how to build DeFi applications that interact with Aave using Wallet APIs. This recipe covers supplying and withdrawing assets with both the [Core library](/docs/wallets/reference/aa-sdk/core) and the [Wallet APIs](/docs/wallets/api-reference/smart-wallets/wallet-api-endpoints/wallet-request-account) for seamless user experiences. +Learn how to build DeFi applications that interact with Aave using Wallet APIs. This recipe covers supplying and withdrawing assets with both the [Core library](/docs/wallets/quickstart) and the [Wallet APIs](/docs/wallets/api-reference/smart-wallets/wallet-api-endpoints/wallet-request-account) for seamless user experiences. ## Prerequisites diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx index 2ddff5279..90ad3fe58 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx @@ -59,7 +59,7 @@ Two variants of Modular Account V2 are available: `default` and `7702`. * (Recommended) `default` provides the cheapest, most flexible smart wallet. * `7702` if you want EIP-7702 support — see the [EIP-7702 guide](/docs/wallets/transactions/using-eip-7702). -Want to enable social login methods? [Use Privy as your signer](/docs/wallets/wallet-integrations/privy). +Want to enable social login methods? [Use Privy as your signer](/docs/wallets/third-party/signers/privy). ## Sending a transaction diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx index b14691d63..3e3ba4f76 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx @@ -4,7 +4,7 @@ description: Using session keys with your Modular Account V2 slug: wallets/smart-contracts/modular-account-v2/session-keys/using-session-keys --- -Once a session key is installed, you can use it by creating a second `ModularAccountV2` whose **owner** is the session key signer and whose `accountAddress` points to the original account. Pass the session key's `entityId` and global-validation flag via `signerEntity` — these were set when you called [`encodeInstallValidation`](/docs/wallets/smart-contracts/modular-account-v2/session-keys/adding-session-keys). +Once a session key is installed, you can use it by creating a second `ModularAccountV2` whose **owner** is the session key signer and whose `accountAddress` points to the original account. Pass the session key's `entityId` and global-validation flag via `signerEntity` — these were set when you called [`encodeInstallValidation`](/docs/wallets/reference/wallet-apis-session-keys). ```ts twoslash import { createBundlerClient } from "viem/account-abstraction"; From ce19c41ae2890e6f00c1e26439357280b6e65348 Mon Sep 17 00:00:00 2001 From: jakehobbs Date: Mon, 1 Jun 2026 13:35:19 -0700 Subject: [PATCH 2/6] Clarify low-level wallet docs navigation Keep v4 recipe links versioned and expose low-level MAv2 session-key docs from the sidebar while pointing most users toward Wallet APIs. Co-Authored-By: Codex --- content/docs.yml | 12 ++++++++++++ content/wallets/pages/recipes/smart-wallets-aave.mdx | 2 +- .../modular-account-v2/getting-started.mdx | 2 -- .../session-keys/adding-session-keys.mdx | 4 ++++ .../modular-account-v2/session-keys/index.mdx | 4 ++++ .../session-keys/removing-session-keys.mdx | 4 ++++ .../session-keys/session-key-permissions.mdx | 6 +++++- .../session-keys/using-session-keys.mdx | 6 +++++- .../wallets/pages/third-party/smart-contracts.mdx | 8 ++++++++ 9 files changed, 43 insertions(+), 5 deletions(-) diff --git a/content/docs.yml b/content/docs.yml index a8c8256db..786123306 100644 --- a/content/docs.yml +++ b/content/docs.yml @@ -1075,6 +1075,18 @@ navigation: path: wallets/pages/authorization/smart-account-types/modular-account-v2/overview.mdx - page: Getting started path: wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx + - section: Session keys + contents: + - page: What are session keys? + path: wallets/pages/smart-contracts/modular-account-v2/session-keys/index.mdx + - page: Adding session keys + path: wallets/pages/smart-contracts/modular-account-v2/session-keys/adding-session-keys.mdx + - page: Supported permissions + path: wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx + - page: Using session keys + path: wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx + - page: Removing session keys + path: wallets/pages/smart-contracts/modular-account-v2/session-keys/removing-session-keys.mdx - section: Light Account contents: - page: Overview diff --git a/content/wallets/pages/recipes/smart-wallets-aave.mdx b/content/wallets/pages/recipes/smart-wallets-aave.mdx index 5d05fa2c5..46dcc5bc6 100644 --- a/content/wallets/pages/recipes/smart-wallets-aave.mdx +++ b/content/wallets/pages/recipes/smart-wallets-aave.mdx @@ -9,7 +9,7 @@ slug: wallets/recipes/smart-wallets-aave -Learn how to build DeFi applications that interact with Aave using Wallet APIs. This recipe covers supplying and withdrawing assets with both the [Core library](/docs/wallets/quickstart) and the [Wallet APIs](/docs/wallets/api-reference/smart-wallets/wallet-api-endpoints/wallet-request-account) for seamless user experiences. +Learn how to build DeFi applications that interact with Aave using Wallet APIs. This recipe covers supplying and withdrawing assets with both the [`@aa-sdk/core`](https://github.com/alchemyplatform/aa-sdk/tree/v4.x.x/aa-sdk/core) library and the [Wallet APIs](/docs/wallets/api-reference/smart-wallets/wallet-api-endpoints/wallet-request-account) for seamless user experiences. ## Prerequisites diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx index 90ad3fe58..f31371127 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx @@ -59,8 +59,6 @@ Two variants of Modular Account V2 are available: `default` and `7702`. * (Recommended) `default` provides the cheapest, most flexible smart wallet. * `7702` if you want EIP-7702 support — see the [EIP-7702 guide](/docs/wallets/transactions/using-eip-7702). -Want to enable social login methods? [Use Privy as your signer](/docs/wallets/third-party/signers/privy). - ## Sending a transaction Pair the account with viem's bundler client (and `@alchemy/aa-infra`'s fee estimator) to submit user operations. diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/adding-session-keys.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/adding-session-keys.mdx index 23fd74761..942404914 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/adding-session-keys.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/adding-session-keys.mdx @@ -4,6 +4,10 @@ description: Adding session keys to your Modular Account V2 slug: wallets/smart-contracts/modular-account-v2/session-keys/adding-session-keys --- + + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: installing Modular Account V2 session-key validations directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need fine-grained control over onchain validations and permissions. + + To add a session key: 1) decide what permissions you want to grant the new key, and 2) call the [`installValidation`](#install-validation-parameters) function on the account. In v5 you do this by extending the bundler client with `installValidationActions`, encoding the install call via `encodeInstallValidation`, then sending it as a user operation. The bundler client returns a calldata hex; `sendUserOperation` wraps it in an `execute` call from the account. Scoped permissions are layered on as **hooks** that you pass into `installValidation`. Hooks can be combined — e.g. a session key that can only spend 10 USDC within the next 24 hours from the account. diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/index.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/index.mdx index f6795c819..123f0e9b5 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/index.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/index.mdx @@ -4,6 +4,10 @@ description: Learn what session keys are, why they exist, and how they enable se slug: wallets/smart-contracts/modular-account-v2/session-keys --- + + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This section covers the lower-level path: managing Modular Account V2 session keys directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need fine-grained control over onchain validations and permissions. + + Session Keys allow you to add multiple signers to a smart account with scoped permissions that are validated onchain. This unlocks: * Multiple owners for accounts diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/removing-session-keys.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/removing-session-keys.mdx index c6450c4b0..ee1fd15e3 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/removing-session-keys.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/removing-session-keys.mdx @@ -4,6 +4,10 @@ description: Removing session keys from your Modular Account V2 slug: wallets/smart-contracts/modular-account-v2/session-keys/removing-session-keys --- + + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: uninstalling Modular Account V2 session-key validations directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need fine-grained control over onchain validations and permissions. + + To remove a session key, extend the bundler client with `installValidationActions` and call `encodeUninstallValidation`. It returns calldata; send it as a user operation from the account. ```ts twoslash diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx index b2c1bc653..a985b6a3e 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx @@ -1,9 +1,13 @@ --- title: Supported permissions for session keys description: Explore the supported permission types you can apply to session keys to safely delegate access in smart accounts. -slug: wallets/smart-contracts/modular-account-v2/session-key-permissions +slug: wallets/smart-contracts/modular-account-v2/session-keys/session-key-permissions --- + + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: composing Modular Account V2 session-key permissions directly with `@alchemy/smart-accounts`. Use it when you need fine-grained control over onchain validations and permissions. + + ## What permissions can you apply to session keys? Session keys work best when they are tightly scoped. Modular Account V2 gives you a flexible set of built-in permission types. These permissions are validated onchain, removing any dependency on an offchain engine and increasing security of users' accounts. diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx index 3e3ba4f76..d1518b347 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx @@ -4,7 +4,11 @@ description: Using session keys with your Modular Account V2 slug: wallets/smart-contracts/modular-account-v2/session-keys/using-session-keys --- -Once a session key is installed, you can use it by creating a second `ModularAccountV2` whose **owner** is the session key signer and whose `accountAddress` points to the original account. Pass the session key's `entityId` and global-validation flag via `signerEntity` — these were set when you called [`encodeInstallValidation`](/docs/wallets/reference/wallet-apis-session-keys). + + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: using Modular Account V2 session-key validations directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need fine-grained control over onchain validations and permissions. + + +Once a session key is installed, you can use it by creating a second `ModularAccountV2` whose **owner** is the session key signer and whose `accountAddress` points to the original account. Pass the session key's `entityId` and global-validation flag via `signerEntity` — these were set when you called [`encodeInstallValidation`](/docs/wallets/smart-contracts/modular-account-v2/session-keys/adding-session-keys). ```ts twoslash import { createBundlerClient } from "viem/account-abstraction"; diff --git a/content/wallets/pages/third-party/smart-contracts.mdx b/content/wallets/pages/third-party/smart-contracts.mdx index 74f819091..7053cafe9 100644 --- a/content/wallets/pages/third-party/smart-contracts.mdx +++ b/content/wallets/pages/third-party/smart-contracts.mdx @@ -56,3 +56,11 @@ The viem docs walk through a full custom example. Once you have a `SmartAccount` ### Why use the existing implementations? `@alchemy/smart-accounts` ships viem-compatible implementations of [Light Account](/docs/wallets/smart-contracts/other-accounts/light-account/getting-started), [Modular Account V1](/docs/wallets/reference/smart-accounts), and [Modular Account V2](/docs/wallets/smart-contracts/modular-account-v2/getting-started), plus the validation/permission builders for MAv2. If your use case fits one of those, you'll save a lot of custom-account boilerplate. + +### Using Alchemy smart accounts with third-party infrastructure + +If you want to keep Alchemy's smart account implementations while using non-Alchemy infrastructure, see the low-level infrastructure guides: + +* [Non-Alchemy chains](/docs/wallets/low-level-infra/third-party-infrastructure/chains) — run `@alchemy/smart-accounts` on a chain Alchemy doesn't support. +* [Third-party bundlers](/docs/wallets/low-level-infra/third-party-infrastructure/bundlers) — submit user operations through another bundler RPC. +* [Third-party paymasters](/docs/wallets/low-level-infra/third-party-infrastructure/paymasters) — sponsor user operations with a non-Alchemy paymaster. From de6b6175c4b83f0435a237fe7f17353eedb2a9fa Mon Sep 17 00:00:00 2001 From: jakehobbs Date: Mon, 1 Jun 2026 13:38:05 -0700 Subject: [PATCH 3/6] Clarify session key time window example Avoid implying a specific calendar range for session-key permissions examples. Co-Authored-By: Codex --- .../pages/authorization/policies/session-key-permissions.mdx | 2 +- .../modular-account-v2/session-keys/session-key-permissions.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/wallets/pages/authorization/policies/session-key-permissions.mdx b/content/wallets/pages/authorization/policies/session-key-permissions.mdx index 4133d5fa4..3cc8b0ca2 100644 --- a/content/wallets/pages/authorization/policies/session-key-permissions.mdx +++ b/content/wallets/pages/authorization/policies/session-key-permissions.mdx @@ -38,7 +38,7 @@ Permissions are composable. You can apply multiple permissions to a single sessi Example: You could create a session key that: -* Only works between June 1–June 15 +* Only works during a configured start and expiry time window * Can call only one staking contract * Spend no more than 100 USDC diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx index a985b6a3e..5b8c34112 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx @@ -42,7 +42,7 @@ Permissions are composable. You can apply multiple permissions to a single sessi Example: You could create a session key that: -* Only works between June 1–June 15 +* Only works during a configured start and expiry time window * Can call just one staking contract * Spend no more than 100 USDC From 9a053db8acf410f29156a6f73f19bf96e68e4405 Mon Sep 17 00:00:00 2001 From: jakehobbs Date: Mon, 1 Jun 2026 13:41:04 -0700 Subject: [PATCH 4/6] Align wallet docs with v4 recipe wording Clarify that the Aave recipe uses Account Kit v4 and describe lower-level MAv2 docs as custom wiring paths. Co-Authored-By: Codex --- .../pages/recipes/smart-wallets-aave.mdx | 44 +++++++++++-------- .../modular-account-v2/getting-started.mdx | 2 +- .../session-keys/adding-session-keys.mdx | 2 +- .../modular-account-v2/session-keys/index.mdx | 2 +- .../session-keys/removing-session-keys.mdx | 2 +- .../session-keys/session-key-permissions.mdx | 2 +- .../session-keys/using-session-keys.mdx | 2 +- 7 files changed, 32 insertions(+), 24 deletions(-) diff --git a/content/wallets/pages/recipes/smart-wallets-aave.mdx b/content/wallets/pages/recipes/smart-wallets-aave.mdx index 46dcc5bc6..8eef42f0d 100644 --- a/content/wallets/pages/recipes/smart-wallets-aave.mdx +++ b/content/wallets/pages/recipes/smart-wallets-aave.mdx @@ -1,15 +1,15 @@ --- -title: Wallet APIs with Aave +title: Account Kit v4 with Aave description: >- - Learn how to build DeFi applications that interact with Aave using Alchemy - Wallet APIs. This recipe covers supplying and withdrawing assets with both - Core and Wallets API. + Learn how to build DeFi applications that interact with Aave using Account + Kit v4. This recipe covers supplying and withdrawing assets with both Core + and the v4 wallet client. slug: wallets/recipes/smart-wallets-aave --- -Learn how to build DeFi applications that interact with Aave using Wallet APIs. This recipe covers supplying and withdrawing assets with both the [`@aa-sdk/core`](https://github.com/alchemyplatform/aa-sdk/tree/v4.x.x/aa-sdk/core) library and the [Wallet APIs](/docs/wallets/api-reference/smart-wallets/wallet-api-endpoints/wallet-request-account) for seamless user experiences. +Learn how to build DeFi applications that interact with Aave using Account Kit v4. This recipe covers supplying and withdrawing assets with both the [`@aa-sdk/core`](https://github.com/alchemyplatform/aa-sdk/tree/v4.x.x/aa-sdk/core) library and the [`@account-kit/wallet-client`](https://github.com/alchemyplatform/aa-sdk/tree/v4.x.x/account-kit/wallet-client) package. ## Prerequisites @@ -253,21 +253,25 @@ Check out this video walkthrough, and follow along with the quick start below: ``` - - This approach uses the higher-level wallet-client API with explicit prepare/sign/send workflow for Aave interactions. + + This approach uses the v4 wallet-client API with explicit prepare/sign/send workflow for Aave interactions. ```typescript - import { createSmartWalletClient, alchemyWalletTransport } from "@alchemy/wallet-apis"; - import { arbitrum } from "viem/chains"; - import { privateKeyToAccount } from "viem/accounts"; + import { createSmartWalletClient } from "@account-kit/wallet-client"; + import { alchemy, arbitrum } from "@account-kit/infra"; + import { LocalAccountSigner } from "@aa-sdk/core"; + + const signer = LocalAccountSigner.privateKeyToAccountSigner(privateKey); // Setup smart wallet client const smartWalletClient = createSmartWalletClient({ - signer: privateKeyToAccount(privateKey), + signer, chain: arbitrum, - transport: alchemyWalletTransport({ apiKey: alchemyApiKey }), + transport: alchemy({ apiKey: alchemyApiKey }), }); + const account = await smartWalletClient.requestAccount(); + // Get Aave operation data (supply/withdraw) const aaveData = await getAaveOperationData(); // implementation same as Core approach @@ -296,15 +300,19 @@ Check out this video walkthrough, and follow along with the quick start below: // Prepare, sign, and send with gas sponsorship const preparedCalls = await smartWalletClient.prepareCalls({ calls, + from: account.address, capabilities: { - paymaster: { - policyId: policyId, // Gas sponsorship + paymasterService: { + policyId, }, }, }); - const signedCalls = await smartWalletClient.signPreparedCalls(preparedCalls); // signed by the signer on the client - const result = await smartWalletClient.sendPreparedCalls(signedCalls); + const signedCalls = await smartWalletClient.signPreparedCalls(preparedCalls); + const preparedCallIds = await smartWalletClient.sendPreparedCalls(signedCalls); + const result = await smartWalletClient.waitForCallsStatus({ + id: preparedCallIds.preparedCallIds[0]!, + }); console.log( "Aave operation completed! Hash:", @@ -324,7 +332,7 @@ Check out this video walkthrough, and follow along with the quick start below: npm run core:supply # Supply to Aave npm run core:withdraw # Withdraw from Aave - # Wallet APIs implementation + # Wallet client implementation npm run wallet:account # Initialize account npm run wallet:supply # Supply to Aave npm run wallet:withdraw # Withdraw from Aave @@ -344,6 +352,6 @@ You can now interact with Aave protocol through smart wallets with sponsored gas ## Resources * [Aave V3 Documentation](https://docs.aave.com/developers/) -* [Alchemy Wallet APIs Quickstart](https://www.alchemy.com/docs/wallets/react/quickstart) +* [`@account-kit/wallet-client` source](https://github.com/alchemyplatform/aa-sdk/tree/v4.x.x/account-kit/wallet-client) * [Gas Manager Setup](https://www.alchemy.com/docs/setup-a-gas-manager-policy) * [Aave Contract Addresses](https://aave.com/docs/resources/addresses) diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx index f31371127..1a017a573 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/getting-started.mdx @@ -7,7 +7,7 @@ slug: wallets/smart-contracts/modular-account-v2/getting-started Getting started with Modular Account V2 is straightforward. Below, you'll create a Modular Account V2 from a signer and send a transaction through viem's bundler client. Your MAv2 deploys onchain on the first user operation. - [`@alchemy/wallet-apis`](/docs/wallets/quickstart) already uses Modular Account V2 as its default smart account — `createSmartWalletClient` gives you MAv2 plus account creation, gas estimation, and the bundler client behind a single call. This page covers the lower-level path: instantiating MAv2 directly from `@alchemy/smart-accounts` and pairing it with viem's bundler client. Use it when you need fine-grained control over the wiring. + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) already uses Modular Account V2 as its default smart account — `createSmartWalletClient` gives you MAv2 plus account creation, gas estimation, and the bundler client behind a single call. This page covers the lower-level path: instantiating MAv2 directly from `@alchemy/smart-accounts` and pairing it with viem's bundler client. Use it when you need lower-level control over custom wiring. ## Install packages diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/adding-session-keys.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/adding-session-keys.mdx index 942404914..202b9bb4b 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/adding-session-keys.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/adding-session-keys.mdx @@ -5,7 +5,7 @@ slug: wallets/smart-contracts/modular-account-v2/session-keys/adding-session-key --- - [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: installing Modular Account V2 session-key validations directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need fine-grained control over onchain validations and permissions. + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: installing Modular Account V2 session-key validations directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need lower-level control for custom onchain validation and permission wiring. To add a session key: 1) decide what permissions you want to grant the new key, and 2) call the [`installValidation`](#install-validation-parameters) function on the account. In v5 you do this by extending the bundler client with `installValidationActions`, encoding the install call via `encodeInstallValidation`, then sending it as a user operation. The bundler client returns a calldata hex; `sendUserOperation` wraps it in an `execute` call from the account. diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/index.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/index.mdx index 123f0e9b5..5d82d075e 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/index.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/index.mdx @@ -5,7 +5,7 @@ slug: wallets/smart-contracts/modular-account-v2/session-keys --- - [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This section covers the lower-level path: managing Modular Account V2 session keys directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need fine-grained control over onchain validations and permissions. + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This section covers the lower-level path: managing Modular Account V2 session keys directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need lower-level control for custom onchain validation and permission wiring. Session Keys allow you to add multiple signers to a smart account with scoped permissions that are validated onchain. This unlocks: diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/removing-session-keys.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/removing-session-keys.mdx index ee1fd15e3..633ab1528 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/removing-session-keys.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/removing-session-keys.mdx @@ -5,7 +5,7 @@ slug: wallets/smart-contracts/modular-account-v2/session-keys/removing-session-k --- - [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: uninstalling Modular Account V2 session-key validations directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need fine-grained control over onchain validations and permissions. + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: uninstalling Modular Account V2 session-key validations directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need lower-level control for custom onchain validation and permission wiring. To remove a session key, extend the bundler client with `installValidationActions` and call `encodeUninstallValidation`. It returns calldata; send it as a user operation from the account. diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx index 5b8c34112..6620697a0 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx @@ -5,7 +5,7 @@ slug: wallets/smart-contracts/modular-account-v2/session-keys/session-key-permis --- - [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: composing Modular Account V2 session-key permissions directly with `@alchemy/smart-accounts`. Use it when you need fine-grained control over onchain validations and permissions. + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: composing Modular Account V2 session-key permissions directly with `@alchemy/smart-accounts`. Use it when you need lower-level control for custom onchain validation and permission wiring. ## What permissions can you apply to session keys? diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx index d1518b347..15e6ceb81 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/using-session-keys.mdx @@ -5,7 +5,7 @@ slug: wallets/smart-contracts/modular-account-v2/session-keys/using-session-keys --- - [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: using Modular Account V2 session-key validations directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need fine-grained control over onchain validations and permissions. + [`@alchemy/wallet-apis`](/docs/wallets/quickstart) supports session keys through [`wallet_createSession`](/docs/wallets/reference/wallet-apis-session-keys/api) and the [`grantPermissions`](/docs/wallets/reference/wallet-apis-session-keys/sdk) SDK flow. This page covers the lower-level path: using Modular Account V2 session-key validations directly with `@alchemy/smart-accounts` and viem's bundler client. Use it when you need lower-level control for custom onchain validation and permission wiring. Once a session key is installed, you can use it by creating a second `ModularAccountV2` whose **owner** is the session key signer and whose `accountAddress` points to the original account. Pass the session key's `entityId` and global-validation flag via `signerEntity` — these were set when you called [`encodeInstallValidation`](/docs/wallets/smart-contracts/modular-account-v2/session-keys/adding-session-keys). From 45fcc018ce2fafc7dbb737a9471a739fb15b4378 Mon Sep 17 00:00:00 2001 From: jakehobbs Date: Mon, 1 Jun 2026 13:44:20 -0700 Subject: [PATCH 5/6] Restore Wallet APIs Aave example Keep the Aave recipe on the Wallet APIs path and pair createSmartWalletClient with alchemyWalletTransport. Co-Authored-By: Codex --- .../pages/recipes/smart-wallets-aave.mdx | 44 ++++++++----------- 1 file changed, 18 insertions(+), 26 deletions(-) diff --git a/content/wallets/pages/recipes/smart-wallets-aave.mdx b/content/wallets/pages/recipes/smart-wallets-aave.mdx index 8eef42f0d..a5fad81c9 100644 --- a/content/wallets/pages/recipes/smart-wallets-aave.mdx +++ b/content/wallets/pages/recipes/smart-wallets-aave.mdx @@ -1,15 +1,15 @@ --- -title: Account Kit v4 with Aave +title: Wallet APIs with Aave description: >- - Learn how to build DeFi applications that interact with Aave using Account - Kit v4. This recipe covers supplying and withdrawing assets with both Core - and the v4 wallet client. + Learn how to build DeFi applications that interact with Aave using Alchemy + Wallet APIs. This recipe covers supplying and withdrawing assets with both + Core and Wallets API. slug: wallets/recipes/smart-wallets-aave --- -Learn how to build DeFi applications that interact with Aave using Account Kit v4. This recipe covers supplying and withdrawing assets with both the [`@aa-sdk/core`](https://github.com/alchemyplatform/aa-sdk/tree/v4.x.x/aa-sdk/core) library and the [`@account-kit/wallet-client`](https://github.com/alchemyplatform/aa-sdk/tree/v4.x.x/account-kit/wallet-client) package. +Learn how to build DeFi applications that interact with Aave using Wallet APIs. This recipe covers supplying and withdrawing assets with both the [`@aa-sdk/core`](https://github.com/alchemyplatform/aa-sdk/tree/v4.x.x/aa-sdk/core) library and the [Wallet APIs](/docs/wallets/quickstart) for seamless user experiences. ## Prerequisites @@ -253,25 +253,21 @@ Check out this video walkthrough, and follow along with the quick start below: ``` - - This approach uses the v4 wallet-client API with explicit prepare/sign/send workflow for Aave interactions. + + This approach uses the higher-level wallet-client API with explicit prepare/sign/send workflow for Aave interactions. ```typescript - import { createSmartWalletClient } from "@account-kit/wallet-client"; - import { alchemy, arbitrum } from "@account-kit/infra"; - import { LocalAccountSigner } from "@aa-sdk/core"; - - const signer = LocalAccountSigner.privateKeyToAccountSigner(privateKey); + import { createSmartWalletClient, alchemyWalletTransport } from "@alchemy/wallet-apis"; + import { arbitrum } from "viem/chains"; + import { privateKeyToAccount } from "viem/accounts"; // Setup smart wallet client const smartWalletClient = createSmartWalletClient({ - signer, + signer: privateKeyToAccount(privateKey), chain: arbitrum, - transport: alchemy({ apiKey: alchemyApiKey }), + transport: alchemyWalletTransport({ apiKey: alchemyApiKey }), }); - const account = await smartWalletClient.requestAccount(); - // Get Aave operation data (supply/withdraw) const aaveData = await getAaveOperationData(); // implementation same as Core approach @@ -300,19 +296,15 @@ Check out this video walkthrough, and follow along with the quick start below: // Prepare, sign, and send with gas sponsorship const preparedCalls = await smartWalletClient.prepareCalls({ calls, - from: account.address, capabilities: { - paymasterService: { - policyId, + paymaster: { + policyId: policyId, // Gas sponsorship }, }, }); - const signedCalls = await smartWalletClient.signPreparedCalls(preparedCalls); - const preparedCallIds = await smartWalletClient.sendPreparedCalls(signedCalls); - const result = await smartWalletClient.waitForCallsStatus({ - id: preparedCallIds.preparedCallIds[0]!, - }); + const signedCalls = await smartWalletClient.signPreparedCalls(preparedCalls); // signed by the signer on the client + const result = await smartWalletClient.sendPreparedCalls(signedCalls); console.log( "Aave operation completed! Hash:", @@ -332,7 +324,7 @@ Check out this video walkthrough, and follow along with the quick start below: npm run core:supply # Supply to Aave npm run core:withdraw # Withdraw from Aave - # Wallet client implementation + # Wallet APIs implementation npm run wallet:account # Initialize account npm run wallet:supply # Supply to Aave npm run wallet:withdraw # Withdraw from Aave @@ -352,6 +344,6 @@ You can now interact with Aave protocol through smart wallets with sponsored gas ## Resources * [Aave V3 Documentation](https://docs.aave.com/developers/) -* [`@account-kit/wallet-client` source](https://github.com/alchemyplatform/aa-sdk/tree/v4.x.x/account-kit/wallet-client) +* [Alchemy Wallet APIs Quickstart](/docs/wallets/quickstart) * [Gas Manager Setup](https://www.alchemy.com/docs/setup-a-gas-manager-policy) * [Aave Contract Addresses](https://aave.com/docs/resources/addresses) From ff3c52a6635c8fa3dd08b0076c26d64d9f7d9801 Mon Sep 17 00:00:00 2001 From: jakehobbs Date: Mon, 1 Jun 2026 13:45:51 -0700 Subject: [PATCH 6/6] Clarify session key expiry example Avoid implying Wallet APIs session keys support a configured start time. Co-Authored-By: Codex --- .../pages/authorization/policies/session-key-permissions.mdx | 2 +- .../modular-account-v2/session-keys/session-key-permissions.mdx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/content/wallets/pages/authorization/policies/session-key-permissions.mdx b/content/wallets/pages/authorization/policies/session-key-permissions.mdx index 3cc8b0ca2..57a61ef61 100644 --- a/content/wallets/pages/authorization/policies/session-key-permissions.mdx +++ b/content/wallets/pages/authorization/policies/session-key-permissions.mdx @@ -38,7 +38,7 @@ Permissions are composable. You can apply multiple permissions to a single sessi Example: You could create a session key that: -* Only works during a configured start and expiry time window +* Expires after a configured time * Can call only one staking contract * Spend no more than 100 USDC diff --git a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx index 6620697a0..e3c321fa3 100644 --- a/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx +++ b/content/wallets/pages/smart-contracts/modular-account-v2/session-keys/session-key-permissions.mdx @@ -42,7 +42,7 @@ Permissions are composable. You can apply multiple permissions to a single sessi Example: You could create a session key that: -* Only works during a configured start and expiry time window +* Expires after a configured time * Can call just one staking contract * Spend no more than 100 USDC