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

# Wallet Client actions reference

The following actions are related to the [Viem Wallet Client](https://viem.sh/docs/clients/wallet) used to [execute on a MetaMask user's behalf](/smart-accounts-kit/development/guides/advanced-permissions/execute-on-metamask-users-behalf/).

info

To use Advanced Permissions (ERC-7715) actions, the Viem Wallet Client must be extended with `erc7715ProviderActions`.

## `requestExecutionPermissions`[​](#requestexecutionpermissions "Direct link to requestexecutionpermissions")

Requests [Advanced Permissions](/smart-accounts-kit/development/reference/glossary#advanced-permissions)**Advanced Permissions** Fine-grained, wallet execution permissions that dapps can request from MetaMask extension users. Based on ERC-7715. from the MetaMask extension account according to the [ERC-7715](https://eips.ethereum.org/EIPS/eip-7715) specification. Returns a [RequestExecutionPermissionsReturnType](/smart-accounts-kit/development/reference/types/#requestexecutionpermissionsreturntype).

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

| Name       | Type                      | Required | Description                                                                                                                                                                                                                                                 |
| ---------- | ------------------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| chainId    | number                    | Yes      | The chain ID on which the permission is being requested.                                                                                                                                                                                                    |
| from       | Address                   | No       | The wallet address to request the permission from.                                                                                                                                                                                                          |
| expiry     | number                    | Yes      | The timestamp (in seconds) by which the permission must expire.                                                                                                                                                                                             |
| permission | SupportedPermissionParams | Yes      | The permission to request. The toolkit supports multiple [Advanced Permissions types](/smart-accounts-kit/development/reference/advanced-permissions/permissions/). Set isAdjustmentAllowed to define whether the user can modify the requested permission. |
| to         | Address                   | Yes      | The account to which the permission will be assigned.                                                                                                                                                                                                       |

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

- example.ts
- client.ts

```
import { sepolia as chain } from 'viem/chains'
import { parseUnits } from 'viem'
import { walletClient } from './client.ts'

const currentTime = Math.floor(Date.now() / 1000)
const expiry = currentTime + 604800

const grantedPermissions = await walletClient.requestExecutionPermissions([
  {
    chainId: chain.id,
    expiry,
    // The requested permissions will be granted to the
    // session account.
    to: sessionAccount.address,
    permission: {
      type: 'erc20-token-periodic',
      data: {
        tokenAddress: '0x1c7D4B196Cb0C7B01d743Fbc6116a902379C7238',
        periodAmount: parseUnits('10', 6),
        periodDuration: 86400,
        justification: 'Permission to transfer 10 USDC every day',
      },
      isAdjustmentAllowed: true,
    },
  },
])

```

```
import { createWalletClient, custom } from 'viem'
import { erc7715ProviderActions } from '@metamask/smart-accounts-kit/actions'

export const walletClient = createWalletClient({
  transport: custom(window.ethereum),
}).extend(erc7715ProviderActions())

```

## `getSupportedExecutionPermissions`[​](#getsupportedexecutionpermissions "Direct link to getsupportedexecutionpermissions")

Returns the [Advanced Permissions](/smart-accounts-kit/development/reference/glossary#advanced-permissions)**Advanced Permissions** Fine-grained, wallet execution permissions that dapps can request from MetaMask extension users. Based on ERC-7715. types that the wallet supports, according to the [ERC-7715](https://eips.ethereum.org/EIPS/eip-7715)specification. Use this to verify the available permission types and supported chains before requesting permissions.

This action takes no parameters and returns a [GetSupportedExecutionPermissionsResult](/smart-accounts-kit/development/reference/types/#getsupportedexecutionpermissionsresult).

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

- response.ts
- example.ts
- client.ts

```
{
  "native-token-stream": {
    "chainIds": [1, 10],
    "ruleTypes": ["expiry"]
  },
  "erc20-token-periodic": {
    "chainIds": [1, 137],
    "ruleTypes": ["expiry"]
  },
// ...
}

```

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

const supportedPermissions = await walletClient.getSupportedExecutionPermissions()

```

```
import { createWalletClient, custom } from 'viem'
import { erc7715ProviderActions } from '@metamask/smart-accounts-kit/actions'

export const walletClient = createWalletClient({
  transport: custom(window.ethereum),
}).extend(erc7715ProviderActions())

```

## `getGrantedExecutionPermissions`[​](#getgrantedexecutionpermissions "Direct link to getgrantedexecutionpermissions")

Returns all previously granted permissions for the connected wallet, according to the [ERC-7715](https://eips.ethereum.org/EIPS/eip-7715) specification.

This action takes no parameters and returns a [GetGrantedExecutionPermissionsResult](/smart-accounts-kit/development/reference/types/#getgrantedexecutionpermissionsresult).

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

- response.ts
- example.ts
- client.ts

```
[
  {
    chainId: 84532,
    context: "0x0000...0000",
    delegationManager: "0xdb9B...7dB3",
    dependencies: [],
    from: "0x993f...7f31",
    permission: {
      type: "erc20-token-periodic",
      isAdjustmentAllowed: false,
      data: { ... },
    },
    rules: [
      { type: "expiry", data: { ... } },
    ],
    to: "0xAB57...7F1f",
  },
// ...
]

```

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

const grantedPermissions = await walletClient.getGrantedExecutionPermissions()

```

```
import { createWalletClient, custom } from 'viem'
import { erc7715ProviderActions } from '@metamask/smart-accounts-kit/actions'

export const walletClient = createWalletClient({
  transport: custom(window.ethereum),
}).extend(erc7715ProviderActions())

```
