const encodedData = getAbiItem(
{
abi: [
{name: 'x', type: 'function', inputs: [{ type: 'uint256' }], outputs: [], stateMutability: 'payable'},
{name: 'y', type: 'event', inputs: [{ type: 'address' }], outputs: [{ type: 'uint256' }], stateMutability: 'view'},
{name: 'z', type: 'function', inputs: [{ type: 'string' }], outputs: [{ type: 'uint256' }], stateMutability: 'view'}
],
name: 'y',
});
// encodedData is {name: 'y', type: 'event', inputs: [{ type: 'address' }], outputs: [{ type: 'uint256' }], stateMutability: 'view'}