Expand description
Binary serialization primitives.
Two contexts use slightly different wire formats:
| Context | String-length prefix | Used by |
|---|---|---|
| Order-ID hashing | u32 (4 bytes LE) | LimitOrder::order_id() |
| Transaction signing | u64 (8 bytes LE) | Transaction::serialize() |
Both are little-endian throughout.
Functions§
- write_
bool - Write a boolean as a single byte (0 or 1).
- write_
f64 - Write an
f64in little-endian. - write_
pubkey_ bytes - Write a
Pubkey’s raw 32 bytes into the buffer. - write_
string_ u32 - Write a length-prefixed UTF-8 string with a u32 length prefix. Used for order-ID hash generation.
- write_
string_ u64 - Write a length-prefixed UTF-8 string with a u64 length prefix. Used for transaction serialization (signing).
- write_
u8 - Write a
u8(1 byte). - write_
u32 - Write a
u32in little-endian. - write_
u64 - Write a
u64in little-endian.