getSafeOperationsByAddress
Returns the list of Safe operations associated to a Safe account.
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
_13import { GetSafeOperationListProps } from '@safe-global/api-kit'_13import { apiKit } from './setup.ts'_13_13const safeAddress = '0x...'_13const options: GetSafeOperationListOptions = { _13 executed: false, // Optional,_13 hasConfirmations: true, // Optional,_13 ordering: 'created', // Optional _13 limit: '10', // Optional_13 offset: '50' // Optional_13}_13_13const safeOperationsResponse = await apiKit.getSafeOperationsByAddress(safeAddress, options)
Returns
Promise<GetSafeOperationListResponse>
The paginated list of Safe operations.
Parameters
safeAddress
- Type:
string
The Safe address.
_10const safeOperationsResponse = await apiKit.getSafeOperationsByAddress({_10 safeAddress: '0x...'_10})
options.executed
(Optional)
- Type:
boolean
When true
it will return the Safe operations whose associated User Operation was already executed in the bundler.
When false
it will return the Safe operations that are pending to execute.
If omitted, it will return all the Safe operations.
_10const safeOperationsResponse = await apiKit.getSafeOperationsByAddress(_10 {_10 safeAddress: '0x...',_10 executed: true,_10 ordering: 'created'_10 }_10)
options.hasConfirmations
(Optional)
- Type:
string
When true
it will return the Safe operations that have confirmations from any owner.
When false
it will return the Safe operations that don't have confirmations.
If omitted, it will return all the Safe operations.
_10const safeOperationsResponse = await apiKit.getSafeOperationsByAddress(_10 {_10 safeAddress: '0x...',_10 hasConfirmations: true,_10 ordering: 'created'_10 }_10)
options.ordering
(Optional)
- Type:
string
- Default:
-user_operation__nonce
The field used when ordering the results.
Can be one of: -user_operation__nonce
, -created
, created
.
_10const safeOperationsResponse = await apiKit.getSafeOperationsByAddress(_10 {_10 safeAddress: '0x...',_10 ordering: 'created'_10 }_10)
options.limit
(Optional)
- Type:
number
The number of results to return per page.
_10const safeOperationsResponse = await apiKit.getSafeOperationsByAddress(_10 {_10 safeAddress: '0x...',_10 limit: 10_10 }_10)
options.offset
(Optional)
- Type:
number
The initial index from which to return the results.
_10const safeOperationsResponse = await apiKit.getSafeOperationsByAddress(_10 {_10 safeAddress: '0x...',_10 offset: 50_10 }_10)