Search in sources :

Example 1 with WhirlpoolServer

use of com.samourai.whirlpool.client.wallet.beans.WhirlpoolServer in project samourai-wallet-android by Samourai-Wallet.

the class AndroidWhirlpoolWalletService method computeWhirlpoolWalletConfig.

protected WhirlpoolWalletConfig computeWhirlpoolWalletConfig(TorManager torManager, WhirlpoolWalletPersistHandler persistHandler, boolean testnet, boolean onion, int mixsTarget, String scode, IHttpClient httpClient, BackendApi backendApi) {
    IStompClientService stompClientService = new AndroidStompClientService(torManager);
    WhirlpoolServer whirlpoolServer = testnet ? WhirlpoolServer.TESTNET : WhirlpoolServer.MAINNET;
    String serverUrl = whirlpoolServer.getServerUrl(onion);
    NetworkParameters params = whirlpoolServer.getParams();
    WhirlpoolWalletConfig whirlpoolWalletConfig = new WhirlpoolWalletConfig(httpClient, stompClientService, persistHandler, serverUrl, params, true, backendApi);
    // disable auto-tx0
    whirlpoolWalletConfig.setAutoTx0PoolId(null);
    // enable auto-mix
    whirlpoolWalletConfig.setAutoMix(true);
    whirlpoolWalletConfig.setMixsTarget(mixsTarget);
    whirlpoolWalletConfig.setScode(scode);
    whirlpoolWalletConfig.setMaxClients(1);
    whirlpoolWalletConfig.setSecretPointFactory(AndroidSecretPointFactory.getInstance());
    whirlpoolWalletConfig.setTx0Service(new AndroidTx0Service(whirlpoolWalletConfig));
    for (Map.Entry<String, String> configEntry : whirlpoolWalletConfig.getConfigInfo().entrySet()) {
        Log.v(TAG, "whirlpoolWalletConfig[" + configEntry.getKey() + "] = " + configEntry.getValue());
    }
    return whirlpoolWalletConfig;
}
Also used : AndroidTx0Service(com.samourai.whirlpool.client.tx0.AndroidTx0Service) WhirlpoolServer(com.samourai.whirlpool.client.wallet.beans.WhirlpoolServer) NetworkParameters(org.bitcoinj.core.NetworkParameters) IStompClientService(com.samourai.stomp.client.IStompClientService) AndroidStompClientService(com.samourai.stomp.client.AndroidStompClientService) Map(java.util.Map)

Aggregations

AndroidStompClientService (com.samourai.stomp.client.AndroidStompClientService)1 IStompClientService (com.samourai.stomp.client.IStompClientService)1 AndroidTx0Service (com.samourai.whirlpool.client.tx0.AndroidTx0Service)1 WhirlpoolServer (com.samourai.whirlpool.client.wallet.beans.WhirlpoolServer)1 Map (java.util.Map)1 NetworkParameters (org.bitcoinj.core.NetworkParameters)1