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

# Gas sponsorship & smart wallets

> The React SDK exposed smart accounts through useSmartWallets and configured gas sponsorship behind the widget. In the JavaScript SDK smart wallets come from the ZeroDev extension and gas sponsorship is a set of EVM functions you call.

The React SDK grouped account abstraction under a single `useSmartWallets()` hook, created the smart account for you, and only ever *displayed* the smart wallet (and its underlying signer) inside the widget — there were no dedicated smart-wallet screens. The JavaScript SDK makes account abstraction explicit: you enable it with the ZeroDev extension, build user operations yourself, and sponsor gas with EVM functions.

## Enabling smart wallets

`useSmartWallets()` becomes the ZeroDev extension. Register it once when you configure the client (alongside your chain extensions); it adds the smart-wallet provider so accounts and user operations are available. See [Adding the ZeroDev extension](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/adding-zerodev-extension.md) for the full setup, and [ZeroDev → native gas sponsorship](https://docs.dynamic.xyz/docs/get-started/migrations/zerodev-to-native-gas-sponsorship.md) if you're moving off a previous ZeroDev integration.

```typescript theme={"system"}
import { addZerodevExtension } from '@dynamic-labs-sdk/zerodev';

// client: your created DynamicClient — register alongside your other extensions
addZerodevExtension(client);
```

In React, register the extension before rendering `DynamicProvider` — the call is the same.

## Smart account and its signer

| React SDK (`useSmartWallets()`) | JavaScript SDK |
| - | - |
| the smart account client | `createKernelClientForWalletAccount()` (`@dynamic-labs-sdk/zerodev`) |
| `getEOAWallet()` (owner signer) | `getOwnerWalletAccountForSmartWalletAccount()` (`@dynamic-labs-sdk/client`) |

`getOwnerWalletAccountForSmartWalletAccount({ smartWalletAccount })` returns the `WalletAccount` that signs for a smart wallet — use it to show the smart wallet address alongside its owner, the one display the widget used to render.

```typescript theme={"system"}
import { getOwnerWalletAccountForSmartWalletAccount } from '@dynamic-labs-sdk/client';
import { createKernelClientForWalletAccount } from '@dynamic-labs-sdk/zerodev';

// smartWalletAccount: a WalletAccount from getWalletAccounts()
const owner = getOwnerWalletAccountForSmartWalletAccount({
  smartWalletAccount,
});

const kernelClient = await createKernelClientForWalletAccount({
  smartWalletAccount,
});
```

In React, read the wallet list with `useGetWalletAccounts()` and pass the smart wallet into these same functions.

## Sponsoring gas

Sponsorship is explicit and lives in the chain packages. On EVM you check whether it's enabled and send a sponsored transaction; with ZeroDev smart wallets you send a user operation and let the paymaster cover gas.

| Path | JavaScript SDK |
| - | - |
| EVM sponsored transfer | `isEvmGasSponsorshipEnabled()`, `sendSponsoredTransaction()`, `getEVMSponsoredTransactionStatus()` (`@dynamic-labs-sdk/evm`) |
| EIP-7702 delegation | `sign7702Authorization()`, `activate7702Delegation()`, `is7702DelegationActive()` (`@dynamic-labs-sdk/evm`) |
| ZeroDev user operation | `canSponsorUserOperation()`, `sendUserOperation()`, `simulateZerodevUserOperation()` (`@dynamic-labs-sdk/zerodev`) |

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

// walletAccount: the WalletAccount to send from
if (isEvmGasSponsorshipEnabled()) {
  const { transactionHash } = await sendSponsoredTransaction({
    walletAccount,
    calls,
  });
}
```

There's no dedicated React hook — gas sponsorship is configured via extensions, so call these functions directly from your transaction handler.

Before sending, `canSponsorUserOperation()` (ZeroDev) and `isEvmGasSponsorshipEnabled()` (EVM) let you decide whether to offer a gasless path or fall back to the user paying — and `estimateUserOperationGas()` / `calculateFeeForUserOperation()` give you the numbers to show.

## What you now build

Smart wallets and sponsorship are configured through extensions and console settings — there is no smart-wallet UI to migrate. What you build is:

* **The smart-wallet display** — showing the smart account address and its owner signer.
* **Sponsored vs. self-paid choice** — using the `canSponsor` / `isEnabled` checks to decide what to offer.
* **Transaction confirmation** — sponsored and user-operation transactions confirm through the same confirmation UI you build for any transaction: [**Transaction confirmation & simulation** (Building UI)](https://docs.dynamic.xyz/docs/javascript/building-ui/transaction-confirmation.md).

## Errors you now own

| Error / situation | What to do |
| - | - |
| `EvmGasSponsorshipNotEnabledError` | Sponsorship isn't configured for this project/chain — fall back to the user paying gas. |
| `SponsorTransactionError` | The sponsored send failed — surface the reason and offer a self-paid retry. |
| `isGasSponsorshipError(error)` is true | A ZeroDev user operation couldn't be sponsored — check `canSponsorUserOperation()` and fall back. |

## Reference

Each function above has a dedicated reference page:

* **ZeroDev smart wallets** — [Adding the extension](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/adding-zerodev-extension.md) · [Create kernel client](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/create-kernel-client-for-wallet-account.md) · [Get smart-wallet signer](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/get-signer-for-smart-wallet-account.md)
* **Sponsoring user operations** — [Can sponsor](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/can-sponsor-user-operation.md) · [Send user operation](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/send-user-operation.md) · [Simulate](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/simulate-zerodev-user-operation.md) · [Estimate gas](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/estimate-user-operation-gas.md) · [Calculate fee](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/calculate-fee-for-user-operation.md) · [Gas-sponsorship quickstart](https://docs.dynamic.xyz/docs/javascript/reference/zerodev/gas-sponsorship-quickstart.md)
* **EVM gas sponsorship** — [Overview](https://docs.dynamic.xyz/docs/javascript/reference/evm/evm-gas-sponsorship.md) · [Send sponsored transaction](https://docs.dynamic.xyz/docs/javascript/reference/evm/send-sponsored-transaction.md) · [Managing EIP-7702 delegation](https://docs.dynamic.xyz/docs/javascript/reference/evm/managing-7702-delegation.md)

## See also

* [Transaction confirmation & simulation (Building UI)](https://docs.dynamic.xyz/docs/javascript/building-ui/transaction-confirmation.md) — confirm sponsored and user-operation transactions
* [Integrating chains](https://docs.dynamic.xyz/docs/javascript/migrating-from-react/integrating-chains.md) — register the extensions that enable smart wallets
* [Transactions & balance](https://docs.dynamic.xyz/docs/javascript/migrating-from-react/transactions-and-balance.md) — send and read transactions


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