Skip to content

Commit

Permalink
[price] update price API , b 294
Browse files Browse the repository at this point in the history
  • Loading branch information
MIPPL committed Jul 10, 2021
1 parent f3ad844 commit 2582b41
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ android {
applicationId = 'com.wagerrwallet'
minSdkVersion 23
targetSdkVersion 29
versionCode 293
versionName "293"
versionCode 294
versionName "294"
multiDexEnabled true

// Similar to other properties in the defaultConfig block,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ public static JSONArray backupFetchRates(Activity app, BaseWalletManager walletM
* taken from last price
*/
public static float fetchRatesCoin(Activity app, BaseWalletManager walletManager) {
String url1 = "https://api.crex24.com/CryptoExchangeService/BotPublic/ReturnTicker?request=[NamePairs=BTC_WGR]";
String url1 = "https://api.crex24.com/v2/public/tickers?instrument=WGR-BTC";
String jsonString1 = urlGET(app, url1);

float price1=100000;
Expand All @@ -243,9 +243,9 @@ public static float fetchRatesCoin(Activity app, BaseWalletManager walletManager
}

try {
JSONObject object = new JSONObject(jsonString1);
JSONArray objectTicker = object.getJSONArray("Tickers");
price1 = (1 / (float)((JSONObject)objectTicker.get(0)).getDouble("Last"));
JSONArray arr = new JSONArray(jsonString1);
JSONObject objectTicker = arr.getJSONObject(0);
price1 = (1 / (float)(objectTicker.getDouble("last")) );
} catch (JSONException ignored) {
}

Expand Down

0 comments on commit 2582b41

Please sign in to comment.