From 08b989eaab710bdb9727e76396e52ea988d4ebcb Mon Sep 17 00:00:00 2001 From: pokkst Date: Wed, 6 Dec 2023 12:46:39 -0600 Subject: [PATCH] Convert services to Kotlin; just need to convert fragment/UI stuff next, then eventually convert to Compose --- .../java/net/mynero/wallet/MainActivity.kt | 26 +++++++++-------- .../mynero/wallet/adapter/CoinsInfoAdapter.kt | 6 ++-- .../wallet/adapter/NodeSelectionAdapter.kt | 2 +- .../wallet/adapter/SubaddressAdapter.kt | 4 +-- .../wallet/adapter/TransactionInfoAdapter.kt | 4 +-- .../EditAddressLabelBottomSheetDialog.java | 2 +- .../dialog/SendBottomSheetDialog.java | 14 ++++++---- .../wallet/fragment/home/HomeFragment.java | 4 +-- .../fragment/receive/ReceiveViewModel.java | 10 +++++-- .../wallet/fragment/send/SendFragment.java | 28 ++++++++++--------- .../fragment/settings/SettingsFragment.java | 4 +-- .../wallet/fragment/utxos/UtxosFragment.java | 2 +- .../net/mynero/wallet/model/BalanceInfo.kt | 8 +++--- .../java/net/mynero/wallet/model/Wallet.kt | 18 +++++++----- 14 files changed, 73 insertions(+), 59 deletions(-) diff --git a/app/src/main/java/net/mynero/wallet/MainActivity.kt b/app/src/main/java/net/mynero/wallet/MainActivity.kt index ca83c96..7248593 100644 --- a/app/src/main/java/net/mynero/wallet/MainActivity.kt +++ b/app/src/main/java/net/mynero/wallet/MainActivity.kt @@ -9,7 +9,7 @@ import net.mynero.wallet.fragment.dialog.PasswordBottomSheetDialog import net.mynero.wallet.fragment.dialog.PasswordBottomSheetDialog.PasswordListener import net.mynero.wallet.fragment.dialog.SendBottomSheetDialog import net.mynero.wallet.livedata.SingleLiveEvent -import net.mynero.wallet.model.WalletManager.Companion.instance +import net.mynero.wallet.model.WalletManager import net.mynero.wallet.service.AddressService import net.mynero.wallet.service.BalanceService import net.mynero.wallet.service.BlockchainService @@ -41,8 +41,8 @@ class MainActivity : AppCompatActivity(), MoneroHandlerThread.Listener, Password val walletKeysFile = File(applicationInfo.dataDir, Constants.WALLET_NAME + ".keys") if (walletKeysFile.exists()) { val promptPassword = - PrefService.getInstance().getBoolean(Constants.PREF_USES_PASSWORD, false) - if (!promptPassword) { + PrefService.instance?.getBoolean(Constants.PREF_USES_PASSWORD, false) + if (promptPassword == false) { init(walletFile, "") } else { val passwordDialog = PasswordBottomSheetDialog() @@ -70,15 +70,17 @@ class MainActivity : AppCompatActivity(), MoneroHandlerThread.Listener, Password } fun init(walletFile: File, password: String?) { - val wallet = password?.let { instance?.openWallet(walletFile.absolutePath, it) } - thread = MoneroHandlerThread("WalletService", this, wallet) - TxService(thread) - balanceService = BalanceService(thread) - addressService = AddressService(thread) - historyService = HistoryService(thread) - blockchainService = BlockchainService(thread) - utxoService = UTXOService(thread) - thread?.start() + val wallet = WalletManager.instance?.openWallet(walletFile.absolutePath, password ?: "") + thread = wallet?.let { MoneroHandlerThread("WalletService", this, it) } + thread?.let { thread -> + TxService(thread) + balanceService = BalanceService(thread) + addressService = AddressService(thread) + historyService = HistoryService(thread) + blockchainService = BlockchainService(thread) + utxoService = UTXOService(thread) + thread.start() + } } override fun onRefresh(walletSynced: Boolean) { diff --git a/app/src/main/java/net/mynero/wallet/adapter/CoinsInfoAdapter.kt b/app/src/main/java/net/mynero/wallet/adapter/CoinsInfoAdapter.kt index ea0080f..afc088d 100644 --- a/app/src/main/java/net/mynero/wallet/adapter/CoinsInfoAdapter.kt +++ b/app/src/main/java/net/mynero/wallet/adapter/CoinsInfoAdapter.kt @@ -127,9 +127,9 @@ class CoinsInfoAdapter(val listener: CoinsInfoAdapterListener?) : val globalIdxTextView = itemView.findViewById(R.id.utxo_global_index_textview) val outpointTextView = itemView.findViewById(R.id.utxo_outpoint_textview) val streetModeEnabled = - PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false) + PrefService.instance?.getBoolean(Constants.PREF_STREET_MODE, false) val balanceString = - if (streetModeEnabled) Constants.STREET_MODE_BALANCE else Wallet.getDisplayAmount( + if (streetModeEnabled == true) Constants.STREET_MODE_BALANCE else Wallet.getDisplayAmount( coinsInfo.amount ) amountTextView.text = @@ -148,7 +148,7 @@ class CoinsInfoAdapter(val listener: CoinsInfoAdapterListener?) : if (selected) { itemView.backgroundTintList = ContextCompat.getColorStateList(itemView.context, R.color.oled_colorSecondary) - } else if (coinsInfo.isFrozen || UTXOService.instance.isCoinFrozen(coinsInfo)) { + } else if (coinsInfo.isFrozen || UTXOService.instance?.isCoinFrozen(coinsInfo) == true) { itemView.backgroundTintList = ContextCompat.getColorStateList(itemView.context, R.color.oled_frozen_utxo) } else if (!coinsInfo.isUnlocked) { diff --git a/app/src/main/java/net/mynero/wallet/adapter/NodeSelectionAdapter.kt b/app/src/main/java/net/mynero/wallet/adapter/NodeSelectionAdapter.kt index e3f928a..498c519 100644 --- a/app/src/main/java/net/mynero/wallet/adapter/NodeSelectionAdapter.kt +++ b/app/src/main/java/net/mynero/wallet/adapter/NodeSelectionAdapter.kt @@ -80,7 +80,7 @@ class NodeSelectionAdapter(val listener: NodeSelectionAdapterListener?) : view ) { fun bind(node: Node) { - val currentNode = PrefService.getInstance().node + val currentNode = PrefService.instance?.node val match = node == currentNode if (match) { itemView.setBackgroundColor(itemView.resources.getColor(R.color.oled_colorSecondary)) diff --git a/app/src/main/java/net/mynero/wallet/adapter/SubaddressAdapter.kt b/app/src/main/java/net/mynero/wallet/adapter/SubaddressAdapter.kt index 855d0f9..cb98e57 100644 --- a/app/src/main/java/net/mynero/wallet/adapter/SubaddressAdapter.kt +++ b/app/src/main/java/net/mynero/wallet/adapter/SubaddressAdapter.kt @@ -92,8 +92,8 @@ class SubaddressAdapter(val listener: SubaddressAdapterListener?) : val amount = subaddress.amount if (amount > 0) { val streetMode = - PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false) - if (streetMode) { + PrefService.instance?.getBoolean(Constants.PREF_STREET_MODE, false) + if (streetMode == true) { addressAmountTextView.text = itemView.context.getString( R.string.tx_list_amount_positive, Constants.STREET_MODE_BALANCE diff --git a/app/src/main/java/net/mynero/wallet/adapter/TransactionInfoAdapter.kt b/app/src/main/java/net/mynero/wallet/adapter/TransactionInfoAdapter.kt index e1446b0..813fea0 100644 --- a/app/src/main/java/net/mynero/wallet/adapter/TransactionInfoAdapter.kt +++ b/app/src/main/java/net/mynero/wallet/adapter/TransactionInfoAdapter.kt @@ -95,9 +95,9 @@ class TransactionInfoAdapter(val listener: TxInfoAdapterListener?) : fun bind(txInfo: TransactionInfo) { val streetModeEnabled = - PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false) + PrefService.instance?.getBoolean(Constants.PREF_STREET_MODE, false) val displayAmount = - if (streetModeEnabled) Constants.STREET_MODE_BALANCE else getDisplayAmount( + if (streetModeEnabled == true) Constants.STREET_MODE_BALANCE else getDisplayAmount( txInfo.amount, Helper.DISPLAY_DIGITS_INFO ) diff --git a/app/src/main/java/net/mynero/wallet/fragment/dialog/EditAddressLabelBottomSheetDialog.java b/app/src/main/java/net/mynero/wallet/fragment/dialog/EditAddressLabelBottomSheetDialog.java index c87c290..667a40b 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/dialog/EditAddressLabelBottomSheetDialog.java +++ b/app/src/main/java/net/mynero/wallet/fragment/dialog/EditAddressLabelBottomSheetDialog.java @@ -36,7 +36,7 @@ public class EditAddressLabelBottomSheetDialog extends BottomSheetDialogFragment public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); Wallet wallet = WalletManager.getInstance().getWallet(); - AddressService addressService = AddressService.getInstance(); + AddressService addressService = AddressService.instance; ImageButton pasteButton = view.findViewById(R.id.paste_password_imagebutton); EditText labelEditText = view.findViewById(R.id.wallet_password_edittext); Button saveLabelButton = view.findViewById(R.id.unlock_wallet_button); diff --git a/app/src/main/java/net/mynero/wallet/fragment/dialog/SendBottomSheetDialog.java b/app/src/main/java/net/mynero/wallet/fragment/dialog/SendBottomSheetDialog.java index 173d12b..5f41cfe 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/dialog/SendBottomSheetDialog.java +++ b/app/src/main/java/net/mynero/wallet/fragment/dialog/SendBottomSheetDialog.java @@ -46,7 +46,8 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment { private final MutableLiveData _pendingTransaction = new MutableLiveData<>(null); public ArrayList selectedUtxos = new ArrayList<>(); public LiveData sendingMax = _sendingMax; - public LiveData pendingTransaction = _pendingTransaction; private final ActivityResultLauncher cameraPermissionsLauncher = registerForActivityResult(new ActivityResultContracts.RequestPermission(), + public LiveData pendingTransaction = _pendingTransaction; + public UriData uriData = null; private final ActivityResultLauncher cameraPermissionsLauncher = registerForActivityResult(new ActivityResultContracts.RequestPermission(), granted -> { if (granted) { onScan(); @@ -54,7 +55,6 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment { Toast.makeText(getActivity(), getString(R.string.no_camera_permission), Toast.LENGTH_SHORT).show(); } }); - public UriData uriData = null; public boolean isChurning = false; public Listener listener = null; public PendingTransaction.Priority priority; @@ -138,7 +138,7 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment { } private void bindObservers() { - BalanceService.getInstance().balanceInfo.observe(getViewLifecycleOwner(), balanceInfo -> { + BalanceService.instance.balanceInfo.observe(getViewLifecycleOwner(), balanceInfo -> { createButton.setEnabled(balanceInfo.getRawUnlocked() != 0); if (!isChurning) { sendMaxButton.setEnabled(balanceInfo.getRawUnlocked() != 0); @@ -212,7 +212,7 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment { boolean validAddress = Wallet.isAddressValid(address); if (validAddress && (!amount.isEmpty() || sendAll)) { long amountRaw = Wallet.getAmountFromString(amount); - long balance = BalanceService.getInstance().getUnlockedBalanceRaw(); + long balance = BalanceService.instance.getUnlockedBalanceRaw(); if ((amountRaw >= balance || amountRaw <= 0) && !sendAll) { Toast.makeText(activity, getString(R.string.send_amount_invalid), Toast.LENGTH_SHORT).show(); return; @@ -253,7 +253,7 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment { Activity activity = getActivity(); if (activity != null) { ((MoneroApplication) activity.getApplication()).getExecutor().execute(() -> { - boolean success = TxService.getInstance().sendTx(pendingTx); + boolean success = TxService.instance.sendTx(pendingTx); activity.runOnUiThread(() -> { if (success) { Toast.makeText(activity, getString(R.string.sent_tx), Toast.LENGTH_SHORT).show(); @@ -275,7 +275,7 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment { if (activity != null) { ((MoneroApplication) activity.getApplication()).getExecutor().execute(() -> { try { - PendingTransaction pendingTx = TxService.getInstance().createTx(address, amount, sendAll, feePriority, selectedUtxos); + PendingTransaction pendingTx = TxService.instance.createTx(address, amount, sendAll, feePriority, selectedUtxos); if (pendingTx != null && pendingTx.getStatus() == PendingTransaction.Status.Status_Ok) { _pendingTransaction.postValue(pendingTx); } else { @@ -351,4 +351,6 @@ public class SendBottomSheetDialog extends BottomSheetDialogFragment { } + + } \ No newline at end of file diff --git a/app/src/main/java/net/mynero/wallet/fragment/home/HomeFragment.java b/app/src/main/java/net/mynero/wallet/fragment/home/HomeFragment.java index a381afa..22bf34f 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/home/HomeFragment.java +++ b/app/src/main/java/net/mynero/wallet/fragment/home/HomeFragment.java @@ -83,9 +83,9 @@ public class HomeFragment extends Fragment implements TransactionInfoAdapter.TxI TextView unlockedBalanceTextView = view.findViewById(R.id.balance_unlocked_textview); TextView lockedBalanceTextView = view.findViewById(R.id.balance_locked_textview); - BalanceService balanceService = BalanceService.getInstance(); + BalanceService balanceService = BalanceService.instance; HistoryService historyService = HistoryService.getInstance(); - BlockchainService blockchainService = BlockchainService.getInstance(); + BlockchainService blockchainService = BlockchainService.instance; if (balanceService != null) { balanceService.balanceInfo.observe(getViewLifecycleOwner(), balanceInfo -> { diff --git a/app/src/main/java/net/mynero/wallet/fragment/receive/ReceiveViewModel.java b/app/src/main/java/net/mynero/wallet/fragment/receive/ReceiveViewModel.java index 1a3a673..ff042f2 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/receive/ReceiveViewModel.java +++ b/app/src/main/java/net/mynero/wallet/fragment/receive/ReceiveViewModel.java @@ -20,14 +20,16 @@ public class ReceiveViewModel extends ViewModel { public LiveData> addresses = _addresses; public void init() { - _address.setValue(AddressService.getInstance().currentSubaddress()); + if (AddressService.instance != null) { + _address.setValue(AddressService.instance.currentSubaddress()); + } _addresses.setValue(getSubaddresses()); } private List getSubaddresses() { Wallet wallet = WalletManager.getInstance().getWallet(); ArrayList subaddresses = new ArrayList<>(); - int addressesSize = AddressService.getInstance().getLatestAddressIndex(); + int addressesSize = AddressService.instance != null ? AddressService.instance.getLatestAddressIndex() : 0; for (int i = addressesSize - 1; i >= 0; i--) { subaddresses.add(wallet.getSubaddressObject(i)); } @@ -35,7 +37,9 @@ public class ReceiveViewModel extends ViewModel { } public void getFreshSubaddress() { - _address.setValue(AddressService.getInstance().freshSubaddress()); + if (AddressService.instance != null) { + _address.setValue(AddressService.instance.freshSubaddress()); + } _addresses.setValue(getSubaddresses()); } diff --git a/app/src/main/java/net/mynero/wallet/fragment/send/SendFragment.java b/app/src/main/java/net/mynero/wallet/fragment/send/SendFragment.java index 43ad222..067d28f 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/send/SendFragment.java +++ b/app/src/main/java/net/mynero/wallet/fragment/send/SendFragment.java @@ -72,15 +72,7 @@ public class SendFragment extends Fragment { public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) { return inflater.inflate(R.layout.fragment_send, container, false); - } private final ActivityResultLauncher cameraPermissionsLauncher = registerForActivityResult(new ActivityResultContracts.RequestPermission(), - granted -> { - if (granted) { - onScan(currentEntryIndex); - } else { - Toast.makeText(getActivity(), getString(R.string.no_camera_permission), Toast.LENGTH_SHORT).show(); - currentEntryIndex = -1; - } - }); + } @Override public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { @@ -105,7 +97,15 @@ public class SendFragment extends Fragment { bindListeners(); bindObservers(); init(); - } + } private final ActivityResultLauncher cameraPermissionsLauncher = registerForActivityResult(new ActivityResultContracts.RequestPermission(), + granted -> { + if (granted) { + onScan(currentEntryIndex); + } else { + Toast.makeText(getActivity(), getString(R.string.no_camera_permission), Toast.LENGTH_SHORT).show(); + currentEntryIndex = -1; + } + }); private void init() { addOutput(true); @@ -170,7 +170,7 @@ public class SendFragment extends Fragment { } long amountRaw = Wallet.getAmountFromString(amount); - long balance = BalanceService.getInstance().getUnlockedBalanceRaw(); + long balance = BalanceService.instance.getUnlockedBalanceRaw(); if (amountRaw >= balance || amountRaw <= 0) { Toast.makeText(getActivity(), getString(R.string.send_amount_invalid), Toast.LENGTH_SHORT).show(); return false; @@ -429,7 +429,7 @@ public class SendFragment extends Fragment { private void createTx(List> dests, boolean sendAll, PendingTransaction.Priority feePriority) { ((MoneroApplication) getActivity().getApplication()).getExecutor().execute(() -> { try { - PendingTransaction pendingTx = TxService.getInstance().createTx(dests, sendAll, feePriority, new ArrayList<>()); + PendingTransaction pendingTx = TxService.instance.createTx(dests, sendAll, feePriority, new ArrayList<>()); if (pendingTx != null && pendingTx.getStatus() == PendingTransaction.Status.Status_Ok) { mViewModel.setPendingTransaction(pendingTx); } else { @@ -459,7 +459,7 @@ public class SendFragment extends Fragment { private void sendTx(PendingTransaction pendingTx) { ((MoneroApplication) getActivity().getApplication()).getExecutor().execute(() -> { - boolean success = TxService.getInstance().sendTx(pendingTx); + boolean success = TxService.instance.sendTx(pendingTx); Activity activity = getActivity(); if (activity != null) { activity.runOnUiThread(() -> { @@ -480,4 +480,6 @@ public class SendFragment extends Fragment { } + + } \ No newline at end of file diff --git a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java index f89f630..ac68b10 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java +++ b/app/src/main/java/net/mynero/wallet/fragment/settings/SettingsFragment.java @@ -107,7 +107,7 @@ public class SettingsFragment extends Fragment implements PasswordBottomSheetDia streetModeSwitch.setChecked(PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false)); streetModeSwitch.setOnCheckedChangeListener((compoundButton, b) -> { PrefService.getInstance().edit().putBoolean(Constants.PREF_STREET_MODE, b).apply(); - BalanceService.getInstance().refreshBalance(); + BalanceService.instance.refreshBalance(); }); monerochanSwitch.setChecked(PrefService.getInstance().getBoolean(Constants.PREF_MONEROCHAN, true)); @@ -172,7 +172,7 @@ public class SettingsFragment extends Fragment implements PasswordBottomSheetDia }); TextView statusTextView = view.findViewById(R.id.status_textview); - BlockchainService.getInstance().connectionStatus.observe(getViewLifecycleOwner(), connectionStatus -> { + BlockchainService.instance.connectionStatus.observe(getViewLifecycleOwner(), connectionStatus -> { if (connectionStatus == Wallet.ConnectionStatus.ConnectionStatus_Connected) { statusTextView.setText(getResources().getText(R.string.connected)); } else if (connectionStatus == Wallet.ConnectionStatus.ConnectionStatus_Disconnected) { diff --git a/app/src/main/java/net/mynero/wallet/fragment/utxos/UtxosFragment.java b/app/src/main/java/net/mynero/wallet/fragment/utxos/UtxosFragment.java index b318c5f..2eb053d 100644 --- a/app/src/main/java/net/mynero/wallet/fragment/utxos/UtxosFragment.java +++ b/app/src/main/java/net/mynero/wallet/fragment/utxos/UtxosFragment.java @@ -85,7 +85,7 @@ public class UtxosFragment extends Fragment implements CoinsInfoAdapter.CoinsInf SendBottomSheetDialog sendDialog = new SendBottomSheetDialog(); sendDialog.listener = this; sendDialog.isChurning = true; - sendDialog.uriData = UriData.parse(AddressService.getInstance().currentSubaddress().address); + sendDialog.uriData = UriData.parse(AddressService.instance.currentSubaddress().address); sendDialog.selectedUtxos = selectedKeyImages; sendDialog.show(getActivity().getSupportFragmentManager(), null); }); diff --git a/app/src/main/java/net/mynero/wallet/model/BalanceInfo.kt b/app/src/main/java/net/mynero/wallet/model/BalanceInfo.kt index 7d99be8..d063476 100644 --- a/app/src/main/java/net/mynero/wallet/model/BalanceInfo.kt +++ b/app/src/main/java/net/mynero/wallet/model/BalanceInfo.kt @@ -12,8 +12,8 @@ class BalanceInfo(val rawUnlocked: Long, val rawLocked: Long) { val unlockedDisplay: String get() { val streetModeEnabled = - PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false) - return if (streetModeEnabled) { + PrefService.instance?.getBoolean(Constants.PREF_STREET_MODE, false) + return if (streetModeEnabled == true) { Constants.STREET_MODE_BALANCE } else { Wallet.getDisplayAmount(rawUnlocked) @@ -22,8 +22,8 @@ class BalanceInfo(val rawUnlocked: Long, val rawLocked: Long) { val lockedDisplay: String get() { val streetModeEnabled = - PrefService.getInstance().getBoolean(Constants.PREF_STREET_MODE, false) - return if (streetModeEnabled) { + PrefService.instance?.getBoolean(Constants.PREF_STREET_MODE, false) + return if (streetModeEnabled == true) { Constants.STREET_MODE_BALANCE } else { Wallet.getDisplayAmount(rawLocked) diff --git a/app/src/main/java/net/mynero/wallet/model/Wallet.kt b/app/src/main/java/net/mynero/wallet/model/Wallet.kt index 82077f6..8bb90e6 100644 --- a/app/src/main/java/net/mynero/wallet/model/Wallet.kt +++ b/app/src/main/java/net/mynero/wallet/model/Wallet.kt @@ -18,7 +18,6 @@ package net.mynero.wallet.model import android.util.Pair import net.mynero.wallet.data.Subaddress import net.mynero.wallet.model.NetworkType.Companion.fromInteger -import net.mynero.wallet.model.WalletManager.Companion.instance import timber.log.Timber import java.io.File import java.text.SimpleDateFormat @@ -150,17 +149,17 @@ class Wallet { external fun store(path: String?): Boolean fun close(): Boolean { disposePendingTransaction() - return instance?.close(this) == true + return WalletManager.instance?.close(this) == true } external fun getFilename(): String // virtual std::string keysFilename() const = 0; fun init(upperTransactionSizeLimit: Long): Boolean { - var daemonAddress = instance?.getDaemonAddress() - var daemonUsername = instance?.daemonUsername - var daemonPassword = instance?.daemonPassword - var proxyAddress = instance?.proxy + var daemonAddress = WalletManager.instance?.getDaemonAddress() + var daemonUsername = WalletManager.instance?.daemonUsername + var daemonPassword = WalletManager.instance?.daemonPassword + var proxyAddress = WalletManager.instance?.proxy Timber.d("init(") if (daemonAddress != null) { Timber.d(daemonAddress.toString()) @@ -474,7 +473,12 @@ class Wallet { @JvmStatic fun isAddressValid(address: String): Boolean { - return instance?.networkType?.value?.let { isAddressValid(address, it) } == true + return WalletManager.instance?.networkType?.value?.let { + isAddressValid( + address, + it + ) + } == true } @JvmStatic