From 82d50cd90306b8a8b901c733a719d610bc5efc66 Mon Sep 17 00:00:00 2001 From: Elliot Lee Date: Fri, 9 Aug 2019 10:16:33 -0700 Subject: [PATCH] Document setCanonicalFlag and export from src/transaction/utils --- src/transaction/utils.ts | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/transaction/utils.ts b/src/transaction/utils.ts index 242dea88..f8139e51 100644 --- a/src/transaction/utils.ts +++ b/src/transaction/utils.ts @@ -34,7 +34,17 @@ function formatPrepareResponse(txJSON: any): Prepare { } } -function setCanonicalFlag(txJSON) { +/** + * Set the `tfFullyCanonicalSig` flag on a transaction. + * + * See https://xrpl.org/transaction-malleability.html + * + * @param {TransactionJSON} txJSON The transaction object to modify. + * This method will modify object's `Flags` property, or add it if it does not exist. + * + * @returns {void} This method mutates the original txJSON and does not return a value. + */ +function setCanonicalFlag(txJSON: TransactionJSON): void { txJSON.Flags |= txFlags.Universal.FullyCanonicalSig // JavaScript converts operands to 32-bit signed ints before doing bitwise @@ -192,5 +202,6 @@ export { convertStringToHex, convertMemo, prepareTransaction, - common + common, + setCanonicalFlag }