MCPcopy Index your code
hub / github.com/ccxt/ccxt / json

Method json

java/lib/src/main/java/io/github/ccxt/base/Crypto.java:102–110  ·  view source on GitHub ↗
(Object o)

Source from the content-addressed store, hash-verified

100
101 private static final ObjectMapper M = new ObjectMapper();
102 private static String json(Object o) {
103 if (o == null) return null;
104 if (o instanceof Throwable t) {
105 Map<String,Object> err = new LinkedHashMap<>();
106 err.put("name", t.getClass().getSimpleName());
107 try { return M.writeValueAsString(err); } catch (JsonProcessingException e) { return "{\"name\":\"" + err.get("name") + "\"}"; }
108 }
109 try { return M.writeValueAsString(o); } catch (JsonProcessingException e) { throw new RuntimeException(e); }
110 }
111
112 // ====================================================
113 // HMAC

Callers 1

JwtMethod · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected