You can generate hash with boc before transaction or after transaction with response boc.
const bocCell = TonWeb.boc.Cell.oneFromBoc(TonWeb.utils.base64ToBytes(response.boc));
const hash = TonWeb.utils.bytesToBase64(await bocCell.hash());
As mentioned in this question: "3) Poll for the latest transactions from the Blockchain using your wallet account ID and match the transaction using the pre-generated hash" (source).
My question is, how is the transaction hash generated or calculated in general?
I understand that we have a public key for signing.
You can generate hash with boc before transaction or after transaction with response boc.
const bocCell = TonWeb.boc.Cell.oneFromBoc(TonWeb.utils.base64ToBytes(response.boc));
const hash = TonWeb.utils.bytesToBase64(await bocCell.hash());