From 1cecd0b718872e8ac4a862ced818d3d4610134e2 Mon Sep 17 00:00:00 2001 From: m2049r Date: Fri, 19 Jun 2020 19:17:38 +0200 Subject: [PATCH] xmr.to v3 API (#667) --- .gitignore | 1 + app/build.gradle | 4 +- .../send/SendBtcConfirmWizardFragment.java | 18 +-- .../com/m2049r/xmrwallet/util/Helper.java | 4 +- .../xmrwallet/xmrto/api/QueryOrderStatus.java | 44 +++----- .../xmrto/network/CreateOrderImpl.java | 3 +- .../xmrto/network/QueryOrderStatusImpl.java | 105 ++++++------------ .../xmrwallet/xmrto/network/XmrToApiImpl.java | 5 - .../network/XmrToApiCreateOrderTest.java | 2 +- .../xmrto/network/XmrToApiQueryOrderTest.java | 67 +++-------- 10 files changed, 79 insertions(+), 174 deletions(-) diff --git a/.gitignore b/.gitignore index 9e8ff4a..3386632 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,4 @@ /app/prodMainnet /app/alphaStagenet /app/prodStagenet +/app/.cxx diff --git a/app/build.gradle b/app/build.gradle index e5dbd30..08b1244 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -7,8 +7,8 @@ android { applicationId "com.m2049r.xmrwallet" minSdkVersion 21 targetSdkVersion 28 - versionCode 301 - versionName "1.13.1 'ReStart'" + versionCode 302 + versionName "1.13.2 'ReStart'" testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" externalNativeBuild { diff --git a/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendBtcConfirmWizardFragment.java b/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendBtcConfirmWizardFragment.java index 8452452..b3881c4 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendBtcConfirmWizardFragment.java +++ b/app/src/main/java/com/m2049r/xmrwallet/fragment/send/SendBtcConfirmWizardFragment.java @@ -457,8 +457,8 @@ public class SendBtcConfirmWizardFragment extends SendWizardFragment implements } showProgress(3, getString(R.string.label_send_progress_create_tx)); TxData txData = sendListener.getTxData(); - txData.setDestinationAddress(xmrtoStatus.getXmrReceivingSubaddress()); - txData.setAmount(Wallet.getAmountFromDouble(xmrtoStatus.getXmrAmountTotal())); + txData.setDestinationAddress(xmrtoStatus.getReceivingSubaddress()); + txData.setAmount(Wallet.getAmountFromDouble(xmrtoStatus.getIncomingAmountTotal())); getActivityCallback().onPrepareSend(xmrtoStatus.getUuid(), txData); } @@ -572,22 +572,22 @@ public class SendBtcConfirmWizardFragment extends SendWizardFragment implements NumberFormat df = NumberFormat.getInstance(Locale.US); df.setMaximumFractionDigits(12); String btcAmount = df.format(status.getBtcAmount()); - String xmrAmountTotal = df.format(status.getXmrAmountTotal()); + String xmrAmountTotal = df.format(status.getIncomingAmountTotal()); tvTxBtcAmount.setText(getString(R.string.text_send_btc_amount, btcAmount, xmrAmountTotal)); - String xmrPriceBtc = df.format(status.getXmrPriceBtc()); + String xmrPriceBtc = df.format(status.getIncomingPriceBtc()); tvTxBtcRate.setText(getString(R.string.text_send_btc_rate, xmrPriceBtc)); - double calcRate = status.getBtcAmount() / status.getXmrPriceBtc(); - Timber.i("Rates: %f / %f", calcRate, status.getXmrPriceBtc()); + double calcRate = status.getBtcAmount() / status.getIncomingPriceBtc(); + Timber.d("Rates: %f / %f", calcRate, status.getIncomingPriceBtc()); tvTxBtcAddress.setText(status.getBtcDestAddress()); // TODO test if this is different? - Timber.i("Expires @ %s, in %s seconds", status.getExpiresAt().toString(), status.getSecondsTillTimeout()); + Timber.d("Expires @ %s, in %s seconds", status.getExpiresAt().toString(), status.getSecondsTillTimeout()); - Timber.i("Status = %s", status.getState().toString()); + Timber.d("Status = %s", status.getState().toString()); tvTxXmrToKey.setText(status.getUuid()); - Timber.d("AmountRemaining=%f, XmrAmountTotal=%f", status.getXmrAmountRemaining(), status.getXmrAmountTotal()); + Timber.d("AmountRemaining=%f, XmrAmountTotal=%f", status.getRemainingAmountIncoming(), status.getIncomingAmountTotal()); hideProgress(); startSendTimer(); prepareSend(); diff --git a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java index 8b74ce2..bdbf201 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java +++ b/app/src/main/java/com/m2049r/xmrwallet/util/Helper.java @@ -323,9 +323,9 @@ public class Helper { static public HttpUrl getXmrToBaseUrl() { if ((WalletManager.getInstance() == null) || (WalletManager.getInstance().getNetworkType() != NetworkType.NetworkType_Mainnet)) { - return HttpUrl.parse("https://test.xmr.to/api/v2/xmr2btc/"); + return HttpUrl.parse("https://test.xmr.to/api/v3/xmr2btc/"); } else { - return HttpUrl.parse("https://xmr.to/api/v2/xmr2btc/"); + return HttpUrl.parse("https://xmr.to/api/v3/xmr2btc/"); } } diff --git a/app/src/main/java/com/m2049r/xmrwallet/xmrto/api/QueryOrderStatus.java b/app/src/main/java/com/m2049r/xmrwallet/xmrto/api/QueryOrderStatus.java index c6f0b7f..122d985 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/xmrto/api/QueryOrderStatus.java +++ b/app/src/main/java/com/m2049r/xmrwallet/xmrto/api/QueryOrderStatus.java @@ -43,47 +43,31 @@ public interface QueryOrderStatus { boolean isError(); - State getState(); // "state": "", + QueryOrderStatus.State getState(); - double getBtcAmount(); // "btc_amount": , + double getBtcAmount(); - String getBtcDestAddress(); // "btc_dest_address": "", + String getBtcDestAddress(); - String getUuid(); // "uuid": "" + String getUuid(); - int getBtcNumConfirmations(); // "btc_num_confirmations": , + int getBtcNumConfirmationsThreshold(); - int getBtcNumConfirmationsBeforePurge(); // "btc_num_confirmations_before_purge": , + Date getCreatedAt(); - String getBtcTransactionId(); // "btc_transaction_id": "", + Date getExpiresAt(); - Date getCreatedAt(); // "created_at": "", + int getSecondsTillTimeout(); - Date getExpiresAt(); // "expires_at": "", + double getIncomingAmountTotal(); - int getSecondsTillTimeout(); // "seconds_till_timeout": , + double getRemainingAmountIncoming(); - double getXmrAmountTotal(); // "xmr_amount_total": , + int getIncomingNumConfirmationsRemaining(); - double getXmrAmountRemaining(); // "xmr_amount_remaining": , + double getIncomingPriceBtc(); - int getXmrNumConfirmationsRemaining(); // "xmr_num_confirmations_remaining": , - - double getXmrPriceBtc(); // "xmr_price_btc": , - - String getXmrReceivingAddress(); // "xmr_receiving_address": "xmr_old_style_address_user_can_send_funds_to_as_string", - - String getXmrReceivingSubaddress(); // , - - String getXmrReceivingIntegratedAddress(); // "xmr_receiving_integrated_address": "xmr_integrated_address_user_needs_to_send_funds_to_as_string", - - int getXmrRecommendedMixin(); // "xmr_recommended_mixin": , - - @Deprecated - double getXmrRequiredAmount(); // "xmr_required_amount": , - - String getXmrRequiredPaymentIdLong(); // "xmr_required_payment_id_long": "xmr_payment_id_user_needs_to_include_when_using_old_stlye_address_as_string" - - String getXmrRequiredPaymentIdShort(); // "xmr_required_payment_id_short": "xmr_payment_id_included_in_integrated_address_as_string" + String getReceivingSubaddress(); + int getRecommendedMixin(); } diff --git a/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/CreateOrderImpl.java b/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/CreateOrderImpl.java index 7a28968..c5d2e0f 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/CreateOrderImpl.java +++ b/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/CreateOrderImpl.java @@ -113,7 +113,8 @@ class CreateOrderImpl implements CreateOrder { static JSONObject createRequest(final double amount, final String address) throws JSONException { final JSONObject jsonObject = new JSONObject(); - jsonObject.put("btc_amount", amount); + jsonObject.put("amount", amount); + jsonObject.put("amount_currency", "BTC"); jsonObject.put("btc_dest_address", address); return jsonObject; } diff --git a/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/QueryOrderStatusImpl.java b/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/QueryOrderStatusImpl.java index 0470669..bf1c0d8 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/QueryOrderStatusImpl.java +++ b/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/QueryOrderStatusImpl.java @@ -42,23 +42,17 @@ class QueryOrderStatusImpl implements QueryOrderStatus { private String btcDestAddress; // "btc_dest_address": "", private String uuid; // "uuid": "" // the following are only returned if the state is "after" TO_BE_CREATED - private int btcNumConfirmations; // "btc_num_confirmations": , - private int btcNumConfirmationsBeforePurge; // "btc_num_confirmations_before_purge": , - private String btcTransactionId; // "btc_transaction_id": "", + //private int btcNumConfirmations; // "btc_num_confirmations": , + private int btcNumConfirmationsThreshold; // "btc_num_confirmations_threshold": , private Date createdAt; // "created_at": "", private Date expiresAt; // "expires_at": "", private int secondsTillTimeout; // "seconds_till_timeout": , - private double xmrAmountTotal; // "xmr_amount_total": , - private double xmrAmountRemaining; // "xmr_amount_remaining": , - private int xmrNumConfirmationsRemaining; // "xmr_num_confirmations_remaining": , - private double xmrPriceBtc; // "xmr_price_btc": , - private String xmrReceivingSubaddress; // , - private String xmrReceivingAddress; // "xmr_receiving_address": "xmr_old_style_address_user_can_send_funds_to_as_string", - private String xmrReceivingIntegratedAddress; // "xmr_receiving_integrated_address": "xmr_integrated_address_user_needs_to_send_funds_to_as_string", - private int xmrRecommendedMixin; // "xmr_recommended_mixin": , - private double xmrRequiredAmount; // "xmr_required_amount": , - private String xmrRequiredPaymentIdLong; // "xmr_required_payment_id_long": "xmr_payment_id_user_needs_to_include_when_using_old_stlye_address_as_string" - private String xmrRequiredPaymentIdShort; // "xmr_required_payment_id_short": "xmr_payment_id_included_in_integrated_address_as_string" + private double incomingAmountTotal; // "incoming_amount_total": , + private double remainingAmountIncoming; // "remaining_amount_incoming": , + private int incomingNumConfirmationsRemaining; // "incoming_num_confirmations_remaining": , + private double incomingPriceBtc; // "incoming_price_btc": , + private String receivingSubaddress; // "receiving_subaddress": , + private int recommendedMixin; // "recommended_mixin": , public QueryOrderStatus.State getState() { return state; @@ -76,16 +70,8 @@ class QueryOrderStatusImpl implements QueryOrderStatus { return uuid; } - public int getBtcNumConfirmations() { - return btcNumConfirmations; - } - - public int getBtcNumConfirmationsBeforePurge() { - return btcNumConfirmationsBeforePurge; - } - - public String getBtcTransactionId() { - return btcTransactionId; + public int getBtcNumConfirmationsThreshold() { + return btcNumConfirmationsThreshold; } public Date getCreatedAt() { @@ -100,48 +86,28 @@ class QueryOrderStatusImpl implements QueryOrderStatus { return secondsTillTimeout; } - public double getXmrAmountTotal() { - return xmrAmountTotal; + public double getIncomingAmountTotal() { + return incomingAmountTotal; } - public double getXmrAmountRemaining() { - return xmrAmountRemaining; + public double getRemainingAmountIncoming() { + return remainingAmountIncoming; } - public int getXmrNumConfirmationsRemaining() { - return xmrNumConfirmationsRemaining; + public int getIncomingNumConfirmationsRemaining() { + return incomingNumConfirmationsRemaining; } - public double getXmrPriceBtc() { - return xmrPriceBtc; + public double getIncomingPriceBtc() { + return incomingPriceBtc; } - public String getXmrReceivingSubaddress() { - return xmrReceivingSubaddress; + public String getReceivingSubaddress() { + return receivingSubaddress; } - public String getXmrReceivingAddress() { - return xmrReceivingAddress; - } - - public String getXmrReceivingIntegratedAddress() { - return xmrReceivingIntegratedAddress; - } - - public int getXmrRecommendedMixin() { - return xmrRecommendedMixin; - } - - public double getXmrRequiredAmount() { - return xmrRequiredAmount; - } - - public String getXmrRequiredPaymentIdLong() { - return xmrRequiredPaymentIdLong; - } - - public String getXmrRequiredPaymentIdShort() { - return xmrRequiredPaymentIdShort; + public int getRecommendedMixin() { + return recommendedMixin; } public boolean isCreated() { @@ -197,29 +163,22 @@ class QueryOrderStatusImpl implements QueryOrderStatus { uuid = jsonObject.getString("uuid"); // "uuid": "" if (isCreated()) { - btcNumConfirmations = jsonObject.getInt("btc_num_confirmations"); // "btc_num_confirmations": , - btcNumConfirmationsBeforePurge = jsonObject.getInt("btc_num_confirmations_before_purge"); // "btc_num_confirmations_before_purge": , - btcTransactionId = jsonObject.getString("btc_transaction_id"); // "btc_transaction_id": "", + btcNumConfirmationsThreshold = jsonObject.getInt("btc_num_confirmations_threshold"); try { - String created = jsonObject.getString("created_at"); // "created_at": "", + String created = jsonObject.getString("created_at"); createdAt = parseDate(created); - String expires = jsonObject.getString("expires_at"); // "expires_at": "", + String expires = jsonObject.getString("expires_at"); expiresAt = parseDate(expires); } catch (ParseException ex) { throw new JSONException(ex.getLocalizedMessage()); } - secondsTillTimeout = jsonObject.getInt("seconds_till_timeout"); // "seconds_till_timeout": , - xmrAmountTotal = jsonObject.getDouble("xmr_amount_total"); // "xmr_amount_total": , - xmrAmountRemaining = jsonObject.getDouble("xmr_amount_remaining"); // "xmr_amount_remaining": , - xmrNumConfirmationsRemaining = jsonObject.getInt("xmr_num_confirmations_remaining"); // "xmr_num_confirmations_remaining": , - xmrPriceBtc = jsonObject.getDouble("xmr_price_btc"); // "xmr_price_btc": , - xmrReceivingSubaddress = jsonObject.getString("xmr_receiving_subaddress"); // , - xmrReceivingAddress = jsonObject.getString("xmr_receiving_address"); // "xmr_receiving_address": "xmr_old_style_address_user_can_send_funds_to_as_string", - xmrReceivingIntegratedAddress = jsonObject.getString("xmr_receiving_integrated_address"); // "xmr_receiving_integrated_address": "xmr_integrated_address_user_needs_to_send_funds_to_as_string", - xmrRecommendedMixin = jsonObject.getInt("xmr_recommended_mixin"); // "xmr_recommended_mixin": , - xmrRequiredAmount = jsonObject.getDouble("xmr_required_amount"); // "xmr_required_amount": , - xmrRequiredPaymentIdLong = jsonObject.getString("xmr_required_payment_id_long"); // "xmr_required_payment_id_long": "xmr_payment_id_user_needs_to_include_when_using_old_stlye_address_as_string" - xmrRequiredPaymentIdShort = jsonObject.getString("xmr_required_payment_id_short"); // "xmr_required_payment_id_short": "xmr_payment_id_included_in_integrated_address_as_string" + secondsTillTimeout = jsonObject.getInt("seconds_till_timeout"); + incomingAmountTotal = jsonObject.getDouble("incoming_amount_total"); + remainingAmountIncoming = jsonObject.getDouble("remaining_amount_incoming"); + incomingNumConfirmationsRemaining = jsonObject.getInt("incoming_num_confirmations_remaining"); + incomingPriceBtc = jsonObject.getDouble("incoming_price_btc"); + receivingSubaddress = jsonObject.getString("receiving_subaddress"); + recommendedMixin = jsonObject.getInt("recommended_mixin"); } } diff --git a/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiImpl.java b/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiImpl.java index e2f2d6c..3ac1c26 100644 --- a/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiImpl.java +++ b/app/src/main/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiImpl.java @@ -53,11 +53,6 @@ public class XmrToApiImpl implements XmrToApi, XmrToApiCall { this.baseUrl = baseUrl; } - public XmrToApiImpl(@NonNull final OkHttpClient okHttpClient) { - this(okHttpClient, HttpUrl.parse("https://xmr.to/api/v2/xmr2btc/")); - } - - @Override public void createOrder(final double amount, @NonNull final String address, @NonNull final XmrToCallback callback) { diff --git a/app/src/test/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiCreateOrderTest.java b/app/src/test/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiCreateOrderTest.java index 0d342cd..2ae21c9 100644 --- a/app/src/test/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiCreateOrderTest.java +++ b/app/src/test/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiCreateOrderTest.java @@ -93,7 +93,7 @@ public class XmrToApiCreateOrderTest { public void createOrder_shouldContainValidBody() throws InterruptedException { - final String validBody = "{\"btc_amount\":0.1,\"btc_dest_address\":\"19y91nJyzXsLEuR7Nj9pc3o5SeHNc8A9RW\"}"; + final String validBody = "{\"amount\":0.1,\"amount_currency\":\"BTC\",\"btc_dest_address\":\"19y91nJyzXsLEuR7Nj9pc3o5SeHNc8A9RW\"}"; xmrToApi.createOrder(0.1, "19y91nJyzXsLEuR7Nj9pc3o5SeHNc8A9RW", mockOrderXmrToCallback); diff --git a/app/src/test/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiQueryOrderTest.java b/app/src/test/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiQueryOrderTest.java index 25f3de6..28b7fbf 100644 --- a/app/src/test/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiQueryOrderTest.java +++ b/app/src/test/java/com/m2049r/xmrwallet/xmrto/network/XmrToApiQueryOrderTest.java @@ -122,9 +122,7 @@ public class XmrToApiQueryOrderTest { final double btcAmount = 0.1; final String btcDestAddress = "1FhnVJi2V1k4MqXm2nHoEbY5LV7FPai7bb"; final String uuid = "xmrto - efMsiU"; - final int btcNumConfirmations = 0; final int btcNumConfirmationsBeforePurge = 144; - final String btcTransactionId = ""; final String createdAt = "2017-11-17T12:20:02Z"; final String expiresAt = "2017-11-17T12:35:02Z"; final int secondsTillTimeout = 882; @@ -133,12 +131,7 @@ public class XmrToApiQueryOrderTest { final int xmrNumConfirmationsRemaining = -1; final double xmrPriceBtc = 0.0154703; final String xmrReceivingSubaddress = "83BGzCTthheE2KxNTBPnPJjJUthYPfDfCf3ENSVQcpga8RYSxNz9qCz1qp9MLye9euMjckGi11cRdeVGqsVqTLgH8w5fJ1D"; - final String xmrReceivingAddress = "44TVPcCSHebEQp4LnapPkhb2pondb2Ed7GJJLc6TkKwtSyumUnQ6QzkCCkojZycH2MRfLcujCM7QR1gdnRULRraV4UpB5n4"; - final String xmrReceivingIntegratedAddress = "4EAAQR1vtv7EQp4LnapPkhb2pondb2Ed7GJJLc6TkKwtSyumUnQ6QzkCCkojZycH2MRfLcujCM7QR1gdnRULRraV6B5rRtHLeXGQSECXy9"; final int xmrRecommendedMixin = 5; - final double xmrRequiredAmount = 6.464; - final String xmrRequiredPaymentIdLong = "56beabc3ca6d52a78c9a44cefebeb870054d8b367cc7065bff1bdb553caca85c"; - final String xmrRequiredPaymentIdShort = "eeb6086436b267cf"; MockResponse jsonMockResponse = new MockResponse().setBody( createMockQueryOrderResponse( @@ -146,9 +139,7 @@ public class XmrToApiQueryOrderTest { btcAmount, btcDestAddress, uuid, - btcNumConfirmations, btcNumConfirmationsBeforePurge, - btcTransactionId, createdAt, expiresAt, secondsTillTimeout, @@ -157,12 +148,7 @@ public class XmrToApiQueryOrderTest { xmrNumConfirmationsRemaining, xmrPriceBtc, xmrReceivingSubaddress, - xmrReceivingAddress, - xmrReceivingIntegratedAddress, - xmrRecommendedMixin, - xmrRequiredAmount, - xmrRequiredPaymentIdLong, - xmrRequiredPaymentIdShort)); + xmrRecommendedMixin)); mockWebServer.enqueue(jsonMockResponse); xmrToApi.queryOrderStatus(uuid, new XmrToCallback() { @@ -172,9 +158,7 @@ public class XmrToApiQueryOrderTest { waiter.assertEquals(orderStatus.getBtcAmount(), btcAmount); waiter.assertEquals(orderStatus.getBtcDestAddress(), btcDestAddress); waiter.assertEquals(orderStatus.getUuid(), uuid); - waiter.assertEquals(orderStatus.getBtcNumConfirmations(), btcNumConfirmations); - waiter.assertEquals(orderStatus.getBtcNumConfirmationsBeforePurge(), btcNumConfirmationsBeforePurge); - waiter.assertEquals(orderStatus.getBtcTransactionId(), btcTransactionId); + waiter.assertEquals(orderStatus.getBtcNumConfirmationsThreshold(), btcNumConfirmationsBeforePurge); try { waiter.assertEquals(orderStatus.getCreatedAt(), ParseDate(createdAt)); waiter.assertEquals(orderStatus.getExpiresAt(), ParseDate(expiresAt)); @@ -182,17 +166,12 @@ public class XmrToApiQueryOrderTest { waiter.fail(ex); } waiter.assertEquals(orderStatus.getSecondsTillTimeout(), secondsTillTimeout); - waiter.assertEquals(orderStatus.getXmrAmountTotal(), xmrAmountTotal); - waiter.assertEquals(orderStatus.getXmrAmountRemaining(), xmrAmountRemaining); - waiter.assertEquals(orderStatus.getXmrNumConfirmationsRemaining(), xmrNumConfirmationsRemaining); - waiter.assertEquals(orderStatus.getXmrPriceBtc(), xmrPriceBtc); - waiter.assertEquals(orderStatus.getXmrReceivingSubaddress(), xmrReceivingSubaddress); - waiter.assertEquals(orderStatus.getXmrReceivingAddress(), xmrReceivingAddress); - waiter.assertEquals(orderStatus.getXmrReceivingIntegratedAddress(), xmrReceivingIntegratedAddress); - waiter.assertEquals(orderStatus.getXmrRecommendedMixin(), xmrRecommendedMixin); - waiter.assertEquals(orderStatus.getXmrRequiredAmount(), xmrRequiredAmount); - waiter.assertEquals(orderStatus.getXmrRequiredPaymentIdLong(), xmrRequiredPaymentIdLong); - waiter.assertEquals(orderStatus.getXmrRequiredPaymentIdShort(), xmrRequiredPaymentIdShort); + waiter.assertEquals(orderStatus.getIncomingAmountTotal(), xmrAmountTotal); + waiter.assertEquals(orderStatus.getRemainingAmountIncoming(), xmrAmountRemaining); + waiter.assertEquals(orderStatus.getIncomingNumConfirmationsRemaining(), xmrNumConfirmationsRemaining); + waiter.assertEquals(orderStatus.getIncomingPriceBtc(), xmrPriceBtc); + waiter.assertEquals(orderStatus.getReceivingSubaddress(), xmrReceivingSubaddress); + waiter.assertEquals(orderStatus.getRecommendedMixin(), xmrRecommendedMixin); waiter.resume(); } @@ -260,9 +239,7 @@ public class XmrToApiQueryOrderTest { final double btcAmount, final String btcDestAddress, final String uuid, - final int btcNumConfirmations, final int btcNumConfirmationsBeforePurge, - final String btcTransactionId, final String createdAt, final String expiresAt, final int secondsTillTimeout, @@ -271,35 +248,23 @@ public class XmrToApiQueryOrderTest { final int xmrNumConfirmationsRemaining, final double xmrPriceBtc, final String xmrReceivingSubaddress, - final String xmrReceivingAddress, - final String xmrReceivingIntegratedAddress, - final int xmrRecommendedMixin, - final double xmrRequiredAmount, - final String xmrRequiredPaymentIdLong, - final String xmrRequiredPaymentIdShort + final int xmrRecommendedMixin ) { return "{\n" + - " \"xmr_price_btc\": \"" + xmrPriceBtc + "\",\n" + + " \"incoming_price_btc\": \"" + xmrPriceBtc + "\",\n" + " \"uuid\":\"" + uuid + "\",\n" + " \"state\":\"" + state + "\",\n" + " \"btc_amount\":\"" + btcAmount + "\",\n" + " \"btc_dest_address\":\"" + btcDestAddress + "\",\n" + - " \"xmr_required_amount\":\"" + xmrRequiredAmount + "\",\n" + - " \"xmr_receiving_subaddress\":\"" + xmrReceivingSubaddress + "\",\n" + - " \"xmr_receiving_address\":\"" + xmrReceivingAddress + "\",\n" + - " \"xmr_receiving_integrated_address\":\"" + xmrReceivingIntegratedAddress + "\",\n" + - " \"xmr_required_payment_id_long\":\"" + xmrRequiredPaymentIdLong + "\",\n" + - " \"xmr_required_payment_id_short\":\"" + xmrRequiredPaymentIdShort + "\",\n" + + " \"receiving_subaddress\":\"" + xmrReceivingSubaddress + "\",\n" + " \"created_at\":\"" + createdAt + "\",\n" + " \"expires_at\":\"" + expiresAt + "\",\n" + " \"seconds_till_timeout\":\"" + secondsTillTimeout + "\",\n" + - " \"xmr_amount_total\":\"" + xmrAmountTotal + "\",\n" + - " \"xmr_amount_remaining\":\"" + xmrAmountRemaining + "\",\n" + - " \"xmr_num_confirmations_remaining\":\"" + xmrNumConfirmationsRemaining + "\",\n" + - " \"xmr_recommended_mixin\":\"" + xmrRecommendedMixin + "\",\n" + - " \"btc_num_confirmations_before_purge\":\"" + btcNumConfirmationsBeforePurge + "\",\n" + - " \"btc_num_confirmations\":\"" + btcNumConfirmations + "\",\n" + - " \"btc_transaction_id\":\"" + btcTransactionId + "\"" + " \"incoming_amount_total\":\"" + xmrAmountTotal + "\",\n" + + " \"remaining_amount_incoming\":\"" + xmrAmountRemaining + "\",\n" + + " \"incoming_num_confirmations_remaining\":\"" + xmrNumConfirmationsRemaining + "\",\n" + + " \"recommended_mixin\":\"" + xmrRecommendedMixin + "\",\n" + + " \"btc_num_confirmations_threshold\":\"" + btcNumConfirmationsBeforePurge + "\",\n" + "}"; } } \ No newline at end of file