ton-core / ton

Most popular TON Typescript Library
MIT License
69 stars 56 forks source link

Transaction hash #10

Open hastom opened 1 year ago

hastom commented 1 year ago

Transaction does not contain its own hash, only hash of previous transaction. It’s quite inconvenient, e.g in scenarios when one wants to persist transactions in database. Also toncenter’s response has it, though it’s not encoded in “data” field. Could you please add it?

ex3ndr commented 1 year ago

You just convert transaction to cell and get it's hash. It would match the one in blockchain.

hastom commented 1 year ago

Ok, but it looks complicated for me. Is there a built-in method for this or should I inverse loadTransaction? Also it's kinda unnecessary work, cause hash is already calculated, why bother recalculating it and not just copy?