# buildSessionKeysToRemoveStruct | @account-kit/smart-contracts

> Overview of the buildSessionKeysToRemoveStruct function from @account-kit/smart-contracts

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

{/* This file is auto-generated by TypeDoc. Do not edit manually. */}

```ts
function buildSessionKeysToRemoveStruct<TTransport, TChain, TAccount>(
  client,
  args,
): Promise<object[]>;
```

Defined in: [account-kit/smart-contracts/src/msca/plugins/session-key/utils.ts:33](https://github.com/alchemyplatform/aa-sdk/blob/main/account-kit/smart-contracts/src/msca/plugins/session-key/utils.ts#L33)

Finds predecessors for each provided key and returns them in the struct `ISessionKeyPlugin.SessionKeyToRemove[]`.

## Example

```ts
import { buildSessionKeysToRemoveStruct } from "@account-kit/smart-contracts";

const client = createSmartAccountClient(...);

const keysToRemove = await buildSessionKeysToRemoveStruct(client, {
 keys: ["0x...", "0x..."],
});
```

## Type Parameters

<table>
  <thead>
    <tr>
      <th align="left">Type Parameter</th>
      <th align="left">Default type</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `TTransport` *extends* [`Transport`](https://viem.sh)
      </td>

      <td>
        [`Transport`](https://viem.sh)
      </td>
    </tr>

    <tr>
      <td>
        `TChain` *extends* `undefined` | [`Chain`](https://viem.sh)
      </td>

      <td>
        `undefined` | [`Chain`](https://viem.sh)
      </td>
    </tr>

    <tr>
      <td>
        `TAccount` *extends* `undefined` | `SmartContractAccount`
      </td>

      <td>
        `undefined` | `SmartContractAccount`
      </td>
    </tr>

  </tbody>
</table>

## Parameters

<table>
  <thead>
    <tr>
      <th align="left">Parameter</th>
      <th align="left">Type</th>
      <th align="left">Description</th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        `client`
      </td>

      <td>
        [`Client`](https://viem.sh)\<`TTransport`, `TChain`, `TAccount`>
      </td>

      <td>
        The client instance used to interact with the smart account
      </td>
    </tr>

    <tr>
      <td>
        `args`
      </td>

      <td>
        `BuildSessionKeysToRemoveStructParams`
      </td>

      <td>
        Arguments to configure the session key removal process
      </td>
    </tr>

  </tbody>
</table>

## Returns

`Promise`\<`object`\[]>

A promise that resolves to an array of objects each containing a session key and its predecessor