monero spec, from what i've found, says to use tx_amount for amount in uri. some places just use "amount" like BTC or other coins like that

This commit is contained in:
pokkst 2022-09-20 12:09:24 -05:00
parent 5bbfd5f8b2
commit ca7684b83a
No known key found for this signature in database
GPG Key ID: 90C2ED85E67A50FF
2 changed files with 7 additions and 2 deletions

View File

@ -12,5 +12,6 @@ public class Constants {
public static final String URI_PREFIX = "monero:"; public static final String URI_PREFIX = "monero:";
public static final String URI_ARG_AMOUNT = "tx_amount"; public static final String URI_ARG_AMOUNT = "tx_amount";
public static final String URI_ARG_AMOUNT2 = "amount";
public static final String NAV_ARG_TXINFO = "nav_arg_txinfo"; public static final String NAV_ARG_TXINFO = "nav_arg_txinfo";
} }

View File

@ -22,11 +22,15 @@ public class UriData {
} }
public String getAmount() { public String getAmount() {
return params.get(Constants.URI_ARG_AMOUNT); String txAmount = params.get(Constants.URI_ARG_AMOUNT);
if(txAmount == null) {
return params.get(Constants.URI_ARG_AMOUNT2);
}
return txAmount;
} }
public boolean hasAmount() { public boolean hasAmount() {
return params.containsKey(Constants.URI_ARG_AMOUNT); return params.containsKey(Constants.URI_ARG_AMOUNT) || params.containsKey(Constants.URI_ARG_AMOUNT2);
} }
public static UriData parse(String uri) { public static UriData parse(String uri) {