trustwallet / wallet-core

Cross-platform, cross-blockchain wallet library.
https://developer.trustwallet.com/wallet-core
Apache License 2.0
2.84k stars 1.59k forks source link

[Feature Request]: Support calculating the TX hash of a transaction #4001

Closed 10gic closed 1 month ago

10gic commented 2 months ago

TX hash is useful for tracking the status of a transaction on the blockchain. Sometimes, we want to know the TX hash before the transaction is broadcasted.

Currently, the TX hash is only available for a few blockchains in the SigningOutput object.

There are cases where the TX is not constructed by the wallet core; for example, the transaction might be constructed by a DApp. The DApp only requests the wallet to perform the signing, constructs the transaction itself, and then asks the wallet to broadcast it.

I think it's useful to have a common function to calculate the TX hash of a transaction.

satoshiotomakan commented 2 months ago

Hi @10gic, thank you for the issue! That definitely makes sense, I'll put this on the roadmap. However, I can't say it will be done soon as we're fully loaded right now. But I'll add TX hash for new blockchains for sure.