API Kit Reference
getMessages

getMessages

Returns the list of messages associated to a Safe account.

Usage


_12
import { GetSafeMessageListProps } from '@safe-global/api-kit'
_12
import { apiKit } from './setup.ts'
_12
_12
const safeAddress = '0x...'
_12
_12
const config: GetSafeMessageListProps = {
_12
ordering: 'created', // Optional
_12
limit: '10', // Optional
_12
offset: '50' // Optional
_12
}
_12
_12
const messagesResponse = await apiKit.getMessages(safeAddress, config)

Returns

Promise<SafeMessageListResponse>

The paginated list of messages.

Parameters

safeAddress

  • Type: string

The Safe address.


_10
const messagesResponse = await apiKit.getMessages(
_10
'0x...'
_10
)

config.ordering (Optional)

  • Type: string

The field used when ordering the results.


_10
const messagesResponse = await apiKit.getMessages(
_10
'0x...',
_10
{
_10
ordering: 'created'
_10
}
_10
)

config.limit (Optional)

  • Type: number

The number of results to return per page.


_10
const messagesResponse = await apiKit.getMessages(
_10
'0x...',
_10
{
_10
limit: 10
_10
}
_10
)

config.offset (Optional)

  • Type: number

The initial index from which to return the results.


_10
const messagesResponse = await apiKit.getMessages(
_10
'0x...',
_10
{
_10
offset: 50
_10
}
_10
)

Was this page helpful?