> ## 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.

# Managing EIP-7702 delegation

> Check, sign, and activate the one-time EIP-7702 delegation that powers gas-sponsored EVM transactions.

Before a wallet can send a [gas-sponsored transaction](https://docs.dynamic.xyz/docs/javascript/reference/evm/evm-gas-sponsorship.md), its EOA must be delegated — once — to the Dynamic delegation contract via an EIP-7702 authorization. That delegation is what lets a relayer submit a batch of calls on the user's behalf.

> [!NOTE]
>
> You usually don't need any of this. When [`sendSponsoredTransaction`](https://docs.dynamic.xyz/docs/javascript/reference/evm/send-sponsored-transaction) runs on a wallet that isn't delegated yet, the SDK signs the EIP-7702 authorization automatically and attaches it to the first call. The functions below exist for when you want **explicit control** over the delegation step — for example, activating it during onboarding.

## is7702DelegationActive

Checks whether delegation to the Dynamic gasless contract is active for a wallet on its current network. Results are cached per wallet + chain in an in-memory registry, so repeated calls are cheap.

```javascript theme={"system"}
import { is7702DelegationActive } from '@dynamic-labs-sdk/evm';

const isActive = await is7702DelegationActive({ walletAccount });
```

### Parameters

| Parameter | Type | Description |
| - | - | - |
| `walletAccount` | `EvmWalletAccount` | The wallet to check delegation status for. |

### Returns

`Promise<boolean>` — `true` if the wallet has an active delegation to the Dynamic gasless contract on its current network.

## sign7702Authorization

Signs an EIP-7702 authorization delegating the wallet to the Dynamic delegation contract. The signed authorization can be attached to a sponsored transaction to activate delegation on-chain. If no `chainId` is provided, the wallet's active network is used.

```javascript theme={"system"}
import {
  sign7702Authorization,
  sendSponsoredTransaction,
} from '@dynamic-labs-sdk/evm';

const authorization = await sign7702Authorization({ walletAccount });

const { transactionHash } = await sendSponsoredTransaction({
  walletAccount,
  calls,
  authorization,
});
```

### Parameters

| Parameter | Type | Description |
| - | - | - |
| `walletAccount` | `EvmWalletAccount` | The wallet to sign the authorization for. |
| `chainId` | `number` (optional) | Override chain ID. Defaults to the wallet's active network. |

### Returns

`Promise<SignAuthorizationReturnType>` — viem's signed EIP-7702 authorization. Pass it to [`signSponsoredTransaction`](https://docs.dynamic.xyz/docs/javascript/reference/evm/splitting-sign-and-send#signsponsoredtransaction), [`sendSponsoredTransaction`](https://docs.dynamic.xyz/docs/javascript/reference/evm/send-sponsored-transaction), or [`activate7702Delegation`](#activate7702delegation).

## activate7702Delegation

Persists the delegation on-chain up-front, before any user-facing transaction — useful during onboarding. It sends a sponsored transaction that carries **only** the EIP-7702 authorization (an empty batch of calls) and returns the transaction hash. Afterwards, sponsored transactions no longer need to include an authorization.

```javascript theme={"system"}
import {
  activate7702Delegation,
  is7702DelegationActive,
} from '@dynamic-labs-sdk/evm';

if (!(await is7702DelegationActive({ walletAccount }))) {
  const { transactionHash } = await activate7702Delegation({ walletAccount });
  console.log('Delegation activated:', transactionHash);
}
```

### Parameters

| Parameter | Type | Description |
| - | - | - |
| `walletAccount` | `EvmWalletAccount` | The wallet to activate delegation for. |
| `authorization` | `SignAuthorizationReturnType` (optional) | A pre-signed authorization (from [`sign7702Authorization`](#sign7702authorization)). If omitted, one is signed automatically. |

### Returns

`Promise<{ transactionHash: Hex }>` — the on-chain transaction hash of the activation. Throws a `SponsorTransactionError` if the relay fails or times out.

## Related functions

* [sendSponsoredTransaction](https://docs.dynamic.xyz/docs/javascript/reference/evm/send-sponsored-transaction.md) — handles delegation automatically on the first send
* [Splitting sign & send](https://docs.dynamic.xyz/docs/javascript/reference/evm/splitting-sign-and-send.md) — pre-sign and relay intents separately
* [EVM Gas Sponsorship overview](https://docs.dynamic.xyz/docs/javascript/reference/evm/evm-gas-sponsorship.md) — setup and the common path


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