| | |
| | | if ("0".equals(json.getString("code"))) { |
| | | JSONArray data = json.getJSONArray("data"); |
| | | if (data != null && !data.isEmpty()) { |
| | | JSONObject detail = data.getJSONObject(0); |
| | | String totalEq = detail.getString("totalEq"); |
| | | if (totalEq != null) { |
| | | this.initialPrincipal = new BigDecimal(totalEq); |
| | | JSONObject accountData = data.getJSONObject(0); |
| | | JSONArray details = accountData.getJSONArray("details"); |
| | | if (details != null) { |
| | | for (int i = 0; i < details.size(); i++) { |
| | | JSONObject detail = details.getJSONObject(i); |
| | | if ("USDT".equals(detail.getString("ccy"))) { |
| | | String eq = detail.getString("eq"); |
| | | if (eq != null) { |
| | | this.initialPrincipal = new BigDecimal(eq); |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |