ton-connect / sdk

SDK for TON Connect 2.0 — a comprehensive communication protocol between wallets and apps in TON ecosystem
Apache License 2.0
326 stars 92 forks source link

[<SDK or UI or UI-REACT or PROTOCOL>]: <brief description> #209

Closed lv-xiaobu closed 4 months ago

lv-xiaobu commented 4 months ago

Is your feature request related to a problem?

sendTransaction only returns boc, how can I get the transaction hash

Describe the solution you'd like

I hope to return the transaction hash directly, or provide a method to get the transaction hash

Describe alternatives you've considered

No response

Additional context

No response

lv-xiaobu commented 4 months ago

solution:

function getTransactionHash(params: SendTransactionResponse | undefined) { if (params) { const cell = Cell.fromBase64(params.boc) const buffer = cell.hash(); const hashHex = buffer.toString('hex'); return hashHex; } return undefined; }