Exchange transaction binary format

Learn more about exchange transaction

Transaction version 2

Transaction version 2 can accept orders of version 1, 2 and 3.

Field order number Field JSON field name Field type Field size in bytes Comment
1 Version flag Byte 1 Indicates the transaction version is version 2 or higher.
Value must be 0
2 Transaction type ID type Byte 1 Value must be 7
3 Transaction version version Byte 1 Value must be 2
4.1 Buy order size Integer 4
4.2 Buy order version flag order1.version Byte S S = 1 if the order version is 1.
S = 0 if the order version is 2
4.3 Order for buying a token order1 Array[Byte] See order binary format
5.1 Sell order size Integer 4
5.2 Sell order version flag order2.version Byte S S = 1 if the order version is 1.
S = 0 if the order version is 2
5.3 Order for selling a token order2 Array[Byte] See order binary format
6 Price price Long 8 Amount of token B which order sender offers for one token A
7 Amount amount Long 8 Amount of token A which order sender wants to buy
8 Buy matcher fee buyMatcherFee Long 8
9 Sell matcher fee sellMatcherFee Long 8
10 Transaction fee fee Long 8
11 Transaction timestamp timestamp Long 8
12 Transaction proofs proofs Proofs S If the array is empty, then S= 3.
If the array is not empty, then S = 3 + 2 × N + (P1 + P2 + ... + Pn), where N is the number of proofs in the array, Pn is the size on N-th proof in bytes.
The maximum number of proofs in the array is 8. The maximum size of each proof is 64 bytes

JSON representation of the transaction

See the example in Node API.

Transaction version 1

Transaction version 1 can accept orders of version 1 only.

Field order number Field Field type Field size in bytes Comment
1 Transaction type ID Byte 1 Value must be 6
2 Buy order size Integer 4
3 Sell order size Integer 4
4 Order for buying a token Array[Byte] See order binary format
5 Order for selling a token Array[Byte] See order binary format
6 Price Long 8 Amount of token B which order sender offers for one token A
7 Amount Long 8 Amount of token A which order sender wants to buy
8 Buy matcher fee Long 8
9 Sell matcher fee Long 8
10 Transaction fee Long 8
11 Transaction timestamp Long 8
12 Transaction signature Array[Byte] 64

results matching ""

    No results matching ""