Skip to content

Latest commit

 

History

History
60 lines (41 loc) · 1.4 KB

getsafeoperation.mdx

File metadata and controls

60 lines (41 loc) · 1.4 KB

import { Tabs, Callout } from 'nextra/components'

getSafeOperation

Returns a Safe operation by its hash.

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:

Usage

{/* */}

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

const safeOperationHash = '0x...'

const safeOperation = await apiKit.getSafeOperation(safeOperationHash)
```

</Tabs.Tab> <Tabs.Tab> ```typescript import SafeApiKit from '@safe-global/api-kit'

export const apiKit = new SafeApiKit({
  chainId: 1n, // Mainnet
})
```

</Tabs.Tab>

{/* */}

Returns

Promise<SafeOperationResponse>

The Safe operation.

Parameters

safeOperationHash

  • Type: string

The Safe operation hash.

const safeOperation = await apiKit.getSafeOperation(
  '0x...'
)