Search in sources :

Example 1 with PerfectMoneyAccount

use of bisq.core.payment.PerfectMoneyAccount in project bisq-desktop by bisq-network.

the class MainViewModel method setupDevDummyPaymentAccounts.

private void setupDevDummyPaymentAccounts() {
    if (user.getPaymentAccounts() != null && user.getPaymentAccounts().isEmpty()) {
        PerfectMoneyAccount perfectMoneyAccount = new PerfectMoneyAccount();
        perfectMoneyAccount.init();
        perfectMoneyAccount.setAccountNr("dummy_" + new Random().nextInt(100));
        // Don't translate only for dev
        perfectMoneyAccount.setAccountName("PerfectMoney dummy");
        perfectMoneyAccount.setSelectedTradeCurrency(GlobalSettings.getDefaultTradeCurrency());
        user.addPaymentAccount(perfectMoneyAccount);
        if (p2PService.isBootstrapped()) {
            accountAgeWitnessService.publishMyAccountAgeWitness(perfectMoneyAccount.getPaymentAccountPayload());
        } else {
            p2PService.addP2PServiceListener(new BootstrapListener() {

                @Override
                public void onUpdatedDataReceived() {
                    accountAgeWitnessService.publishMyAccountAgeWitness(perfectMoneyAccount.getPaymentAccountPayload());
                }
            });
        }
        CryptoCurrencyAccount cryptoCurrencyAccount = new CryptoCurrencyAccount();
        cryptoCurrencyAccount.init();
        // Don't translate only for dev
        cryptoCurrencyAccount.setAccountName("ETH dummy");
        cryptoCurrencyAccount.setAddress("0x" + new Random().nextInt(1000000));
        cryptoCurrencyAccount.setSingleTradeCurrency(CurrencyUtil.getCryptoCurrency("ETH").get());
        user.addPaymentAccount(cryptoCurrencyAccount);
    }
}
Also used : Random(java.util.Random) BootstrapListener(bisq.network.p2p.BootstrapListener) CryptoCurrencyAccount(bisq.core.payment.CryptoCurrencyAccount) PerfectMoneyAccount(bisq.core.payment.PerfectMoneyAccount)

Example 2 with PerfectMoneyAccount

use of bisq.core.payment.PerfectMoneyAccount in project bisq-api by mrosseel.

the class PerfectMoneyPaymentAccountConverter method toBusinessModel.

@Override
public PerfectMoneyAccount toBusinessModel(PerfectMoneyPaymentAccount rest) {
    final PerfectMoneyAccount business = new PerfectMoneyAccount();
    business.init();
    business.setAccountNr(rest.accountNr);
    toBusinessModel(business, rest);
    return business;
}
Also used : PerfectMoneyAccount(bisq.core.payment.PerfectMoneyAccount)

Aggregations

PerfectMoneyAccount (bisq.core.payment.PerfectMoneyAccount)2 CryptoCurrencyAccount (bisq.core.payment.CryptoCurrencyAccount)1 BootstrapListener (bisq.network.p2p.BootstrapListener)1 Random (java.util.Random)1