Search in sources :

Example 1 with MessageNewAddressResponse

use of run.wallet.iota.api.responses.MessageNewAddressResponse in project run-wallet-android by runplay.

the class MessageNewAddressRequestHandler method handle.

@Override
public ApiResponse handle(ApiRequest request) {
    ApiResponse response;
    List<Address> addressList = MsgStore.getAddresses();
    try {
        jota.dto.response.GetNewAddressResponse resp = apiProxy.getNewAddress(String.valueOf(Store.getSeedRaw(context, ((MessageNewAddressRequest) request).getSeed())), ((MessageNewAddressRequest) request).getSecurity(), addressList.size(), ((MessageNewAddressRequest) request).isChecksum(), 1, ((MessageNewAddressRequest) request).isReturnAll());
        response = new MessageNewAddressResponse(resp);
    // Store.addAddress(context,((MessageNewAddressRequest) request).getSeed(),(MessageNewAddressResponse)response);
    } catch (ArgumentException e) {
        response = new NetworkError();
    }
    return response;
}
Also used : Address(run.wallet.iota.model.Address) MessageNewAddressResponse(run.wallet.iota.api.responses.MessageNewAddressResponse) NetworkError(run.wallet.iota.api.responses.error.NetworkError) ArgumentException(jota.error.ArgumentException) ApiResponse(run.wallet.iota.api.responses.ApiResponse)

Aggregations

ArgumentException (jota.error.ArgumentException)1 ApiResponse (run.wallet.iota.api.responses.ApiResponse)1 MessageNewAddressResponse (run.wallet.iota.api.responses.MessageNewAddressResponse)1 NetworkError (run.wallet.iota.api.responses.error.NetworkError)1 Address (run.wallet.iota.model.Address)1