> For the complete documentation index, see [llms.txt](/llms.txt).

# Wallet Client actions reference

These actions extend the [Viem Wallet Client](https://viem.sh/docs/clients/wallet) to support [ERC-7710](https://eips.ethereum.org/EIPS/eip-7710) utilities.

## `sendTransactionWithDelegation`[​](#sendtransactionwithdelegation "Direct link to sendtransactionwithdelegation")

Sends a transaction to redeem delegated permissions according to the [ERC-7710](https://eips.ethereum.org/EIPS/eip-7710) specifications.

info

To use `sendTransactionWithDelegation`, the Viem Wallet Client must be extended with `erc7710WalletActions`.

### Parameters[​](#parameters "Direct link to Parameters")

See the [Viem sendTransaction parameters](https://viem.sh/docs/actions/wallet/sendTransaction#parameters). This function has the same parameters, and it also requires the following parameters:

| Name              | Type              | Required | Description                                                                                                                                                                                                                                                |
| ----------------- | ----------------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| delegationManager | Address           | Yes      | The address of the [Delegation Manager](/smart-accounts-kit/development/reference/glossary#delegation-manager)**Delegation Manager** The ERC-7710 component that validates and redeems delegations, including signature checks and caveat enforcer hooks.. |
| permissionContext | PermissionContext | Yes      | An encoded delegation chain (Hex) or a decoded delegation chain (Delegation[]) for redeeming delegations.                                                                                                                                                  |

### Example[​](#example "Direct link to Example")

- example.ts
- client.ts

```
import { walletClient, publicClient } from './client.ts'

// These properties must be extracted from the permission response. See
// `grantPermissions` action to learn how to request permissions.
const permissionContext = permissionsResponse[0].context
const delegationManager = permissionsResponse[0].delegationManager

const hash = walletClient.sendTransactionWithDelegation({
  chain,
  to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
  value: 1n,
  permissionContext,
  delegationManager,
})

```

```
import { http, createPublicClient, createWalletClient } from 'viem'
import { generatePrivateKey, privateKeyToAccount } from 'viem/accounts'
import { sepolia as chain } from 'viem/chains'
import { erc7710WalletActions } from '@metamask/smart-accounts-kit/actions'

export const publicClient = createPublicClient({
  chain,
  transport: http(),
})

// Your session account for requesting and redeeming should be the same.
const privateKey = '0x...'
const account = privateKeyToAccount(privateKey)

const walletClient = createWalletClient({
  account,
  transport: http(),
  chain,
}).extend(erc7710WalletActions())

```

## `redelegatePermissionContext`[​](#redelegatepermissioncontext "Direct link to redelegatepermissioncontext")

Creates a [redelegation](/smart-accounts-kit/development/reference/glossary#redelegation)**Redelegation** A delegation that passes on authority granted by a previous delegation. to a specific [delegate](/smart-accounts-kit/development/reference/glossary#delegate-account)**Delegate account** The account that receives delegated authority and can redeem a delegation under its constraints. from a delegation chain encoded as `Hex` or decoded as [Delegation](/smart-accounts-kit/development/reference/types/#delegation)`[]`.

The action returns [RedelegatePermissionContextReturnType](/smart-accounts-kit/development/reference/types/#redelegatepermissioncontextreturntype).

### Parameters[​](#parameters-1 "Direct link to Parameters")

| Name              | Type                                                                                                  | Required | Description                                                                                                                                                                                                                                                                                                                                           |
| ----------------- | ----------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| environment       | [SmartAccountsEnvironment](/smart-accounts-kit/development/reference/types/#smartaccountsenvironment) | Yes      | Contract addresses for the [Delegation Framework](/smart-accounts-kit/development/reference/glossary#delegation-framework)**Delegation Framework** A set of audited smart contracts that handle smart account creation, the delegation lifecycle, and caveat enforcement. on the target chain.                                                        |
| permissionContext | PermissionContext                                                                                     | Yes      | Encoded delegation chain (Hex) or decoded chain ([Delegation](/smart-accounts-kit/development/reference/types/#delegation)[]), leaf first.                                                                                                                                                                                                            |
| chainId           | number                                                                                                | No       | Chain ID used when signing the delegation.                                                                                                                                                                                                                                                                                                            |
| account           | Account \| Address                                                                                    | No       | Account that signs the redelegation. The default is the Wallet Client's configured account.                                                                                                                                                                                                                                                           |
| scope             | ScopeConfig                                                                                           | No       | [Delegation scope](/smart-accounts-kit/development/reference/glossary#delegation-scope)**Delegation scope** A predefined authority pattern representing a caveat or group of caveats, which sets the initial actions a delegate is allowed to perform. You can combine scopes with additional caveats. to restrict the authority of the redelegation. |
| caveats           | Caveats                                                                                               | No       | Additional [caveats](/smart-accounts-kit/development/reference/glossary#caveat)**Caveat** A restriction attached to a delegation that limits how delegated authority can be used. to restrict the authority of the redelegation. See [caveats reference](/smart-accounts-kit/development/reference/delegation/caveats/).                              |
| salt              | Hex                                                                                                   | No       | Salt for redelegation.                                                                                                                                                                                                                                                                                                                                |
| to                | Address                                                                                               | Yes      | Address of the delegate for the redelegation.                                                                                                                                                                                                                                                                                                         |

### Example[​](#example-1 "Direct link to Example")

- example.ts
- client.ts

```
import { walletClient, publicClient, environment } from './client.ts'

// These properties must be extracted from the permission response. See
// `grantPermissions` action to learn how to request permissions.
const permissionContext = permissionsResponse[0].context

const { permissionContext: redelegatedPermissionContext } =
  walletClient.redelegatePermissionContext({
    to: 'DELEGATE_ADDRESS',
    environment,
    permissionContext: permissionContext,
  })

```

```
import { http, createWalletClient } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { sepolia as chain } from 'viem/chains'
import { getSmartAccountsEnvironment } from '@metamask/smart-accounts-kit'
import { erc7710WalletActions } from '@metamask/smart-accounts-kit/actions'

// Your session account for requesting and redelegating should be the same.
const privateKey = '0x...'
const account = privateKeyToAccount(privateKey)

export const environment = getSmartAccountsEnvironment(chain.id)

const walletClient = createWalletClient({
  account,
  transport: http(),
  chain,
}).extend(erc7710WalletActions())

```

## `redelegatePermissionContextOpen`[​](#redelegatepermissioncontextopen "Direct link to redelegatepermissioncontextopen")

Creates an [open redelegation](/smart-accounts-kit/development/reference/glossary#open-redelegation)**Open redelegation** A redelegation with no specific delegate, allowing any account to redeem inherited permissions. from a delegation chain encoded as `Hex` or decoded as [Delegation](/smart-accounts-kit/development/reference/types/#delegation)`[]`. This allows any account to redeem the inherited permissions.

The action returns [RedelegatePermissionContextReturnType](/smart-accounts-kit/development/reference/types/#redelegatepermissioncontextreturntype).

### Parameters[​](#parameters-2 "Direct link to Parameters")

| Name              | Type                                                                                                  | Required | Description                                                                                                                                                                                                                                                                                                                                           |
| ----------------- | ----------------------------------------------------------------------------------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| environment       | [SmartAccountsEnvironment](/smart-accounts-kit/development/reference/types/#smartaccountsenvironment) | Yes      | Contract addresses for the [Delegation Framework](/smart-accounts-kit/development/reference/glossary#delegation-framework)**Delegation Framework** A set of audited smart contracts that handle smart account creation, the delegation lifecycle, and caveat enforcement. on the target chain.                                                        |
| permissionContext | PermissionContext                                                                                     | Yes      | Encoded delegation chain (Hex) or decoded chain ([Delegation](/smart-accounts-kit/development/reference/types/#delegation)[]), leaf first.                                                                                                                                                                                                            |
| chainId           | number                                                                                                | No       | Chain ID used when signing the delegation.                                                                                                                                                                                                                                                                                                            |
| account           | Account \| Address                                                                                    | No       | Account that signs the redelegation. The default is the Wallet Client's configured account.                                                                                                                                                                                                                                                           |
| scope             | ScopeConfig                                                                                           | No       | [Delegation scope](/smart-accounts-kit/development/reference/glossary#delegation-scope)**Delegation scope** A predefined authority pattern representing a caveat or group of caveats, which sets the initial actions a delegate is allowed to perform. You can combine scopes with additional caveats. to restrict the authority of the redelegation. |
| caveats           | Caveats                                                                                               | No       | Additional [caveats](/smart-accounts-kit/development/reference/glossary#caveat)**Caveat** A restriction attached to a delegation that limits how delegated authority can be used. to restrict the authority of the redelegation. See [caveats reference](/smart-accounts-kit/development/reference/delegation/caveats/).                              |
| salt              | Hex                                                                                                   | No       | Salt for redelegation.                                                                                                                                                                                                                                                                                                                                |

### Example[​](#example-2 "Direct link to Example")

- example.ts
- client.ts

```
import { walletClient, publicClient, environment } from './client.ts'

// These properties must be extracted from the permission response. See
// `grantPermissions` action to learn how to request permissions.
const permissionContext = permissionsResponse[0].context

const { permissionContext: redelegatedPermissionContext } =
  walletClient.redelegatePermissionContextOpen({
    environment,
    permissionContext: permissionContext,
  })

```

```
import { http, createWalletClient } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'
import { sepolia as chain } from 'viem/chains'
import { getSmartAccountsEnvironment } from '@metamask/smart-accounts-kit'
import { erc7710WalletActions } from '@metamask/smart-accounts-kit/actions'

// Your session account for requesting and redelegating should be the same.
const privateKey = '0x...'
const account = privateKeyToAccount(privateKey)

export const environment = getSmartAccountsEnvironment(chain.id)

const walletClient = createWalletClient({
  account,
  transport: http(),
  chain,
}).extend(erc7710WalletActions())

```
