Last active
December 5, 2020 07:45
-
-
Save planethouki/e10231205d2ec45fd8559f95500ba507 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// node v14.4.0 | |
// symbol-sdk v0.21.0 | |
const { Transaction, Convert } = require('symbol-sdk'); | |
const hash = (signedTransactionPayload, generationHash) => { | |
return Transaction.createTransactionHash( | |
signedTransactionPayload, | |
Array.from(Convert.hexToUint8(generationHash)) | |
) | |
} | |
const signedTransactionPayload = "A100000000000000489C21A3793B079454E6964FE46F30DD967558DEFFCC2BD54532FF0DA7CF13A60BFA8504A415363BB5195477FC833F5EA93C2A435CB06BC34D478CB82EC3F700717082D8AFB7E9CDED9A1281F96CFB90C985752E19178503BDABA596B072156700000000016843420000000000000000010000000000000093EC5F71BE10DA46CF092724FD0B63F95D4521301FDE424004CFE25AFF917FC501"; | |
const generationHash = "57F7DA205008026C776CB6AED843393F04CD458E0AA2D9F1D5F31A402072B2D6"; | |
// 3CFF9BCAB2E3E9403681EA2CE20137E2F8B42AAC780DD463C97B024C7D77CDA3 | |
console.log(hash( | |
signedTransactionPayload, generationHash | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment