# `confirmSafeOperation`

Adds a confirmation for a Safe operation. Once enough confirmations are collected, the Safe operation needs to be executed via the `executeTransaction` method from the `Safe4337Pack`.

<Callout type="info" emoji="ℹ️">
The SafeOperations methods are currently compatible with Entrypoint v0.6, which corresponds to `safeModuleVersion` v0.2.0. If you need to use v0.7, you should use the `relay-kit` `Safe4337Pack` class with `safeModuleVersion` v0.3.0, and collect the signatures yourself.

Examples of how to use the `Safe4337Pack` are provided in the following links:
- [Playgrounds](https://github.com/safe-global/safe-core-sdk/tree/main/playground/relay-kit)
- [Guide](https://docs.safe.global/sdk/relay-kit/guides/4337-safe-sdk)
</Callout>

## Usage


<Tabs items={['example.ts', 'setup.ts']}>
  <Tabs.Tab>
    ```typescript
    import { apiKit } from './setup.ts'

    const safeOperationHash = '0x...'
    
    const signature = '0x...'

    await apiKit.confirmSafeOperation(safeOperationHash, signature)
    ```
  </Tabs.Tab>
  <Tabs.Tab>
    ```typescript
    import SafeApiKit from '@safe-global/api-kit'

    // How to get an Api key => http://docs.safe.global/core-api/how-to-use-api-keys
    export const apiKit = new SafeApiKit({
      chainId: 1n, // Mainnet
      apiKey: 'YOUR_API_KEY'
    })
    ```
  </Tabs.Tab>
</Tabs>


## Parameters

### `safeOperationHash`

- **Type:** `string`

The hash of the Safe operation that will be confirmed.

```typescript focus=2
await apiKit.confirmSafeOperation(
  '0x...',
  '0x...'
)
```

### `signature`

- **Type:** `string`

The signature of the Safe operation.

It can be obtained by calling the `getSignature` method from the `SafeOperation` object.

```typescript focus=3
await apiKit.confirmSafeOperation(
  '0x...',
  '0x...'
)
```
