Fix monero transaction history. Remove morph and xmr.to from filters. Fixe generation monero blockchain height by date.

This commit is contained in:
M 2021-12-31 15:05:27 +02:00
parent fff0d81294
commit 4c4c30bd5d
6 changed files with 23 additions and 18 deletions

View file

@ -85,7 +85,7 @@ final dates = {
"2020-11": 2220000
};
int getHeigthByDate({DateTime date}) {
int getMoneroHeigthByDate({DateTime date}) {
final raw = '${date.year}' + '-' + '${date.month}';
final lastHeight = dates.values.last;
int startHeight;

View file

@ -144,7 +144,8 @@ class CWMonero extends Monero {
}
TransactionHistoryBase getTransactionHistory(Object wallet) {
return MoneroTransactionHistory();
final moneroWallet = wallet as MoneroWallet;
return moneroWallet.transactionHistory;
}
MoneroWalletDetails getMoneroWalletDetails(Object wallet) {
@ -152,7 +153,7 @@ class CWMonero extends Monero {
}
int getHeigthByDate({DateTime date}) {
return getHeigthByDate(date: date);
return getMoneroHeigthByDate(date: date);
}
TransactionPriority getDefaultTransactionPriority() {

View file

@ -145,14 +145,14 @@ class DashboardPage extends BasePage {
image: exchangeImage,
title: S.of(context).exchange,
route: Routes.exchange),
if (isMoneroOnly)
if (!isMoneroOnly)
ActionButton(
image: buyImage,
title: S.of(context).buy,
onClick: () async =>
await _onClickBuyButton(context),
),
if (isMoneroOnly)
if (!isMoneroOnly)
ActionButton(
image: sellImage,
title: 'Sell',

View file

@ -104,7 +104,22 @@ class WalletRestorePage extends BasePage {
.dateController.text = '';
});
return Column(mainAxisAlignment: MainAxisAlignment.center, children: [
return KeyboardActions(
config: KeyboardActionsConfig(
keyboardActionsPlatform: KeyboardActionsPlatform.IOS,
keyboardBarColor: Theme.of(context).accentTextTheme.body2
.backgroundColor,
nextFocus: false,
actions: [
KeyboardActionsItem(
focusNode: _blockHeightFocusNode,
toolbarButtons: [(_) => KeyboardDoneButton()],
)
]),
child: Container(
height: 0,
color: Theme.of(context).backgroundColor,
child: Column(mainAxisAlignment: MainAxisAlignment.center, children: [
Expanded(
child: PageView.builder(
onPageChanged: (page) {
@ -146,7 +161,7 @@ class WalletRestorePage extends BasePage {
);
},
))
]);
])));
}
Map<String, dynamic> _credentials() {

View file

@ -118,7 +118,6 @@ class BlockchainHeightState extends State<BlockchainHeightWidget> {
if (date != null) {
final height = monero.getHeigthByDate(date: date);
setState(() {
dateController.text = DateFormat('yyyy-MM-dd').format(date);
restoreHeightController.text = '$height';

View file

@ -62,21 +62,11 @@ abstract class DashboardViewModelBase with Store {
// onChanged: null),
],
S.current.trades: [
FilterItem(
value: () => tradeFilterStore.displayXMRTO,
caption: 'XMR.TO',
onChanged: (value) => tradeFilterStore
.toggleDisplayExchange(ExchangeProviderDescription.xmrto)),
FilterItem(
value: () => tradeFilterStore.displayChangeNow,
caption: 'Change.NOW',
onChanged: (value) => tradeFilterStore
.toggleDisplayExchange(ExchangeProviderDescription.changeNow)),
FilterItem(
value: () => tradeFilterStore.displayMorphToken,
caption: 'MorphToken',
onChanged: (value) => tradeFilterStore
.toggleDisplayExchange(ExchangeProviderDescription.morphToken)),
]
};