@@ -818,27 +818,45 @@ public static String extractSerializedTransactionFromSignable(@NotNull String eo
818818 * <p>
819819 * Signable signature structure:
820820 * <p>
821- * chainId + serialized transaction + 32 bytes of 0
821+ * chainId + serialized transaction + 32 bytes of serializedContextFreeData
822822 *
823823 * @param serializedTransaction - the serialized transaction to be converted to signable transaction
824824 * @param chainId - the chain id will be used inside the signature transaction structure.
825+ * @param serializedContextFreeData - the serialized context free data to be converted with transaction
825826 * @return - Signable transaction
826827 * @throws EOSFormatterError if inputs are invalid
827828 */
828829 public static String prepareSerializedTransactionForSigning (@ NotNull String serializedTransaction ,
829- @ NotNull String chainId ) throws EOSFormatterError {
830+ @ NotNull String chainId , @ NotNull String serializedContextFreeData ) throws EOSFormatterError {
830831 if (serializedTransaction .isEmpty () || chainId .isEmpty ()) {
831832 throw new EOSFormatterError (ErrorConstants .EMPTY_INPUT_PREPARE_SERIALIZIED_TRANS_FOR_SIGNING );
832833 }
833834
834- String signableTransaction = chainId + serializedTransaction + Hex . toHexString ( new byte [ 32 ]) ;
835+ String signableTransaction = chainId + serializedTransaction + serializedContextFreeData ;
835836 if (signableTransaction .length () <= MINIMUM_SIGNABLE_TRANSACTION_LENGTH ) {
836837 throw new EOSFormatterError (String .format (ErrorConstants .INVALID_INPUT_SIGNABLE_TRANS_LENGTH_EXTRACT_SERIALIZIED_TRANS_FROM_SIGNABLE , MINIMUM_SIGNABLE_TRANSACTION_LENGTH ));
837838 }
838839
839840 return signableTransaction ;
840841 }
841842
843+ /**
844+ * Preparing signable transaction for signing.
845+ * <p>
846+ * Signable signature structure:
847+ * <p>
848+ * chainId + serialized transaction + 32 bytes of 0
849+ *
850+ * @param serializedTransaction - the serialized transaction to be converted to signable transaction
851+ * @param chainId - the chain id will be used inside the signature transaction structure.
852+ * @return - Signable transaction
853+ * @throws EOSFormatterError if inputs are invalid
854+ */
855+ public static String prepareSerializedTransactionForSigning (@ NotNull String serializedTransaction ,
856+ @ NotNull String chainId ) throws EOSFormatterError {
857+ return EOSFormatter .prepareSerializedTransactionForSigning (serializedTransaction , chainId , Hex .toHexString (new byte [32 ]));
858+ }
859+
842860 /**
843861 * This method converts a DER encoded private key, public key, or signature into the PEM
844862 * format.
0 commit comments