nano fixes pt.1

This commit is contained in:
fosse 2023-09-06 09:37:52 -04:00
parent 0984dbc3d7
commit 2c9bd6c5da
4 changed files with 3 additions and 10 deletions

View file

@ -1,4 +1,4 @@
library cw_ethereum;
library cw_nano;
/// A Calculator.
class Calculator {

View file

@ -3,12 +3,8 @@ import 'package:cw_core/currency.dart';
import 'package:cw_core/monero_amount_format.dart';
import 'package:cw_nano/nano_util.dart';
String rawToFormattedAmount(BigInt amount, Currency currency) {
return "";
}
BigInt stringAmountToBigInt(String amount) {
return BigInt.zero;
return BigInt.parse(NanoUtil.getAmountAsRaw(amount, NanoUtil.rawPerNano));
}
class NanoBalance extends Balance {

View file

@ -133,9 +133,6 @@ abstract class WalletAddressListViewModelBase extends WalletChangeListenerViewMo
_cryptoNumberFormat = NumberFormat(_cryptoNumberPattern),
hasAccounts =
appStore.wallet!.type == WalletType.monero || appStore.wallet!.type == WalletType.haven,
/* ||
appStore.wallet!.type == WalletType.nano ||
appStore.wallet!.type == WalletType.banano,*/ // TODO: nano additional accounts disabled for now
amount = '',
super(appStore: appStore) {
_init();

View file

@ -110,7 +110,7 @@ abstract class WalletKeysViewModelBase with Store {
final keys = nano!.getKeys(_appStore.wallet!);
// we don't necessarily have the seed phrase for nano / banano:
if (_appStore.wallet!.seed != "") {
if (_appStore.wallet!.seed != null) {
items.addAll([
StandartListItem(title: S.current.wallet_seed, value: _appStore.wallet!.seed!),
]);