neodix42 / ton4j

Java libraries for interacting with TON blockchain.
GNU General Public License v3.0
28 stars 10 forks source link

How to calculate tx_hash with the signed tx? #11

Open glant509 opened 4 weeks ago

glant509 commented 4 weeks ago

I have signed a tx use js sdk, and get the boc string(a base64 fromat string), then I can send this tx to blockchain use sendTx interface, for exempal, the full curl is: curl --location 'https://toncenter.com/api/v3/message' \ --header 'accept: application/json' \ --header 'Content-Type: application/json' \ --data '{ "boc": "te6cckECAwEAAQQAAeGIAXcFEOmykqQ6fLc0q6omjARMmuRAYT2nEXmT4PFQp+XEAzC83LrdP7dggMOaskGLj67V7cLoX0xHLdjpFXIy8pshBi/NinRpNIDOCTp6KBzrqhP+iYVwBpae6U2JV+VLQElNTRi7NEmsyAAAAUAAHAEBaGIAeSYcrIbVBpwDYiSnu+vw1C4F+d733gnjm0V58HKMk1sgF9eEAAAAAAAAAAAAAAAAAAECAK4Pin6lAAAAAAAAAABgioFQJMAIAFWzfhlLlpG8d0ljc+J9mnJSiSMxfu9VRBRu0vXTEU2lAC7goh02UlSHT5bmlXVE0YCJk1yIDCe04i8yfB4qFPy4ggJD3+aA" }'

glant509 commented 4 weeks ago

how can I use the boc string to calculate tx_hash before I send the tx?

neodix42 commented 3 weeks ago

You can't. tx_hash is provided by indexer that is used within toncenter for example.