sortMapByKeyXdr

Sorts ScMap entries into the Soroban host's key order.

The host stores and validates ScMap keys in a semantic order (see compareScValHostOrder) and rejects a map materialized from an out-of-order SCVal argument. This takes a LinkedHashMap of ScVal entries and returns a new LinkedHashMap whose entries are in that order.

Return

A new LinkedHashMap with entries in the host's ScMap key order

Parameters

map

The unsorted map of ScVal key-value pairs