Search in sources :

Example 1 with PerfectMoneyAccount

use of io.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(io.bisq.core.payment.PerfectMoneyAccount)

Example 2 with PerfectMoneyAccount

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

the class MainViewModelHeadless 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 : BootstrapListener(io.bisq.network.p2p.BootstrapListener) CryptoCurrencyAccount(io.bisq.core.payment.CryptoCurrencyAccount) PerfectMoneyAccount(io.bisq.core.payment.PerfectMoneyAccount)

Aggregations

PerfectMoneyAccount (io.bisq.core.payment.PerfectMoneyAccount)2 CryptoCurrencyAccount (io.bisq.core.payment.CryptoCurrencyAccount)1 BootstrapListener (io.bisq.network.p2p.BootstrapListener)1