MCPcopy Create free account
hub / github.com/wevm/viem / decodeTopic

Function decodeTopic

src/utils/abi/decodeEventLog.ts:222–232  ·  view source on GitHub ↗
({ param, value }: { param: AbiParameter; value: Hex })

Source from the content-addressed store, hash-verified

220}
221
222function decodeTopic({ param, value }: { param: AbiParameter; value: Hex }) {
223 if (
224 param.type === 'string' ||
225 param.type === 'bytes' ||
226 param.type === 'tuple' ||
227 param.type.match(/^(.*)\[(\d+)?\]$/)
228 )
229 return value
230 const decodedArg = decodeAbiParameters([param], value) || []
231 return decodedArg[0]
232}

Callers 1

decodeEventLogFunction · 0.85

Calls 1

decodeAbiParametersFunction · 0.85

Tested by

no test coverage detected