hedera-sdk-java icon indicating copy to clipboard operation
hedera-sdk-java copied to clipboard

Provide a toJson method on receipt and record which is consistent across all SDKs

Open gregscullard opened this issue 2 years ago • 2 comments

Problem

Using different SDKs with WalletConnect, it's impossible to provide a consistent JSON representation of a Receipt or Record. .stringify and .marshal in javascript and golang output differing results.

Solution

Add a toJson method to receipt and record which convert the object to a consistent JSON format (using the JS stringify as a reference) so that all SDKs can generate identical Json.

Alternatives

Let developers write their own equivalence libraries which is likely to go wrong with changes to receipts/records.

gregscullard avatar Sep 05 '23 14:09 gregscullard

Hi @gregscullard and thank you for submitting this issue. I will check it.

thenswan avatar Sep 05 '23 17:09 thenswan

Also for TransactionResponse

gregscullard avatar Sep 06 '23 16:09 gregscullard