xrpl-py icon indicating copy to clipboard operation
xrpl-py copied to clipboard

[Batch] Add Ledger Object Hashing

Open dangell7 opened this issue 7 months ago • 4 comments

Batch can sometimes require you to know the hash of the ledger entry object before processing therefore I would recommend we add the hashing functionality for all ledger objects into this repo so that developers don't need to build their own hashing functions.

dangell7 avatar Jun 06 '25 20:06 dangell7

Hello Dennis, could you elaborate on this issue?

The inner batch transactions are similar to the XRPL transactions, except for the fields pertaining to the Fees and Sequence. Do you have any Batch-specific examples where we would need ledger-object-hashes?

Furthermore, I would fetch the said ledger object via account_objects, ledger_entry (or) similar RPC calls. These responses contain an index field that supplies me with the said hash. Is this method not sufficient?

ckeshava avatar Jun 26 '25 21:06 ckeshava

If a batch creates the object you dont have the object id... A great example is NFToken Offer and Accept in the same batch.

dangell7 avatar Jun 26 '25 21:06 dangell7

These functions already exist in xrpl.js however they are not feature complete, only a few of the object id hashing functions exist.

dangell7 avatar Jun 26 '25 21:06 dangell7

This library doesnt have any of the hashing functionality but you can take it from this repo:

https://github.com/Xahau/xahau-py/blob/xahau-main/xahau/utils/hash_utils.py

dangell7 avatar Sep 03 '25 18:09 dangell7