Skip to main content
Package: com.coinbase.cdp.auth
Utility class for JSON operations. Provides functionality for sorting JSON object keys recursively, which is required for computing consistent request hashes.

Method Details

sortKeys

Recursively sorts all keys in a map alphabetically. This is required for computing consistent request hashes, as the hash must be the same regardless of the order in which keys were added to the map. Parameters: map (Map<String,Object>) - the map to sort Returns: Map<String,Object> - a new map with all keys sorted alphabetically at all levels

toJson

Converts a map to a JSON string. Parameters: map (Map<String,Object>) - the map to convert Returns: String - the JSON string representation

fromJson

Parses a JSON string into a map. Parameters: json (String) - the JSON string to parse Returns: Map<String,Object> - the parsed map