I want to be able to return the transaction hash in some of my contract methods using near-sdk-as. I thought I could use context.blockIndex
, but I assume this is something other than the transaction hash?
You can't return tx hash from the contract method because the transaction is not finished at that point, you're still in it
the contract call itself, the one you make from any client, receives the transaction hash as part id the response value
see here for an example https://github.com/Learn-NEAR/starter--near-api-js/blob/ffe12359f94aa8b558824a3f3ec1f4ba82c0e86a/contract-advanced.html#L54