Skip to content

Commit

Permalink
Merge pull request #2413 from ManfredKarrer/increase-trade-limits
Browse files Browse the repository at this point in the history
Increase trade limit. Make trade limit a DAO parameter
  • Loading branch information
ripcurlx authored Feb 15, 2019
2 parents 83d9426 + 2b954c3 commit e5dd9a2
Show file tree
Hide file tree
Showing 34 changed files with 313 additions and 1,258 deletions.
9 changes: 6 additions & 3 deletions common/src/main/proto/pb.proto
Original file line number Diff line number Diff line change
Expand Up @@ -710,14 +710,14 @@ message PaymentAccountPayload {
CryptoCurrencyAccountPayload crypto_currency_account_payload = 8;
FasterPaymentsAccountPayload faster_payments_account_payload = 9;
InteracETransferAccountPayload interac_e_transfer_account_payload = 10;
OKPayAccountPayload o_k_pay_account_payload = 11;
OKPayAccountPayload o_k_pay_account_payload = 11; // Deprecated, not used anymore
PerfectMoneyAccountPayload perfect_money_account_payload = 12;
SwishAccountPayload swish_account_payload = 13;
USPostalMoneyOrderAccountPayload u_s_postal_money_order_account_payload = 14;
UpholdAccountPayload uphold_account_payload = 16;
CashAppAccountPayload cash_app_account_payload = 17;
CashAppAccountPayload cash_app_account_payload = 17; // Deprecated, not used anymore
MoneyBeamAccountPayload money_beam_account_payload = 18;
VenmoAccountPayload venmo_account_payload = 19;
VenmoAccountPayload venmo_account_payload = 19; // Deprecated, not used anymore
PopmoneyAccountPayload popmoney_account_payload = 20;
RevolutAccountPayload revolut_account_payload = 21;
WeChatPayAccountPayload we_chat_pay_account_payload = 22;
Expand Down Expand Up @@ -849,6 +849,7 @@ message InteracETransferAccountPayload {
string answer = 4;
}

// Deprecated, not used anymore
message OKPayAccountPayload {
string account_nr = 1;
}
Expand All @@ -857,6 +858,7 @@ message UpholdAccountPayload {
string account_id = 1;
}

// Deprecated, not used anymore
message CashAppAccountPayload {
string cash_tag = 1;
}
Expand All @@ -865,6 +867,7 @@ message MoneyBeamAccountPayload {
string account_id = 1;
}

// Deprecated, not used anymore
message VenmoAccountPayload {
string venmo_user_name = 1;
string holder_name = 2;
Expand Down
3 changes: 3 additions & 0 deletions core/src/main/java/bisq/core/CoreModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import bisq.core.notifications.alerts.market.MarketAlerts;
import bisq.core.notifications.alerts.price.PriceAlert;
import bisq.core.offer.OfferModule;
import bisq.core.payment.TradeLimits;
import bisq.core.presentation.CorePresentationModule;
import bisq.core.proto.network.CoreNetworkProtoResolver;
import bisq.core.proto.persistable.CorePersistenceProtoResolver;
Expand Down Expand Up @@ -87,6 +88,8 @@ protected void configure() {

bind(BisqEnvironment.class).toInstance((BisqEnvironment) environment);

bind(TradeLimits.class).in(Singleton.class);

bind(KeyStorage.class).in(Singleton.class);
bind(KeyRing.class).in(Singleton.class);
bind(User.class).in(Singleton.class);
Expand Down
7 changes: 5 additions & 2 deletions core/src/main/java/bisq/core/app/BisqSetup.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import bisq.core.offer.OpenOfferManager;
import bisq.core.payment.AccountAgeWitnessService;
import bisq.core.payment.PaymentAccount;
import bisq.core.payment.payload.PaymentMethod;
import bisq.core.payment.TradeLimits;
import bisq.core.provider.fee.FeeService;
import bisq.core.provider.price.PriceFeedService;
import bisq.core.trade.TradeManager;
Expand Down Expand Up @@ -151,6 +151,7 @@ public interface BisqSetupCompleteListener {
private final AssetTradeActivityCheck tradeActivityCheck;
private final AssetService assetService;
private final TorSetup torSetup;
private final TradeLimits tradeLimits;
private final BSFormatter formatter;
@Setter
@Nullable
Expand Down Expand Up @@ -228,6 +229,7 @@ public BisqSetup(P2PNetworkSetup p2PNetworkSetup,
AssetTradeActivityCheck tradeActivityCheck,
AssetService assetService,
TorSetup torSetup,
TradeLimits tradeLimits,
BSFormatter formatter) {


Expand Down Expand Up @@ -267,6 +269,7 @@ public BisqSetup(P2PNetworkSetup p2PNetworkSetup,
this.tradeActivityCheck = tradeActivityCheck;
this.assetService = assetService;
this.torSetup = torSetup;
this.tradeLimits = tradeLimits;
this.formatter = formatter;
}

Expand Down Expand Up @@ -592,7 +595,7 @@ private void initDomainServices() {

clock.start();

PaymentMethod.onAllServicesInitialized();
tradeLimits.onAllServicesInitialized();

disputeManager.onAllServicesInitialized();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ public enum Param {

LOCK_TIME_TRADE_PAYOUT("4320", ParamType.BLOCK), // 30 days
ARBITRATOR_FEE("0", ParamType.BTC),
MAX_TRADE_LIMIT("2", ParamType.BTC), // max trade limit for lowest risk payment method. Others will get derived from that.

// See: https://github.com/bisq-network/proposals/issues/46
// The last block in the proposal and vote phases are not shown to the user as he cannot make a tx there as it would be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,19 @@ public void validateParamValue(Param param, String inputValue) throws Validation
case RECIPIENT_BTC_ADDRESS:
break;

case ASSET_LISTING_FEE_PER_DAY:
break;
case ASSET_MIN_VOLUME:
break;

case LOCK_TIME_TRADE_PAYOUT:
break;
case ARBITRATOR_FEE:
break;

case MAX_TRADE_LIMIT:
break;

case PHASE_UNDEFINED:
break;
case PHASE_PROPOSAL:
Expand Down
29 changes: 0 additions & 29 deletions core/src/main/java/bisq/core/locale/CurrencyUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,6 @@ public static List<CryptoCurrency> getRemovedCryptoCurrencies() {
return currencies;
}

// At OKPay you can exchange internally those currencies
public static List<TradeCurrency> getAllAdvancedCashCurrencies() {
ArrayList<TradeCurrency> currencies = new ArrayList<>(Arrays.asList(
new FiatCurrency("USD"),
Expand All @@ -170,34 +169,6 @@ public static List<TradeCurrency> getAllAdvancedCashCurrencies() {
return currencies;
}

public static List<TradeCurrency> getAllOKPayCurrencies() {
ArrayList<TradeCurrency> currencies = new ArrayList<>(Arrays.asList(
new FiatCurrency("EUR"),
new FiatCurrency("USD"),
new FiatCurrency("GBP"),
new FiatCurrency("CHF"),
new FiatCurrency("RUB"),
new FiatCurrency("PLN"),
new FiatCurrency("JPY"),
new FiatCurrency("CAD"),
new FiatCurrency("AUD"),
new FiatCurrency("CZK"),
new FiatCurrency("NOK"),
new FiatCurrency("SEK"),
new FiatCurrency("DKK"),
new FiatCurrency("HRK"),
new FiatCurrency("HUF"),
new FiatCurrency("NZD"),
new FiatCurrency("RON"),
new FiatCurrency("TRY"),
new FiatCurrency("ZAR"),
new FiatCurrency("HKD"),
new FiatCurrency("CNY")
));
currencies.sort(Comparator.comparing(TradeCurrency::getCode));
return currencies;
}

public static List<TradeCurrency> getAllMoneyGramCurrencies() {
ArrayList<TradeCurrency> currencies = new ArrayList<>(Arrays.asList(
new FiatCurrency("AED"),
Expand Down
4 changes: 1 addition & 3 deletions core/src/main/java/bisq/core/offer/Offer.java
Original file line number Diff line number Diff line change
Expand Up @@ -314,9 +314,7 @@ public Date getDate() {
}

public PaymentMethod getPaymentMethod() {
return new PaymentMethod(offerPayload.getPaymentMethodId(),
offerPayload.getMaxTradePeriod(),
Coin.valueOf(offerPayload.getMaxTradeLimit()));
return PaymentMethod.getPaymentMethodById(offerPayload.getPaymentMethodId());
}

// utils
Expand Down
48 changes: 0 additions & 48 deletions core/src/main/java/bisq/core/payment/CashAppAccount.java

This file was deleted.

47 changes: 0 additions & 47 deletions core/src/main/java/bisq/core/payment/OKPayAccount.java

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,10 @@
public class PaymentAccountFactory {
public static PaymentAccount getPaymentAccount(PaymentMethod paymentMethod) {
switch (paymentMethod.getId()) {
case PaymentMethod.OK_PAY_ID:
return new OKPayAccount();
case PaymentMethod.UPHOLD_ID:
return new UpholdAccount();
case PaymentMethod.CASH_APP_ID:
return new CashAppAccount();
case PaymentMethod.MONEY_BEAM_ID:
return new MoneyBeamAccount();
case PaymentMethod.VENMO_ID:
return new VenmoAccount();
case PaymentMethod.POPMONEY_ID:
return new PopmoneyAccount();
case PaymentMethod.REVOLUT_ID:
Expand Down
4 changes: 2 additions & 2 deletions core/src/main/java/bisq/core/payment/PaymentAccountUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public static String getBankId(PaymentAccount paymentAccount) {

@Nullable
public static String getCountryCode(PaymentAccount paymentAccount) {
// That is optional and set to null if not supported (AltCoins, OKPay,...)
// That is optional and set to null if not supported (AltCoins,...)
if (paymentAccount instanceof CountryBasedPaymentAccount) {
Country country = (((CountryBasedPaymentAccount) paymentAccount)).getCountry();
return country != null ? country.code : null;
Expand All @@ -115,7 +115,7 @@ public static String getCountryCode(PaymentAccount paymentAccount) {
}

// TODO no code duplication found in UI code (added for API)
// That is optional and set to null if not supported (AltCoins, OKPay,...)
// That is optional and set to null if not supported (AltCoins,...)
/* public static String getCountryCode(PaymentAccount paymentAccount) {
if (paymentAccount instanceof CountryBasedPaymentAccount) {
Country country = ((CountryBasedPaymentAccount) paymentAccount).getCountry();
Expand Down
Loading

0 comments on commit e5dd9a2

Please sign in to comment.