mirror of
https://github.com/m2049r/xmrwallet
synced 2025-09-03 08:23:04 +02:00
Compare commits
17 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
f00da6ecda | ||
![]() |
1cecd0b718 | ||
![]() |
a0d6117bbb | ||
![]() |
0b0648a172 | ||
![]() |
775dcf01ae | ||
![]() |
aed4051d44 | ||
![]() |
a586c0781a | ||
![]() |
616d93cb18 | ||
![]() |
73d9cb6d58 | ||
![]() |
9846e8b5cf | ||
![]() |
aa66a12dac | ||
![]() |
65ce9b0889 | ||
![]() |
291e311b8a | ||
![]() |
41290f51fd | ||
![]() |
a11c898e2c | ||
![]() |
9c921183ab | ||
![]() |
835a35c6a8 |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -14,3 +14,4 @@
|
||||
/app/prodMainnet
|
||||
/app/alphaStagenet
|
||||
/app/prodStagenet
|
||||
/app/.cxx
|
||||
|
@@ -2,13 +2,13 @@ apply plugin: 'com.android.application'
|
||||
|
||||
android {
|
||||
compileSdkVersion 28
|
||||
buildToolsVersion '28.0.3'
|
||||
buildToolsVersion '29.0.2'
|
||||
defaultConfig {
|
||||
applicationId "com.m2049r.xmrwallet"
|
||||
minSdkVersion 21
|
||||
targetSdkVersion 28
|
||||
versionCode 202
|
||||
versionName "1.12.12 'Caerbannog'"
|
||||
versionCode 302
|
||||
versionName "1.13.2 'ReStart'"
|
||||
|
||||
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
|
||||
externalNativeBuild {
|
||||
|
@@ -785,7 +785,7 @@ Java_com_m2049r_xmrwallet_model_Wallet_getDaemonBlockChainTargetHeight(JNIEnv *e
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_m2049r_xmrwallet_model_Wallet_isSynchronized(JNIEnv *env, jobject instance) {
|
||||
Java_com_m2049r_xmrwallet_model_Wallet_isSynchronizedJ(JNIEnv *env, jobject instance) {
|
||||
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
|
||||
return static_cast<jboolean>(wallet->synchronized());
|
||||
}
|
||||
@@ -909,6 +909,16 @@ Java_com_m2049r_xmrwallet_model_Wallet_refreshAsync(JNIEnv *env, jobject instanc
|
||||
wallet->refreshAsync();
|
||||
}
|
||||
|
||||
//TODO virtual bool rescanBlockchain() = 0;
|
||||
|
||||
//virtual void rescanBlockchainAsync() = 0;
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_m2049r_xmrwallet_model_Wallet_rescanBlockchainAsync(JNIEnv *env, jobject instance) {
|
||||
Bitmonero::Wallet *wallet = getHandle<Bitmonero::Wallet>(env, instance);
|
||||
wallet->rescanBlockchainAsync();
|
||||
}
|
||||
|
||||
|
||||
//TODO virtual void setAutoRefreshInterval(int millis) = 0;
|
||||
//TODO virtual int autoRefreshInterval() const = 0;
|
||||
|
||||
|
@@ -217,6 +217,20 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
|
||||
releaseWakeLock();
|
||||
}
|
||||
|
||||
private void onWalletRescan() {
|
||||
try {
|
||||
final WalletFragment walletFragment = (WalletFragment)
|
||||
getSupportFragmentManager().findFragmentByTag(WalletFragment.class.getName());
|
||||
getWallet().rescanBlockchainAsync();
|
||||
synced = false;
|
||||
walletFragment.unsync();
|
||||
invalidateOptionsMenu();
|
||||
} catch (ClassCastException ex) {
|
||||
Timber.d(ex.getLocalizedMessage());
|
||||
// keep calm and carry on
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onStop() {
|
||||
Timber.d("onStop()");
|
||||
@@ -243,7 +257,7 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
|
||||
public boolean onPrepareOptionsMenu(Menu menu) {
|
||||
MenuItem renameItem = menu.findItem(R.id.action_rename);
|
||||
if (renameItem != null)
|
||||
renameItem.setVisible(hasWallet() && getWallet().isSynchronized());
|
||||
renameItem.setEnabled(hasWallet() && getWallet().isSynchronized());
|
||||
MenuItem streetmodeItem = menu.findItem(R.id.action_streetmode);
|
||||
if (streetmodeItem != null)
|
||||
if (isStreetMode()) {
|
||||
@@ -251,12 +265,18 @@ public class WalletActivity extends BaseActivity implements WalletFragment.Liste
|
||||
} else {
|
||||
streetmodeItem.setIcon(R.drawable.gunther_24dp);
|
||||
}
|
||||
final MenuItem rescanItem = menu.findItem(R.id.action_rescan);
|
||||
if (rescanItem != null)
|
||||
rescanItem.setEnabled(isSynced());
|
||||
return super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onOptionsItemSelected(MenuItem item) {
|
||||
switch (item.getItemId()) {
|
||||
case R.id.action_rescan:
|
||||
onWalletRescan();
|
||||
return true;
|
||||
case R.id.action_info:
|
||||
onWalletDetails();
|
||||
return true;
|
||||
|
@@ -356,6 +356,15 @@ public class WalletFragment extends Fragment
|
||||
if (isVisible()) enableAccountsList(true); //otherwise it is enabled in onResume()
|
||||
}
|
||||
|
||||
public void unsync() {
|
||||
if (!activityCallback.isWatchOnly()) {
|
||||
bSend.setVisibility(View.INVISIBLE);
|
||||
bSend.setEnabled(false);
|
||||
}
|
||||
if (isVisible()) enableAccountsList(false); //otherwise it is enabled in onResume()
|
||||
firstBlock = 0;
|
||||
}
|
||||
|
||||
boolean walletLoaded = false;
|
||||
|
||||
public void onLoaded() {
|
||||
|
@@ -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();
|
||||
|
@@ -130,9 +130,9 @@ public class NodeInfoAdapter extends RecyclerView.Adapter<NodeInfoAdapter.ViewHo
|
||||
|
||||
private void showStar() {
|
||||
if (nodeItem.isFavourite()) {
|
||||
ibBookmark.setImageResource(R.drawable.ic_bookmark_24dp);
|
||||
ibBookmark.setImageResource(R.drawable.ic_favorite_24dp);
|
||||
} else {
|
||||
ibBookmark.setImageResource(R.drawable.ic_bookmark_border_24dp);
|
||||
ibBookmark.setImageResource(R.drawable.ic_favorite_border_24dp);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -248,7 +248,13 @@ public class Wallet {
|
||||
|
||||
public native long getDaemonBlockChainTargetHeight();
|
||||
|
||||
public native boolean isSynchronized();
|
||||
public native boolean isSynchronizedJ();
|
||||
|
||||
public boolean isSynchronized() {
|
||||
final long daemonHeight = getDaemonBlockChainHeight();
|
||||
if (daemonHeight == 0) return false;
|
||||
return isSynchronizedJ() && (getBlockChainHeight() == daemonHeight);
|
||||
}
|
||||
|
||||
public static native String getDisplayAmount(long amount);
|
||||
|
||||
@@ -278,6 +284,8 @@ public class Wallet {
|
||||
|
||||
public native void refreshAsync();
|
||||
|
||||
public native void rescanBlockchainAsync();
|
||||
|
||||
//TODO virtual void setAutoRefreshInterval(int millis) = 0;
|
||||
//TODO virtual int autoRefreshInterval() const = 0;
|
||||
|
||||
|
@@ -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/");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -113,6 +113,9 @@ public class RestoreHeight {
|
||||
blockheight.put("2020-01-01", 2001315L);
|
||||
blockheight.put("2020-02-01", 2023656L);
|
||||
blockheight.put("2020-03-01", 2044552L);
|
||||
blockheight.put("2020-04-01", 2066806L);
|
||||
blockheight.put("2020-05-01", 2088411L);
|
||||
blockheight.put("2020-06-01", 2110702L);
|
||||
}
|
||||
|
||||
public long getHeight(String date) {
|
||||
|
@@ -68,15 +68,19 @@ public class ExchangeEditText extends LinearLayout {
|
||||
}
|
||||
boolean ok = true;
|
||||
String nativeAmount = getNativeAmount();
|
||||
try {
|
||||
double amount = Double.parseDouble(nativeAmount);
|
||||
if ((amount < min) || (amount > max)) {
|
||||
if (nativeAmount == null) {
|
||||
ok = false;
|
||||
} else {
|
||||
try {
|
||||
double amount = Double.parseDouble(nativeAmount);
|
||||
if ((amount < min) || (amount > max)) {
|
||||
ok = false;
|
||||
}
|
||||
} catch (NumberFormatException ex) {
|
||||
// this cannot be
|
||||
Timber.e(ex.getLocalizedMessage());
|
||||
ok = false;
|
||||
}
|
||||
} catch (NumberFormatException ex) {
|
||||
// this cannot be
|
||||
Timber.e(ex.getLocalizedMessage());
|
||||
ok = false;
|
||||
}
|
||||
if (!ok) {
|
||||
shakeAmountField();
|
||||
|
@@ -43,47 +43,31 @@ public interface QueryOrderStatus {
|
||||
|
||||
boolean isError();
|
||||
|
||||
State getState(); // "state": "<order_state_as_string>",
|
||||
QueryOrderStatus.State getState();
|
||||
|
||||
double getBtcAmount(); // "btc_amount": <requested_amount_in_btc_as_float>,
|
||||
double getBtcAmount();
|
||||
|
||||
String getBtcDestAddress(); // "btc_dest_address": "<requested_destination_address_as_string>",
|
||||
String getBtcDestAddress();
|
||||
|
||||
String getUuid(); // "uuid": "<unique_order_identifier_as_12_character_string>"
|
||||
String getUuid();
|
||||
|
||||
int getBtcNumConfirmations(); // "btc_num_confirmations": <btc_num_confirmations_as_integer>,
|
||||
int getBtcNumConfirmationsThreshold();
|
||||
|
||||
int getBtcNumConfirmationsBeforePurge(); // "btc_num_confirmations_before_purge": <btc_num_confirmations_before_purge_as_integer>,
|
||||
Date getCreatedAt();
|
||||
|
||||
String getBtcTransactionId(); // "btc_transaction_id": "<btc_transaction_id_as_string>",
|
||||
Date getExpiresAt();
|
||||
|
||||
Date getCreatedAt(); // "created_at": "<timestamp_as_string>",
|
||||
int getSecondsTillTimeout();
|
||||
|
||||
Date getExpiresAt(); // "expires_at": "<timestamp_as_string>",
|
||||
double getIncomingAmountTotal();
|
||||
|
||||
int getSecondsTillTimeout(); // "seconds_till_timeout": <seconds_till_timeout_as_integer>,
|
||||
double getRemainingAmountIncoming();
|
||||
|
||||
double getXmrAmountTotal(); // "xmr_amount_total": <amount_in_xmr_for_this_order_as_float>,
|
||||
int getIncomingNumConfirmationsRemaining();
|
||||
|
||||
double getXmrAmountRemaining(); // "xmr_amount_remaining": <amount_in_xmr_that_the_user_must_still_send_as_float>,
|
||||
double getIncomingPriceBtc();
|
||||
|
||||
int getXmrNumConfirmationsRemaining(); // "xmr_num_confirmations_remaining": <num_xmr_confirmations_remaining_before_bitcoins_will_be_sent_as_integer>,
|
||||
|
||||
double getXmrPriceBtc(); // "xmr_price_btc": <price_of_1_btc_in_xmr_as_offered_by_service_as_float>,
|
||||
|
||||
String getXmrReceivingAddress(); // "xmr_receiving_address": "xmr_old_style_address_user_can_send_funds_to_as_string",
|
||||
|
||||
String getXmrReceivingSubaddress(); // <xmr_subaddress_user_needs_to_send_funds_to_as_string>,
|
||||
|
||||
String getXmrReceivingIntegratedAddress(); // "xmr_receiving_integrated_address": "xmr_integrated_address_user_needs_to_send_funds_to_as_string",
|
||||
|
||||
int getXmrRecommendedMixin(); // "xmr_recommended_mixin": <xmr_recommended_mixin_as_integer>,
|
||||
|
||||
@Deprecated
|
||||
double getXmrRequiredAmount(); // "xmr_required_amount": <xmr_amount_user_needs_to_send_as_float>,
|
||||
|
||||
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();
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
||||
|
@@ -42,23 +42,17 @@ class QueryOrderStatusImpl implements QueryOrderStatus {
|
||||
private String btcDestAddress; // "btc_dest_address": "<requested_destination_address_as_string>",
|
||||
private String uuid; // "uuid": "<unique_order_identifier_as_12_character_string>"
|
||||
// the following are only returned if the state is "after" TO_BE_CREATED
|
||||
private int btcNumConfirmations; // "btc_num_confirmations": <btc_num_confirmations_as_integer>,
|
||||
private int btcNumConfirmationsBeforePurge; // "btc_num_confirmations_before_purge": <btc_num_confirmations_before_purge_as_integer>,
|
||||
private String btcTransactionId; // "btc_transaction_id": "<btc_transaction_id_as_string>",
|
||||
//private int btcNumConfirmations; // "btc_num_confirmations": <btc_num_confirmations_as_integer>,
|
||||
private int btcNumConfirmationsThreshold; // "btc_num_confirmations_threshold": <btc_num_confirmations_threshold_as_integer>,
|
||||
private Date createdAt; // "created_at": "<timestamp_as_string>",
|
||||
private Date expiresAt; // "expires_at": "<timestamp_as_string>",
|
||||
private int secondsTillTimeout; // "seconds_till_timeout": <seconds_till_timeout_as_integer>,
|
||||
private double xmrAmountTotal; // "xmr_amount_total": <amount_in_xmr_for_this_order_as_float>,
|
||||
private double xmrAmountRemaining; // "xmr_amount_remaining": <amount_in_xmr_that_the_user_must_still_send_as_float>,
|
||||
private int xmrNumConfirmationsRemaining; // "xmr_num_confirmations_remaining": <num_xmr_confirmations_remaining_before_bitcoins_will_be_sent_as_integer>,
|
||||
private double xmrPriceBtc; // "xmr_price_btc": <price_of_1_btc_in_xmr_as_offered_by_service_as_float>,
|
||||
private String xmrReceivingSubaddress; // <xmr_subaddress_user_needs_to_send_funds_to_as_string>,
|
||||
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": <xmr_recommended_mixin_as_integer>,
|
||||
private double xmrRequiredAmount; // "xmr_required_amount": <xmr_amount_user_needs_to_send_as_float>,
|
||||
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": <amount_in_incoming_currency_for_this_order_as_float>,
|
||||
private double remainingAmountIncoming; // "remaining_amount_incoming": <amount_in_incoming_currency_that_the_user_must_still_send_as_float>,
|
||||
private int incomingNumConfirmationsRemaining; // "incoming_num_confirmations_remaining": <num_incoming_currency_confirmations_remaining_before_bitcoins_will_be_sent_as_integer>,
|
||||
private double incomingPriceBtc; // "incoming_price_btc": <price_of_1_incoming_in_btc_currency_as_offered_by_service_as_float>,
|
||||
private String receivingSubaddress; // "receiving_subaddress": <xmr_subaddress_user_needs_to_send_funds_to_as_string>,
|
||||
private int recommendedMixin; // "recommended_mixin": <recommended_mixin_as_integer>,
|
||||
|
||||
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": "<unique_order_identifier_as_12_character_string>"
|
||||
|
||||
if (isCreated()) {
|
||||
btcNumConfirmations = jsonObject.getInt("btc_num_confirmations"); // "btc_num_confirmations": <btc_num_confirmations_as_integer>,
|
||||
btcNumConfirmationsBeforePurge = jsonObject.getInt("btc_num_confirmations_before_purge"); // "btc_num_confirmations_before_purge": <btc_num_confirmations_before_purge_as_integer>,
|
||||
btcTransactionId = jsonObject.getString("btc_transaction_id"); // "btc_transaction_id": "<btc_transaction_id_as_string>",
|
||||
btcNumConfirmationsThreshold = jsonObject.getInt("btc_num_confirmations_threshold");
|
||||
try {
|
||||
String created = jsonObject.getString("created_at"); // "created_at": "<timestamp_as_string>",
|
||||
String created = jsonObject.getString("created_at");
|
||||
createdAt = parseDate(created);
|
||||
String expires = jsonObject.getString("expires_at"); // "expires_at": "<timestamp_as_string>",
|
||||
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": <seconds_till_timeout_as_integer>,
|
||||
xmrAmountTotal = jsonObject.getDouble("xmr_amount_total"); // "xmr_amount_total": <amount_in_xmr_for_this_order_as_float>,
|
||||
xmrAmountRemaining = jsonObject.getDouble("xmr_amount_remaining"); // "xmr_amount_remaining": <amount_in_xmr_that_the_user_must_still_send_as_float>,
|
||||
xmrNumConfirmationsRemaining = jsonObject.getInt("xmr_num_confirmations_remaining"); // "xmr_num_confirmations_remaining": <num_xmr_confirmations_remaining_before_bitcoins_will_be_sent_as_integer>,
|
||||
xmrPriceBtc = jsonObject.getDouble("xmr_price_btc"); // "xmr_price_btc": <price_of_1_btc_in_xmr_as_offered_by_service_as_float>,
|
||||
xmrReceivingSubaddress = jsonObject.getString("xmr_receiving_subaddress"); // <xmr_subaddress_user_needs_to_send_funds_to_as_string>,
|
||||
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": <xmr_recommended_mixin_as_integer>,
|
||||
xmrRequiredAmount = jsonObject.getDouble("xmr_required_amount"); // "xmr_required_amount": <xmr_amount_user_needs_to_send_as_float>,
|
||||
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");
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -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<CreateOrder> callback) {
|
||||
|
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@color/gradientPink"
|
||||
android:pathData="M17,3H7c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3V5c0,-1.1 -0.9,-2 -2,-2z" />
|
||||
</vector>
|
@@ -1,9 +0,0 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@color/gradientPink"
|
||||
android:pathData="M17,3L7,3c-1.1,0 -1.99,0.9 -1.99,2L5,21l7,-3 7,3L19,5c0,-1.1 -0.9,-2 -2,-2zM17,18l-5,-2.18L7,18L7,5h10v13z" />
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_favorite_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_favorite_24dp.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@color/gradientPink"
|
||||
android:pathData="M12,21.35l-1.45,-1.32C5.4,15.36 2,12.28 2,8.5 2,5.42 4.42,3 7.5,3c1.74,0 3.41,0.81 4.5,2.09C13.09,3.81 14.76,3 16.5,3 19.58,3 22,5.42 22,8.5c0,3.78 -3.4,6.86 -8.55,11.54L12,21.35z"/>
|
||||
</vector>
|
9
app/src/main/res/drawable/ic_favorite_border_24dp.xml
Normal file
9
app/src/main/res/drawable/ic_favorite_border_24dp.xml
Normal file
@@ -0,0 +1,9 @@
|
||||
<vector xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
android:width="24dp"
|
||||
android:height="24dp"
|
||||
android:viewportWidth="24.0"
|
||||
android:viewportHeight="24.0">
|
||||
<path
|
||||
android:fillColor="@color/gradientPink"
|
||||
android:pathData="M16.5,3c-1.74,0 -3.41,0.81 -4.5,2.09C10.91,3.81 9.24,3 7.5,3 4.42,3 2,5.42 2,8.5c0,3.78 3.4,6.86 8.55,11.54L12,21.35l1.45,-1.32C18.6,15.36 22,12.28 22,8.5 22,5.42 19.58,3 16.5,3zM12.1,18.55l-0.1,0.1 -0.1,-0.1C7.14,14.24 4,11.39 4,8.5 4,6.5 5.5,5 7.5,5c1.54,0 3.04,0.99 3.57,2.36h1.87C13.46,5.99 14.96,5 16.5,5c2,0 3.5,1.5 3.5,3.5 0,2.89 -3.14,5.74 -7.9,10.05z"/>
|
||||
</vector>
|
@@ -18,7 +18,7 @@
|
||||
android:padding="12dp"
|
||||
android:background="?android:attr/selectableItemBackgroundBorderless"
|
||||
android:gravity="center"
|
||||
android:src="@drawable/ic_bookmark_border_24dp" />
|
||||
android:src="@drawable/ic_favorite_border_24dp" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llNode"
|
||||
|
@@ -34,4 +34,9 @@
|
||||
android:title="@string/menu_info"
|
||||
app:showAsAction="never" />
|
||||
|
||||
<item
|
||||
android:id="@+id/action_rescan"
|
||||
android:orderInCategory="600"
|
||||
android:title="@string/menu_rescan"
|
||||
app:showAsAction="never" />
|
||||
</menu>
|
@@ -383,4 +383,6 @@
|
||||
<string name="label_restoreheight">Restablir Alçada</string> <!-- Restore Height -->
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -386,4 +386,6 @@
|
||||
<string name="label_restoreheight">Wiederherstellungshöhe</string>
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -385,4 +385,6 @@
|
||||
<string name="label_restoreheight">Ύψος ανάκτησης</string> <!-- "Restore Height" -->
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -385,4 +385,6 @@
|
||||
<string name="label_restoreheight">Restaŭralteco</string> <!-- Restore Height -->
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -375,4 +375,6 @@
|
||||
<string name="label_restoreheight">Altura de Restauración</string> <!-- Restore Height -->
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -383,4 +383,6 @@
|
||||
<string name="label_restoreheight">Taastamise plokinumber</string> <!-- Restore Height -->
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -389,4 +389,6 @@
|
||||
<string name="label_restoreheight">Hauteur de restauration</string> <!-- Restore Height -->
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -387,4 +387,6 @@
|
||||
<string name="label_restoreheight">Visszaállítási lánchossz</string> <!-- Restore Height -->
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -388,4 +388,6 @@
|
||||
<string name="label_restoreheight">Altezza di ripristino</string> <!-- Restore Height -->
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -394,4 +394,6 @@
|
||||
<string name="label_restoreheight">Restore Height</string>
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
@@ -385,4 +385,6 @@
|
||||
<string name="label_restoreheight">Restore Height</string>
|
||||
|
||||
<string name="toast_ledger_start_app">Start Monero App on %1$s</string>
|
||||
|
||||
<string name="menu_rescan">Rescan!</string>
|
||||
</resources>
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user