Accessing Move function return values through an SDK

I have a Move function that returns the ID of a shared object the user will need to query for. However, tx.moveCall is not correctly returning this ID that I am expecting. From the examples online, I know that you can transfer objects that are returned by tx.moveCall, but are there any guidelines for handling return types like an ID or u64?

These return values also do not show up in the TransactionOutput that’s parsed in the onSuccess handler of executing a transaction, but events are included, so I was thinking about getting around this by emitting an event containing the return value(s). Is there a less hacky way to access these return values?

Something to consider:
Return values from composible Move functions are not represented in the transaction result.

They are, however, returned in a dryRun result. You would need to identify the correct return (there may be more than one if the PTB is rich). As it is an address it will be an array/list of bytes. To turn it into an id you need to convert that list to a hex string and prepend ‘0x’.