class ManageWalletPresenter extends BasePresenter<ManageWalletContract.View> implements ManageWalletContract.Presenter {

    @Override
    public void deleteWallet() {
        Single
                .fromCallable(new Callable<Boolean>() {
                    @Override
                    public Boolean call() throws Exception {
                        return WalletManager.getInstance().deleteWallet(mWalletEntity);
                    }
                })
                .compose(RxUtils.getSingleSchedulerTransformer())
                .compose(bindToLifecycle())
                .compose(LoadingTransformer.bindToSingleLifecycle(currentActivity()))
                .subscribe(new Consumer<Boolean>() {
                    @Override
                    public void accept(Boolean isSuccess) throws Exception {
                        if (isSuccess && isViewAttached()) {
                            EventPublisher.getInstance().sendWalletNumberChangeEvent();
                            currentActivity().finish();
                        }
                    }
                });
    }

}