Expand description
Serialization helpers for arknet.
- borsh is the only encoding used for on-chain bytes. Canonical,
deterministic, consensus-critical. Every
structon the wire must deriveBorshSerialize+BorshDeserialize. - JSON is used for human-facing surfaces: RPC responses, config dumps, CLI output.
- Hex is used for displaying hashes / keys in logs and error messages.
Functionsยง
- from_
borsh - Decode a borsh-encoded byte slice.
- from_
hex - Decode hex with or without a
0xprefix. - from_
json - Decode a JSON string.
- to_
borsh - Encode a value to canonical borsh bytes.
- to_hex
- Encode bytes as lowercase hex with no
0xprefix. - to_json
- Encode a value as JSON.
- to_
json_ pretty - Encode a value as pretty-printed JSON (for CLI output).