How to find transaction type from type property of block api response


From API, the transaction type looks in decimal format. How to find which type of transaction it is from that id?

I know this,

Common transaction part of the byte array,
Transaction type: 4 bytes (integer).
The following types are supported:

  1. 0x0101 (transfer transaction)
  2. 0x0801 (importance transfer transaction)
  3. 0x1001 (multisig aggregate modification transfer transaction)
  4. 0x1002 (multisig signature transaction)
  5. 0x1004 (multisig transaction)
  6. 0x2001 (provision namespace transaction)
  7. 0x4001 (mosaic definition creation transaction)
  8. 0x4002 (mosaic supply change transaction)
    example (importance transfer transaction): 0x01, 0x08, 0x00, 0x00

But in which format type is returned from api? and how to match/convert it to get the above ones?

1 Like

Got it by converting decimal to hexadecimal. Please correct me if Iā€™m wrong.


1 Like

What results you got?

1 Like

257 (decimal) ā†’ 101 (hexadecimal) like this

Looks ok :+1: