API Kit Reference
decodeData

decodeData

Decodes the specified Safe transaction data.

Usage


_10
import { apiKit } from './setup.ts'
_10
_10
const data = '0x...'
_10
_10
const decodedData = await apiKit.decodeData(data)

Returns

Promise<DataDecoded>

The transaction data decoded.


_10
type DataDecoded = {
_10
readonly method: string
_10
readonly parameters: DecodedParameters[]
_10
}

Parameters

data

  • Type: string

The Safe transaction data to decode.


_10
const decodedData = await apiKit.decodeData('0x...')

to (Optional)

  • Type: string

The address of the receiving contract. If provided, the decoded data will be more accurate, as in case of an ABI collision the Safe Transaction Service would know which ABI to use


_10
const decodedData = await apiKit.decodeData(
_10
'0x...',
_10
'0x...'
_10
)

Was this page helpful?