@@ -221,22 +221,22 @@ export class SysCtrt extends ctrt.BaseTokCtrt {
221221 }
222222
223223 /**
224- * getInt64Bytes converts Big Integer into 8-byte array
224+ * getInt64Bits converts Big Integer into 8-byte array
225225 * @param {BigInt } x - integer to be converted
226226 * @returns {Buffer } 8 Byte array
227227 */
228- async getInt64Bytes ( x ) {
228+ getInt64Bits ( x ) {
229229 const bytes = Buffer . alloc ( 8 ) ;
230230 bytes . writeBigInt64BE ( x ) ;
231231 return bytes ;
232232 }
233233
234234 /**
235- * getInt16Bytes converts Short Integer into 2-byte array
235+ * getInt16Bits converts Short Integer into 2-byte array
236236 * @param {number } x - integer to be converted
237237 * @returns {Buffer } 2 Byte array
238238 */
239- async getInt16Bytes ( x ) {
239+ getInt16Bits ( x ) {
240240 const bytes = Buffer . alloc ( 2 ) ;
241241 bytes . writeInt16BE ( x ) ;
242242 return bytes ;
@@ -252,22 +252,22 @@ export class SysCtrt extends ctrt.BaseTokCtrt {
252252 * @param {string } attachment - encoded attachment from transaction info
253253 * @returns {string } generated transaction ID
254254 */
255- async generateTxID (
255+ generateTxID (
256256 timestamp ,
257257 amount ,
258258 fee ,
259259 feeScale ,
260260 recipient ,
261261 attachment
262262 ) {
263- const timestampBytes = getInt64Bytes ( BigInt ( timestamp . toString ( ) ) )
264- const amountBytes = getInt64Bytes ( BigInt ( amount . toString ( ) ) )
265- const feeBytes = getInt64Bytes ( BigInt ( fee . toString ( ) ) )
266- const feeScaleBytes = getInt16Bytes ( feeScale )
263+ const timestampBytes = this . getInt64Bits ( BigInt ( timestamp . toString ( ) ) )
264+ const amountBytes = this . getInt64Bits ( BigInt ( amount . toString ( ) ) )
265+ const feeBytes = this . getInt64Bits ( BigInt ( fee . toString ( ) ) )
266+ const feeScaleBytes = this . getInt16Bits ( feeScale )
267267 const recipientBytesArr = base58 . decode ( recipient )
268268
269269 const attachmentBytes = base58 . decode ( attachment )
270- const lenBytes = getInt16Bytes ( attachmentBytes . length )
270+ const lenBytes = this . getInt16Bits ( attachmentBytes . length )
271271
272272 const toSign = Buffer . concat ( [ Uint8Array . from ( [ 2 ] ) , timestampBytes , amountBytes , feeBytes , feeScaleBytes , recipientBytesArr , lenBytes , attachmentBytes ] )
273273
0 commit comments