ContractMatching
Contract encode
Name | Rule |
---|---|
type | 1 byte, |
accountId | 4 bytes |
subAccountId | 1 byte |
slotId | 2 bytes, use the lower 2 bytes of u32 |
nonce | 3 bytes, encode to 4 bytes in big endian, keep the |
pairId | 1 byte, encode to 2 bytes in big endian, keep the lower byte |
direction | 1 byte |
size | 5 bytes |
price | 15 bytes |
feeRates | 2 bytes |
hasSubsidy | 1 byte |
ContractMatching encode
Name | Rule |
---|---|
type | 1 byte, |
accountId | 4 bytes |
subAccountId | 1 byte |
maker,taker | 31 bytes |
fee | 2 bytes, refer to |
feeToken | 2 bytes |
41 bytes in total, where the maker
and taker
encode as bellow:
Encode the items in
maker
into a bytes list in order;Encode the taker and append to the bytes list;
pass the bytes list to the
rescue_hash_orders
function in SDK, and get the 31 bytes result.
Example
Last updated