mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-22 19:49:22 +00:00
Generic Fixes (#1122)
* Fix Hive issue * Disable RobinHood for Nano * Validate context is still mounted [skip ci] * Disable Exolix for new exchanges Remove duplicate ethereum case * add nano/banano to manifest/info.plist * fix qr code issues for nano * Add Nano-wallet to restore form qr Add iOS keychain accessibility config * support app links for ethereum and nano [skip ci] * catch exceptions from gas price and estimated gas * Add bitcoin cash to app links Fix restore from QR for bitcoin cash * Fixate bottom buttons for create/restore wallet in wallet list page --------- Co-authored-by: fosse <matt.cfosse@gmail.com>
This commit is contained in:
parent
66301ff247
commit
426ac99e34
15 changed files with 275 additions and 188 deletions
|
@ -52,6 +52,15 @@
|
||||||
<data android:scheme="litecoin" />
|
<data android:scheme="litecoin" />
|
||||||
<data android:scheme="litecoin-wallet" />
|
<data android:scheme="litecoin-wallet" />
|
||||||
<data android:scheme="litecoin_wallet" />
|
<data android:scheme="litecoin_wallet" />
|
||||||
|
<data android:scheme="ethereum" />
|
||||||
|
<data android:scheme="ethereum-wallet" />
|
||||||
|
<data android:scheme="ethereum_wallet" />
|
||||||
|
<data android:scheme="nano" />
|
||||||
|
<data android:scheme="nano-wallet" />
|
||||||
|
<data android:scheme="nano_wallet" />
|
||||||
|
<data android:scheme="bitcoincash" />
|
||||||
|
<data android:scheme="bitcoincash-wallet" />
|
||||||
|
<data android:scheme="bitcoincash_wallet" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
</activity>
|
</activity>
|
||||||
<meta-data
|
<meta-data
|
||||||
|
|
|
@ -42,13 +42,21 @@ class EthereumClient {
|
||||||
await _client!.getBalance(address);
|
await _client!.getBalance(address);
|
||||||
|
|
||||||
Future<int> getGasUnitPrice() async {
|
Future<int> getGasUnitPrice() async {
|
||||||
final gasPrice = await _client!.getGasPrice();
|
try {
|
||||||
return gasPrice.getInWei.toInt();
|
final gasPrice = await _client!.getGasPrice();
|
||||||
|
return gasPrice.getInWei.toInt();
|
||||||
|
} catch (_) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<int> getEstimatedGas() async {
|
Future<int> getEstimatedGas() async {
|
||||||
final estimatedGas = await _client!.estimateGas();
|
try {
|
||||||
return estimatedGas.toInt();
|
final estimatedGas = await _client!.estimateGas();
|
||||||
|
return estimatedGas.toInt();
|
||||||
|
} catch (_) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Future<PendingEthereumTransaction> signTransaction({
|
Future<PendingEthereumTransaction> signTransaction({
|
||||||
|
|
|
@ -100,6 +100,66 @@
|
||||||
<string>litecoin-wallet</string>
|
<string>litecoin-wallet</string>
|
||||||
</array>
|
</array>
|
||||||
</dict>
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Editor</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>ethereum</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>ethereum</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>ethereum-wallet</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>ethereum-wallet</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Editor</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>nano</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>nano</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>nano-wallet</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>nano-wallet</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Editor</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>bitcoincash</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>bitcoincash</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
|
<dict>
|
||||||
|
<key>CFBundleTypeRole</key>
|
||||||
|
<string>Viewer</string>
|
||||||
|
<key>CFBundleURLName</key>
|
||||||
|
<string>bitcoincash-wallet</string>
|
||||||
|
<key>CFBundleURLSchemes</key>
|
||||||
|
<array>
|
||||||
|
<string>bitcoincash-wallet</string>
|
||||||
|
</array>
|
||||||
|
</dict>
|
||||||
</array>
|
</array>
|
||||||
<key>CFBundleVersion</key>
|
<key>CFBundleVersion</key>
|
||||||
<string>$(CURRENT_PROJECT_VERSION)</string>
|
<string>$(CURRENT_PROJECT_VERSION)</string>
|
||||||
|
|
|
@ -53,8 +53,6 @@ class MainActions {
|
||||||
case WalletType.litecoin:
|
case WalletType.litecoin:
|
||||||
case WalletType.ethereum:
|
case WalletType.ethereum:
|
||||||
case WalletType.bitcoinCash:
|
case WalletType.bitcoinCash:
|
||||||
case WalletType.nano:
|
|
||||||
case WalletType.banano:
|
|
||||||
switch (defaultBuyProvider) {
|
switch (defaultBuyProvider) {
|
||||||
case BuyProviderType.AskEachTime:
|
case BuyProviderType.AskEachTime:
|
||||||
Navigator.pushNamed(context, Routes.buy);
|
Navigator.pushNamed(context, Routes.buy);
|
||||||
|
@ -67,6 +65,8 @@ class MainActions {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case WalletType.nano:
|
||||||
|
case WalletType.banano:
|
||||||
case WalletType.monero:
|
case WalletType.monero:
|
||||||
await getIt.get<OnRamperBuyProvider>().launchProvider(context);
|
await getIt.get<OnRamperBuyProvider>().launchProvider(context);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -97,10 +97,10 @@ Future<void> initializeAppConfigs() async {
|
||||||
CakeHive.registerAdapter(WalletInfoAdapter());
|
CakeHive.registerAdapter(WalletInfoAdapter());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Hive.isAdapterRegistered(DERIVATION_TYPE_TYPE_ID)) {
|
if (!CakeHive.isAdapterRegistered(DERIVATION_TYPE_TYPE_ID)) {
|
||||||
CakeHive.registerAdapter(DerivationTypeAdapter());
|
CakeHive.registerAdapter(DerivationTypeAdapter());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!CakeHive.isAdapterRegistered(WALLET_TYPE_TYPE_ID)) {
|
if (!CakeHive.isAdapterRegistered(WALLET_TYPE_TYPE_ID)) {
|
||||||
CakeHive.registerAdapter(WalletTypeAdapter());
|
CakeHive.registerAdapter(WalletTypeAdapter());
|
||||||
}
|
}
|
||||||
|
@ -125,14 +125,17 @@ Future<void> initializeAppConfigs() async {
|
||||||
CakeHive.registerAdapter(AnonpayInvoiceInfoAdapter());
|
CakeHive.registerAdapter(AnonpayInvoiceInfoAdapter());
|
||||||
}
|
}
|
||||||
|
|
||||||
final secureStorage = FlutterSecureStorage();
|
final secureStorage = FlutterSecureStorage(
|
||||||
|
iOptions: IOSOptions(accessibility: KeychainAccessibility.first_unlock),
|
||||||
|
);
|
||||||
final transactionDescriptionsBoxKey =
|
final transactionDescriptionsBoxKey =
|
||||||
await getEncryptionKey(secureStorage: secureStorage, forKey: TransactionDescription.boxKey);
|
await getEncryptionKey(secureStorage: secureStorage, forKey: TransactionDescription.boxKey);
|
||||||
final tradesBoxKey = await getEncryptionKey(secureStorage: secureStorage, forKey: Trade.boxKey);
|
final tradesBoxKey = await getEncryptionKey(secureStorage: secureStorage, forKey: Trade.boxKey);
|
||||||
final ordersBoxKey = await getEncryptionKey(secureStorage: secureStorage, forKey: Order.boxKey);
|
final ordersBoxKey = await getEncryptionKey(secureStorage: secureStorage, forKey: Order.boxKey);
|
||||||
final contacts = await CakeHive.openBox<Contact>(Contact.boxName);
|
final contacts = await CakeHive.openBox<Contact>(Contact.boxName);
|
||||||
final nodes = await CakeHive.openBox<Node>(Node.boxName);
|
final nodes = await CakeHive.openBox<Node>(Node.boxName);
|
||||||
final powNodes = await CakeHive.openBox<Node>(Node.boxName + "pow");// must be different from Node.boxName
|
final powNodes =
|
||||||
|
await CakeHive.openBox<Node>(Node.boxName + "pow"); // must be different from Node.boxName
|
||||||
final transactionDescriptions = await CakeHive.openBox<TransactionDescription>(
|
final transactionDescriptions = await CakeHive.openBox<TransactionDescription>(
|
||||||
TransactionDescription.boxName,
|
TransactionDescription.boxName,
|
||||||
encryptionKey: transactionDescriptionsBoxKey);
|
encryptionKey: transactionDescriptionsBoxKey);
|
||||||
|
|
|
@ -194,7 +194,9 @@ class _EditTokenPageBodyState extends State<EditTokenPageBody> {
|
||||||
contractAddress: _contractAddressController.text,
|
contractAddress: _contractAddressController.text,
|
||||||
decimal: int.parse(_tokenDecimalController.text),
|
decimal: int.parse(_tokenDecimalController.text),
|
||||||
));
|
));
|
||||||
Navigator.pop(context);
|
if (context.mounted) {
|
||||||
|
Navigator.pop(context);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
text: S.of(context).save,
|
text: S.of(context).save,
|
||||||
|
|
|
@ -5,7 +5,6 @@ import 'package:cake_wallet/utils/request_review_handler.dart';
|
||||||
import 'package:mobx/mobx.dart';
|
import 'package:mobx/mobx.dart';
|
||||||
import 'package:flutter_mobx/flutter_mobx.dart';
|
import 'package:flutter_mobx/flutter_mobx.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:flutter/cupertino.dart';
|
|
||||||
import 'package:flutter/services.dart';
|
import 'package:flutter/services.dart';
|
||||||
import 'package:cake_wallet/generated/i18n.dart';
|
import 'package:cake_wallet/generated/i18n.dart';
|
||||||
import 'package:cake_wallet/core/execution_state.dart';
|
import 'package:cake_wallet/core/execution_state.dart';
|
||||||
|
@ -26,16 +25,15 @@ import 'package:cake_wallet/themes/extensions/transaction_trade_theme.dart';
|
||||||
|
|
||||||
void showInformation(
|
void showInformation(
|
||||||
ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
|
ExchangeTradeViewModel exchangeTradeViewModel, BuildContext context) {
|
||||||
final fetchingLabel = S.current.fetching;
|
|
||||||
final trade = exchangeTradeViewModel.trade;
|
final trade = exchangeTradeViewModel.trade;
|
||||||
final walletName = exchangeTradeViewModel.wallet.name;
|
final walletName = exchangeTradeViewModel.wallet.name;
|
||||||
|
|
||||||
final information = exchangeTradeViewModel.isSendable
|
final information = exchangeTradeViewModel.isSendable
|
||||||
? S.current.exchange_result_confirm(
|
? S.current.exchange_result_confirm(
|
||||||
trade.amount ?? fetchingLabel, trade.from.toString(), walletName) +
|
trade.amount, trade.from.toString(), walletName) +
|
||||||
exchangeTradeViewModel.extraInfo
|
exchangeTradeViewModel.extraInfo
|
||||||
: S.current.exchange_result_description(
|
: S.current.exchange_result_description(
|
||||||
trade.amount ?? fetchingLabel, trade.from.toString()) +
|
trade.amount, trade.from.toString()) +
|
||||||
exchangeTradeViewModel.extraInfo;
|
exchangeTradeViewModel.extraInfo;
|
||||||
|
|
||||||
showPopUp<void>(
|
showPopUp<void>(
|
||||||
|
@ -177,7 +175,7 @@ class ExchangeTradeState extends State<ExchangeTradeForm> {
|
||||||
),
|
),
|
||||||
itemBuilder: (context, index) {
|
itemBuilder: (context, index) {
|
||||||
final item = widget.exchangeTradeViewModel.items[index];
|
final item = widget.exchangeTradeViewModel.items[index];
|
||||||
final value = item.data ?? fetchingLabel;
|
final value = item.data;
|
||||||
|
|
||||||
final content = ListRow(
|
final content = ListRow(
|
||||||
title: item.title,
|
title: item.title,
|
||||||
|
|
|
@ -13,7 +13,6 @@ import 'package:cw_core/wallet_type.dart';
|
||||||
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
|
import 'package:cake_wallet/view_model/wallet_list/wallet_list_view_model.dart';
|
||||||
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
import 'package:cake_wallet/src/widgets/primary_button.dart';
|
||||||
import 'package:cake_wallet/src/screens/base_page.dart';
|
import 'package:cake_wallet/src/screens/base_page.dart';
|
||||||
import 'package:cake_wallet/src/widgets/scollable_with_bottom_section.dart';
|
|
||||||
import 'package:cake_wallet/wallet_type_utils.dart';
|
import 'package:cake_wallet/wallet_type_utils.dart';
|
||||||
import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
|
import 'package:cake_wallet/themes/extensions/wallet_list_theme.dart';
|
||||||
|
|
||||||
|
@ -65,169 +64,178 @@ class WalletListBodyState extends State<WalletListBody> {
|
||||||
|
|
||||||
return Container(
|
return Container(
|
||||||
padding: EdgeInsets.only(top: 16),
|
padding: EdgeInsets.only(top: 16),
|
||||||
child: ScrollableWithBottomSection(
|
child: Column(
|
||||||
contentPadding: EdgeInsets.only(bottom: 20),
|
children: [
|
||||||
content: Container(
|
Expanded(
|
||||||
child: Observer(
|
child: Container(
|
||||||
builder: (_) => ListView.separated(
|
child: Observer(
|
||||||
shrinkWrap: true,
|
builder: (_) => ListView.separated(
|
||||||
physics: const NeverScrollableScrollPhysics(),
|
physics: const BouncingScrollPhysics(),
|
||||||
separatorBuilder: (_, index) =>
|
separatorBuilder: (_, index) =>
|
||||||
Divider(color: Theme.of(context).colorScheme.background, height: 32),
|
Divider(color: Theme.of(context).colorScheme.background, height: 32),
|
||||||
itemCount: widget.walletListViewModel.wallets.length,
|
itemCount: widget.walletListViewModel.wallets.length,
|
||||||
itemBuilder: (__, index) {
|
itemBuilder: (__, index) {
|
||||||
final wallet = widget.walletListViewModel.wallets[index];
|
final wallet = widget.walletListViewModel.wallets[index];
|
||||||
final currentColor = wallet.isCurrent
|
final currentColor = wallet.isCurrent
|
||||||
? Theme.of(context)
|
? Theme.of(context)
|
||||||
.extension<WalletListTheme>()!
|
.extension<WalletListTheme>()!
|
||||||
.createNewWalletButtonBackgroundColor
|
.createNewWalletButtonBackgroundColor
|
||||||
: Theme.of(context).colorScheme.background;
|
: Theme.of(context).colorScheme.background;
|
||||||
final row = GestureDetector(
|
final row = GestureDetector(
|
||||||
onTap: () => wallet.isCurrent ? null : _loadWallet(wallet),
|
onTap: () => wallet.isCurrent ? null : _loadWallet(wallet),
|
||||||
child: Container(
|
child: Container(
|
||||||
height: tileHeight,
|
height: tileHeight,
|
||||||
width: double.infinity,
|
width: double.infinity,
|
||||||
child: Row(
|
child: Row(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
Container(
|
Container(
|
||||||
height: tileHeight,
|
height: tileHeight,
|
||||||
width: 4,
|
width: 4,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
borderRadius: BorderRadius.only(
|
borderRadius: BorderRadius.only(
|
||||||
topRight: Radius.circular(4), bottomRight: Radius.circular(4)),
|
topRight: Radius.circular(4),
|
||||||
color: currentColor),
|
bottomRight: Radius.circular(4)),
|
||||||
),
|
color: currentColor),
|
||||||
Expanded(
|
|
||||||
child: Container(
|
|
||||||
height: tileHeight,
|
|
||||||
padding: EdgeInsets.only(left: 20, right: 20),
|
|
||||||
color: Theme.of(context).colorScheme.background,
|
|
||||||
alignment: Alignment.centerLeft,
|
|
||||||
child: Row(
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
children: <Widget>[
|
|
||||||
wallet.isEnabled ? _imageFor(type: wallet.type) : nonWalletTypeIcon,
|
|
||||||
SizedBox(width: 10),
|
|
||||||
Flexible(
|
|
||||||
child: Text(
|
|
||||||
wallet.name,
|
|
||||||
maxLines: null,
|
|
||||||
softWrap: true,
|
|
||||||
style: TextStyle(
|
|
||||||
fontSize: 22,
|
|
||||||
fontWeight: FontWeight.w500,
|
|
||||||
color:
|
|
||||||
Theme.of(context).extension<CakeTextTheme>()!.titleColor,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
Expanded(
|
||||||
),
|
child: Container(
|
||||||
],
|
height: tileHeight,
|
||||||
),
|
padding: EdgeInsets.only(left: 20, right: 20),
|
||||||
),
|
color: Theme.of(context).colorScheme.background,
|
||||||
);
|
alignment: Alignment.centerLeft,
|
||||||
|
child: Row(
|
||||||
return wallet.isCurrent
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
? row
|
children: <Widget>[
|
||||||
: Row(
|
wallet.isEnabled
|
||||||
children: [
|
? _imageFor(type: wallet.type)
|
||||||
Expanded(child: row),
|
: nonWalletTypeIcon,
|
||||||
GestureDetector(
|
SizedBox(width: 10),
|
||||||
onTap: () => Navigator.of(context).pushNamed(Routes.walletEdit,
|
Flexible(
|
||||||
arguments: [widget.walletListViewModel, wallet]),
|
child: Text(
|
||||||
child: Container(
|
wallet.name,
|
||||||
padding: EdgeInsets.only(right: 20),
|
maxLines: null,
|
||||||
child: Center(
|
softWrap: true,
|
||||||
child: Container(
|
style: TextStyle(
|
||||||
height: 40,
|
fontSize: 22,
|
||||||
width: 44,
|
fontWeight: FontWeight.w500,
|
||||||
padding: EdgeInsets.all(10),
|
color: Theme.of(context)
|
||||||
decoration: BoxDecoration(
|
.extension<CakeTextTheme>()!
|
||||||
shape: BoxShape.circle,
|
.titleColor,
|
||||||
color: Theme.of(context)
|
),
|
||||||
.extension<ReceivePageTheme>()!
|
),
|
||||||
.iconsBackgroundColor,
|
),
|
||||||
),
|
],
|
||||||
child: Icon(
|
|
||||||
Icons.edit,
|
|
||||||
size: 14,
|
|
||||||
color:
|
|
||||||
Theme.of(context).extension<ReceivePageTheme>()!.iconsColor,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
],
|
||||||
],
|
),
|
||||||
);
|
),
|
||||||
},
|
);
|
||||||
|
|
||||||
|
return wallet.isCurrent
|
||||||
|
? row
|
||||||
|
: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(child: row),
|
||||||
|
GestureDetector(
|
||||||
|
onTap: () => Navigator.of(context).pushNamed(Routes.walletEdit,
|
||||||
|
arguments: [widget.walletListViewModel, wallet]),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.only(right: 20),
|
||||||
|
child: Center(
|
||||||
|
child: Container(
|
||||||
|
height: 40,
|
||||||
|
width: 44,
|
||||||
|
padding: EdgeInsets.all(10),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<ReceivePageTheme>()!
|
||||||
|
.iconsBackgroundColor,
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.edit,
|
||||||
|
size: 14,
|
||||||
|
color: Theme.of(context)
|
||||||
|
.extension<ReceivePageTheme>()!
|
||||||
|
.iconsColor,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
Padding(
|
||||||
bottomSectionPadding: EdgeInsets.only(bottom: 24, right: 24, left: 24),
|
padding: const EdgeInsets.all(24),
|
||||||
bottomSection: Column(
|
child: Column(
|
||||||
children: <Widget>[
|
children: <Widget>[
|
||||||
PrimaryImageButton(
|
PrimaryImageButton(
|
||||||
onPressed: () {
|
onPressed: () {
|
||||||
//TODO(David): Find a way to optimize this
|
//TODO(David): Find a way to optimize this
|
||||||
if (isSingleCoin) {
|
if (isSingleCoin) {
|
||||||
if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
|
if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
|
||||||
widget.authService.authenticateAction(
|
widget.authService.authenticateAction(
|
||||||
context,
|
context,
|
||||||
route: Routes.newWallet,
|
route: Routes.newWallet,
|
||||||
arguments: widget.walletListViewModel.currentWalletType,
|
arguments: widget.walletListViewModel.currentWalletType,
|
||||||
conditionToDetermineIfToUse2FA:
|
conditionToDetermineIfToUse2FA:
|
||||||
widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
|
widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Navigator.of(context).pushNamed(
|
Navigator.of(context).pushNamed(
|
||||||
Routes.newWallet,
|
Routes.newWallet,
|
||||||
arguments: widget.walletListViewModel.currentWalletType,
|
arguments: widget.walletListViewModel.currentWalletType,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
|
if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
|
||||||
widget.authService.authenticateAction(
|
widget.authService.authenticateAction(
|
||||||
context,
|
context,
|
||||||
route: Routes.newWalletType,
|
route: Routes.newWalletType,
|
||||||
conditionToDetermineIfToUse2FA:
|
conditionToDetermineIfToUse2FA:
|
||||||
widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
|
widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
Navigator.of(context).pushNamed(Routes.newWalletType);
|
Navigator.of(context).pushNamed(Routes.newWalletType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
image: newWalletImage,
|
image: newWalletImage,
|
||||||
text: S.of(context).wallet_list_create_new_wallet,
|
text: S.of(context).wallet_list_create_new_wallet,
|
||||||
color: Theme.of(context).primaryColor,
|
color: Theme.of(context).primaryColor,
|
||||||
textColor: Colors.white,
|
textColor: Colors.white,
|
||||||
|
),
|
||||||
|
SizedBox(height: 10.0),
|
||||||
|
PrimaryImageButton(
|
||||||
|
onPressed: () {
|
||||||
|
if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
|
||||||
|
widget.authService.authenticateAction(
|
||||||
|
context,
|
||||||
|
route: Routes.restoreOptions,
|
||||||
|
arguments: false,
|
||||||
|
conditionToDetermineIfToUse2FA:
|
||||||
|
widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
Navigator.of(context).pushNamed(Routes.restoreOptions, arguments: false);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
image: restoreWalletImage,
|
||||||
|
text: S.of(context).wallet_list_restore_wallet,
|
||||||
|
color: Theme.of(context).cardColor,
|
||||||
|
textColor: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
|
||||||
|
)
|
||||||
|
],
|
||||||
),
|
),
|
||||||
SizedBox(height: 10.0),
|
),
|
||||||
PrimaryImageButton(
|
],
|
||||||
onPressed: () {
|
|
||||||
if (widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets) {
|
|
||||||
widget.authService.authenticateAction(
|
|
||||||
context,
|
|
||||||
route: Routes.restoreOptions,
|
|
||||||
arguments: false,
|
|
||||||
conditionToDetermineIfToUse2FA:
|
|
||||||
widget.walletListViewModel.shouldRequireTOTP2FAForCreatingNewWallets,
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
Navigator.of(context).pushNamed(Routes.restoreOptions, arguments: false);
|
|
||||||
}
|
|
||||||
},
|
|
||||||
image: restoreWalletImage,
|
|
||||||
text: S.of(context).wallet_list_restore_wallet,
|
|
||||||
color: Theme.of(context).cardColor,
|
|
||||||
textColor: Theme.of(context).extension<CakeTextTheme>()!.buttonTextColor,
|
|
||||||
)
|
|
||||||
],
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ class ExceptionHandler {
|
||||||
"Handshake error in client",
|
"Handshake error in client",
|
||||||
"Error while launching http",
|
"Error while launching http",
|
||||||
"OS Error: Network is unreachable",
|
"OS Error: Network is unreachable",
|
||||||
"ClientException: Write failed, uri=https:",
|
"ClientException: Write failed, uri=http",
|
||||||
];
|
];
|
||||||
|
|
||||||
static Future<void> _addDeviceInfo(File file) async {
|
static Future<void> _addDeviceInfo(File file) async {
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
class FeatureFlag {
|
class FeatureFlag {
|
||||||
static const bool isCakePayEnabled = false;
|
static const bool isCakePayEnabled = false;
|
||||||
|
static const bool isExolixEnabled = false;
|
||||||
}
|
}
|
|
@ -17,10 +17,12 @@ class PaymentRequest {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nano != null) {
|
if (nano != null) {
|
||||||
if (address.contains("nano")) {
|
if (amount.isNotEmpty) {
|
||||||
amount = nanoUtil!.getRawAsUsableString(amount, nanoUtil!.rawPerNano);
|
if (address.contains("nano")) {
|
||||||
} else if (address.contains("ban")) {
|
amount = nanoUtil!.getRawAsUsableString(amount, nanoUtil!.rawPerNano);
|
||||||
amount = nanoUtil!.getRawAsUsableString(amount, nanoUtil!.rawPerBanano);
|
} else if (address.contains("ban")) {
|
||||||
|
amount = nanoUtil!.getRawAsUsableString(amount, nanoUtil!.rawPerBanano);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -97,13 +97,6 @@ class TransactionListItem extends ActionListItem with Keyable {
|
||||||
nano!.getTransactionAmountRaw(transaction).toString(), nanoUtil!.rawPerNano)),
|
nano!.getTransactionAmountRaw(transaction).toString(), nanoUtil!.rawPerNano)),
|
||||||
price: price);
|
price: price);
|
||||||
break;
|
break;
|
||||||
case WalletType.ethereum:
|
|
||||||
final asset = ethereum!.assetOfTransaction(balanceViewModel.wallet, transaction);
|
|
||||||
final price = balanceViewModel.fiatConvertationStore.prices[asset];
|
|
||||||
amount = calculateFiatAmountRaw(
|
|
||||||
cryptoAmount: ethereum!.formatterEthereumAmountToDouble(transaction: transaction),
|
|
||||||
price: price);
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,6 +16,7 @@ import 'package:cake_wallet/exchange/simpleswap/simpleswap_exchange_provider.dar
|
||||||
import 'package:cake_wallet/exchange/simpleswap/simpleswap_request.dart';
|
import 'package:cake_wallet/exchange/simpleswap/simpleswap_request.dart';
|
||||||
import 'package:cake_wallet/exchange/trocador/trocador_exchange_provider.dart';
|
import 'package:cake_wallet/exchange/trocador/trocador_exchange_provider.dart';
|
||||||
import 'package:cake_wallet/exchange/trocador/trocador_request.dart';
|
import 'package:cake_wallet/exchange/trocador/trocador_request.dart';
|
||||||
|
import 'package:cake_wallet/utils/feature_flag.dart';
|
||||||
import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart';
|
import 'package:cake_wallet/view_model/contact_list/contact_list_view_model.dart';
|
||||||
import 'package:cw_core/transaction_priority.dart';
|
import 'package:cw_core/transaction_priority.dart';
|
||||||
import 'package:cake_wallet/store/app_store.dart';
|
import 'package:cake_wallet/store/app_store.dart';
|
||||||
|
@ -154,7 +155,7 @@ abstract class ExchangeViewModelBase extends WalletChangeListenerViewModel with
|
||||||
SideShiftExchangeProvider(),
|
SideShiftExchangeProvider(),
|
||||||
SimpleSwapExchangeProvider(),
|
SimpleSwapExchangeProvider(),
|
||||||
TrocadorExchangeProvider(useTorOnly: _useTorOnly),
|
TrocadorExchangeProvider(useTorOnly: _useTorOnly),
|
||||||
ExolixExchangeProvider(),
|
if (FeatureFlag.isExolixEnabled) ExolixExchangeProvider(),
|
||||||
];
|
];
|
||||||
|
|
||||||
@observable
|
@observable
|
||||||
|
|
|
@ -73,10 +73,12 @@ class WalletRestoreFromQRCode {
|
||||||
case 'litecoin-wallet':
|
case 'litecoin-wallet':
|
||||||
return WalletType.litecoin;
|
return WalletType.litecoin;
|
||||||
case 'bitcoincash':
|
case 'bitcoincash':
|
||||||
case 'bitcoinCash-wallet':
|
case 'bitcoincash-wallet':
|
||||||
return WalletType.bitcoinCash;
|
return WalletType.bitcoinCash;
|
||||||
|
case 'ethereum':
|
||||||
case 'ethereum-wallet':
|
case 'ethereum-wallet':
|
||||||
return WalletType.ethereum;
|
return WalletType.ethereum;
|
||||||
|
case 'nano':
|
||||||
case 'nano-wallet':
|
case 'nano-wallet':
|
||||||
return WalletType.nano;
|
return WalletType.nano;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -148,7 +148,7 @@ abstract class WalletKeysViewModelBase with Store {
|
||||||
case WalletType.ethereum:
|
case WalletType.ethereum:
|
||||||
return 'ethereum-wallet';
|
return 'ethereum-wallet';
|
||||||
case WalletType.bitcoinCash:
|
case WalletType.bitcoinCash:
|
||||||
return 'bitcoinCash-wallet';
|
return 'bitcoincash-wallet';
|
||||||
case WalletType.nano:
|
case WalletType.nano:
|
||||||
return 'nano-wallet';
|
return 'nano-wallet';
|
||||||
case WalletType.banano:
|
case WalletType.banano:
|
||||||
|
|
Loading…
Reference in a new issue