> ## Documentation Index
> Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# How to use Dynamic with Particle Network's EIP-7702 Universal Account

> Pair Dynamic embedded wallets with Particle Universal Accounts in EIP-7702 mode using the JavaScript SDK: sign delegations and inline authorizations when JSON-RPC wallets cannot.

## Overview

This guide explains how to use **Dynamic embedded wallets** with **[Particle Universal Accounts](https://developers.particle.network/universal-accounts)** in **EIP-7702 mode**, using the **JavaScript SDK**. In that mode, the user keeps the same EOA address while delegating execution to Particle's Universal Account contract via a Type-4 transaction — Particle's docs describe the model in [EIP-7702 compatible embedded wallets](https://developers.particle.network/universal-accounts/ua-reference/desktop/eip-7702-wallets).

Universal Accounts provide users with a single account and balance that works across any chain, eliminating the need to manage multiple wallets or manually bridge assets. Particle Network's infrastructure handles all cross-chain liquidity routing and bridging behind the scenes, making the entire Web3 ecosystem feel like one unified network. Developers can easily integrate them via the Universal SDK, with built-in support for social logins, wallet connections, and gasless cross-chain transactions.

[EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) uses an `authorizationList` on the transaction; each authorization must be signed by the EOA key. Standard JSON-RPC wallets (for example MetaMask or Rabby) typically **do not** expose what you need, so **Particle documents embedded signers** for this path — including Dynamic.

**Dynamic's embedded wallets expose a viem `WalletClient`**, and viem's `walletClient.signAuthorization()` can sign for **any** contract address — so your app can satisfy Particle's delegation and inline-auth steps. This is different from Dynamic's own [`sign7702Authorization`](https://docs.dynamic.xyz/docs/javascript/reference/evm/managing-7702-delegation#sign7702authorization) helper, which is hardcoded to Dynamic's gasless delegation contract and **cannot** target Particle's Universal Account contract. Use the setup below together with Particle's Universal Account SDK.

> [!WARNING]
>
> **Particle's EIP-7702 Universal Account mode expects an embedded wallet that can sign EIP-7702 authorizations.** External wallets generally do not implement `signAuthorization` on the user's EOA. If you must support only external wallets with Particle, use the account mode their docs describe for JSON-RPC wallets instead of strict EIP-7702 delegation from that EOA.

## Setup

> [!NOTE]
>
> **What you need to know:** Before this, create and initialize a Dynamic client (see [Creating a Dynamic Client](https://docs.dynamic.xyz/docs/javascript/reference/client/create-dynamic-client.md), [Initializing the Dynamic Client](https://docs.dynamic.xyz/docs/javascript/reference/client/initialize-dynamic-client.md)) and register the WaaS EVM extension so the client provisions an embedded EVM wallet.

| Piece | Role |
| - | - |
| **`@dynamic-labs-sdk/client`** + **`@dynamic-labs-sdk/evm`** (add **`@dynamic-labs-sdk/react-hooks`** in React) | Auth and the embedded EVM wallet account |
| **`@dynamic-labs-sdk/evm/viem`** — `createWalletClientForWalletAccount()` | Viem `WalletClient` for the embedded wallet, exposing `walletClient.signAuthorization({ address, chainId, nonce })` |
| **`@particle-network/universal-account-sdk`** | Universal Account client: delegation status, auth parameters, routing, and `sendTransaction` |
| **ethers v6** | Serialize authorizations (for example `Signature.from()` on the object viem returns) if the SDK version you use expects that shape |
| **viem `walletClient`** | Send the Type-4 delegation transaction with `authorizationList` |

Get the embedded wallet with `isEvmWalletAccount()`, then create its viem wallet client:

> [tab] JavaScript
>
> ```javascript theme={"system"}
> import { getWalletAccounts } from '@dynamic-labs-sdk/client';
> import { isEvmWalletAccount } from '@dynamic-labs-sdk/evm';
> import { createWalletClientForWalletAccount } from '@dynamic-labs-sdk/evm/viem';
>
> const getEmbeddedWalletClient = async () => {
>   const walletAccounts = getWalletAccounts();
>   const walletAccount = walletAccounts.find(isEvmWalletAccount);
>
>   if (!walletAccount) {
>     throw new Error('No embedded EVM wallet account found');
>   }
>
>   return createWalletClientForWalletAccount({ walletAccount });
> };
> ```

> [tab] React
>
> ```tsx theme={"system"}
> import { isEvmWalletAccount } from '@dynamic-labs-sdk/evm';
> import { createWalletClientForWalletAccount } from '@dynamic-labs-sdk/evm/viem';
> import { useGetWalletAccounts } from '@dynamic-labs-sdk/react-hooks';
>
> function useEmbeddedWalletClient() {
>   const { data: walletAccounts = [] } = useGetWalletAccounts();
>   const walletAccount = walletAccounts.find(isEvmWalletAccount);
>
>   const getWalletClient = async () => {
>     if (!walletAccount) throw new Error('No embedded EVM wallet account found');
>     return createWalletClientForWalletAccount({ walletAccount });
>   };
>
>   return { walletAccount, getWalletClient };
> }
> ```

See [Getting a Viem WalletClient](https://docs.dynamic.xyz/docs/javascript/reference/evm/getting-viem-wallet-client.md) and [Checking EVM Wallet Account Type](https://docs.dynamic.xyz/docs/javascript/reference/evm/checking-evm-wallet-account-type.md) for more on both functions.

## Delegation flow with Universal Accounts

Particle's client drives status, auth parameters, and broadcast; your embedded wallet's viem client signs. The shape usually matches:

1. **Check status** — Universal Account client (for example `getEIP7702Deployments()`).
2. **Fetch auth parameters** — Per chain from the client (for example `getEIP7702Auth([chainId])`), which returns the Universal Account contract `address` to delegate to.
3. **Sign** — `walletClient.signAuthorization({ address, chainId, nonce })` on the viem wallet client for the embedded wallet (see [Setup](#setup)). Pass Particle's contract `address` here — Dynamic's `sign7702Authorization` cannot be used, since it only targets Dynamic's own gasless delegation contract.
4. **Broadcast** — Type-4 transaction with `authorizationList` (often via `walletClient.sendTransaction`).
5. **Later steps** — Particle may require a `rootHash` or message signature via normal signing, then `sendTransaction` on the Universal Account client.

Signing (step 3) reuses the wallet client from [Setup](#setup):

> [tab] JavaScript
>
> ```javascript theme={"system"}
> const walletClient = await getEmbeddedWalletClient();
>
> // address, chainId, and nonce come from Particle's getEIP7702Auth()
> const authorization = await walletClient.signAuthorization({
>   address,
>   chainId,
>   nonce,
> });
> ```

> [tab] React
>
> ```tsx theme={"system"}
> const { getWalletClient } = useEmbeddedWalletClient();
>
> const walletClient = await getWalletClient();
>
> // address, chainId, and nonce come from Particle's getEIP7702Auth()
> const authorization = await walletClient.signAuthorization({
>   address,
>   chainId,
>   nonce,
> });
> ```

Steps 3 and 4 require an embedded EVM wallet. Confirm with `isEvmWalletAccount()`. Method names on the Particle side follow [their reference](https://developers.particle.network/universal-accounts/ua-reference/desktop/eip-7702-wallets).

## Inline authorizations on later transactions

After delegation, Universal Account transactions can include **pending EIP-7702 authorizations** on individual user operations. Sign each with the same viem wallet client's `signAuthorization`, serialize as your integration expects (for example `ethers` `Signature.from()`), and pass them into Particle's `sendTransaction` flow along with the `rootHash` signature. The demo in the next section does this for a cross-chain convert.

## Reference demo: Next.js, Dynamic, and Particle

The open-source app **[ua-dynamic-7702](https://github.com/soos3d/ua-dynamic-7702)** implements Dynamic embedded wallet login, EIP-7702 delegation on Arbitrum, and a cross-chain convert with Particle's Universal Account SDK. Use it as the working reference for:

* **Network** — Switching to the chain used for delegation before sending the Type-4 transaction
* **Signature shape** — Using `ethers` `Signature.from()` when the downstream SDK expects serialized authorizations
* **Provider edge cases** — The repo documents a **`getSigner()` / `account` workaround** in `hooks/universal-account-provider.tsx` for their Universal Account integration

> [!NOTE]
>
> The demo repo predates the JavaScript SDK and signs with the React SDK's WaaS connector (`isDynamicWaasConnector()` + `signAuthorization()`). Porting it: replace that connector check with `isEvmWalletAccount()`, get a viem wallet client with `createWalletClientForWalletAccount()` (see [Setup](#setup)), and call `walletClient.signAuthorization()` in its place. The Particle Universal Account client calls, ethers serialization, and provider workaround stay the same.

**Dependencies and env vars** — Match the [stack table](#setup); use the demo `package.json`, lockfile, and README for exact versions and `.env.local` keys, swapping the Dynamic packages for `@dynamic-labs-sdk/client`, `@dynamic-labs-sdk/evm`, and (in React) `@dynamic-labs-sdk/react-hooks`.

> [card] [ua-dynamic-7702 on GitHub](https://github.com/soos3d/ua-dynamic-7702)
>
> Next.js demo: Dynamic embedded wallet, EIP-7702 delegation, and Universal Accounts cross-chain convert.

For the full Particle-side API and provider comparison, see [EIP-7702 compatible embedded wallets](https://developers.particle.network/universal-accounts/ua-reference/desktop/eip-7702-wallets).

## Related

* [Getting a Viem WalletClient](https://docs.dynamic.xyz/docs/javascript/reference/evm/getting-viem-wallet-client.md)
* [Checking EVM Wallet Account Type](https://docs.dynamic.xyz/docs/javascript/reference/evm/checking-evm-wallet-account-type.md)
* [Managing EIP-7702 delegation](https://docs.dynamic.xyz/docs/javascript/reference/evm/managing-7702-delegation.md) — Dynamic's own gasless delegation contract, for contrast with Particle's
* [React Quickstart (JS SDK)](https://docs.dynamic.xyz/docs/javascript/reference/react-quickstart.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.