diff --git a/assets/images/dai.png b/assets/images/dai.png new file mode 100644 index 000000000..698ffc48e Binary files /dev/null and b/assets/images/dai.png differ diff --git a/lib/core/address_validator.dart b/lib/core/address_validator.dart index 1ee9e72db..19810c636 100644 --- a/lib/core/address_validator.dart +++ b/lib/core/address_validator.dart @@ -22,6 +22,8 @@ class AddressValidator extends TextValidator { return '[0-9a-zA-Z]'; case CryptoCurrency.btc: return '[0-9a-zA-Z]'; + case CryptoCurrency.dai: + return '[0-9a-zA-Z]'; case CryptoCurrency.dash: return '[0-9a-zA-Z]'; case CryptoCurrency.eos: @@ -57,6 +59,8 @@ class AddressValidator extends TextValidator { return [42]; case CryptoCurrency.btc: return [34, 42]; + case CryptoCurrency.dai: + return [42]; case CryptoCurrency.dash: return [34]; case CryptoCurrency.eos: diff --git a/lib/entities/crypto_currency.dart b/lib/entities/crypto_currency.dart index 722fc2aef..b836393bd 100644 --- a/lib/entities/crypto_currency.dart +++ b/lib/entities/crypto_currency.dart @@ -14,6 +14,7 @@ class CryptoCurrency extends EnumerableItem with Serializable { CryptoCurrency.bch, CryptoCurrency.bnb, CryptoCurrency.btc, + CryptoCurrency.dai, CryptoCurrency.dash, CryptoCurrency.eos, CryptoCurrency.eth, @@ -29,15 +30,16 @@ class CryptoCurrency extends EnumerableItem with Serializable { static const bch = CryptoCurrency(title: 'BCH', raw: 2); static const bnb = CryptoCurrency(title: 'BNB', raw: 3); static const btc = CryptoCurrency(title: 'BTC', raw: 4); - static const dash = CryptoCurrency(title: 'DASH', raw: 5); - static const eos = CryptoCurrency(title: 'EOS', raw: 6); - static const eth = CryptoCurrency(title: 'ETH', raw: 7); - static const ltc = CryptoCurrency(title: 'LTC', raw: 8); - static const nano = CryptoCurrency(title: 'NANO', raw: 9); - static const trx = CryptoCurrency(title: 'TRX', raw: 10); - static const usdt = CryptoCurrency(title: 'USDT', raw: 11); - static const xlm = CryptoCurrency(title: 'XLM', raw: 12); - static const xrp = CryptoCurrency(title: 'XRP', raw: 13); + static const dai = CryptoCurrency(title: 'DAI', raw: 5); + static const dash = CryptoCurrency(title: 'DASH', raw: 6); + static const eos = CryptoCurrency(title: 'EOS', raw: 7); + static const eth = CryptoCurrency(title: 'ETH', raw: 8); + static const ltc = CryptoCurrency(title: 'LTC', raw: 9); + static const nano = CryptoCurrency(title: 'NANO', raw: 10); + static const trx = CryptoCurrency(title: 'TRX', raw: 11); + static const usdt = CryptoCurrency(title: 'USDT', raw: 12); + static const xlm = CryptoCurrency(title: 'XLM', raw: 13); + static const xrp = CryptoCurrency(title: 'XRP', raw: 14); static CryptoCurrency deserialize({int raw}) { switch (raw) { @@ -52,22 +54,24 @@ class CryptoCurrency extends EnumerableItem with Serializable { case 4: return CryptoCurrency.btc; case 5: - return CryptoCurrency.dash; + return CryptoCurrency.dai; case 6: - return CryptoCurrency.eos; + return CryptoCurrency.dash; case 7: - return CryptoCurrency.eth; + return CryptoCurrency.eos; case 8: - return CryptoCurrency.ltc; + return CryptoCurrency.eth; case 9: - return CryptoCurrency.nano; + return CryptoCurrency.ltc; case 10: - return CryptoCurrency.trx; + return CryptoCurrency.nano; case 11: - return CryptoCurrency.usdt; + return CryptoCurrency.trx; case 12: - return CryptoCurrency.xlm; + return CryptoCurrency.usdt; case 13: + return CryptoCurrency.xlm; + case 14: return CryptoCurrency.xrp; default: return null; @@ -86,6 +90,8 @@ class CryptoCurrency extends EnumerableItem with Serializable { return CryptoCurrency.bnb; case 'btc': return CryptoCurrency.btc; + case 'dai': + return CryptoCurrency.dai; case 'dash': return CryptoCurrency.dash; case 'eos': diff --git a/lib/exchange/morphtoken/morphtoken_exchange_provider.dart b/lib/exchange/morphtoken/morphtoken_exchange_provider.dart index ec632cccb..6c4aade37 100644 --- a/lib/exchange/morphtoken/morphtoken_exchange_provider.dart +++ b/lib/exchange/morphtoken/morphtoken_exchange_provider.dart @@ -1,6 +1,5 @@ import 'dart:convert'; import 'package:cake_wallet/core/amount_converter.dart'; -import 'package:cake_wallet/monero/monero_amount_format.dart'; import 'package:hive/hive.dart'; import 'package:cake_wallet/exchange/trade_not_found_exeption.dart'; import 'package:flutter/foundation.dart'; diff --git a/lib/src/screens/contact/contact_list_page.dart b/lib/src/screens/contact/contact_list_page.dart index dc1d14b72..988246656 100644 --- a/lib/src/screens/contact/contact_list_page.dart +++ b/lib/src/screens/contact/contact_list_page.dart @@ -211,6 +211,9 @@ class ContactListPage extends BasePage { case CryptoCurrency.btc: image = Image.asset('assets/images/bitcoin.png', height: 24, width: 24); break; + case CryptoCurrency.dai: + image = Image.asset('assets/images/dai.png', height: 24, width: 24); + break; case CryptoCurrency.dash: image = Image.asset('assets/images/dash.png', height: 24, width: 24); break; diff --git a/lib/src/screens/exchange/widgets/currency_picker.dart b/lib/src/screens/exchange/widgets/currency_picker.dart index 21ba5ce31..668f99e77 100644 --- a/lib/src/screens/exchange/widgets/currency_picker.dart +++ b/lib/src/screens/exchange/widgets/currency_picker.dart @@ -62,13 +62,7 @@ class CurrencyPicker extends StatelessWidget { physics: const NeverScrollableScrollPhysics(), crossAxisSpacing: 1, mainAxisSpacing: 1, - children: List.generate(15, (index) { - - if (index == 14) { - return Container( - color: Theme.of(context).accentTextTheme.title.color, - ); - } + children: List.generate(items.length, (index) { final item = items[index]; final isItemSelected = index == selectedAtIndex; diff --git a/pubspec.lock b/pubspec.lock index 9b14f0555..df34727ee 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -42,7 +42,7 @@ packages: name: async url: "https://pub.dartlang.org" source: hosted - version: "2.4.2" + version: "2.4.1" auto_size_text: dependency: "direct main" description: @@ -210,7 +210,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.14.13" + version: "1.14.12" connectivity: dependency: "direct main" description: @@ -252,7 +252,7 @@ packages: name: crypto url: "https://pub.dartlang.org" source: hosted - version: "2.1.5" + version: "2.1.4" csslib: dependency: transitive description: @@ -330,13 +330,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.2" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" ffi: dependency: transitive description: @@ -505,7 +498,7 @@ packages: name: image url: "https://pub.dartlang.org" source: hosted - version: "2.1.17" + version: "2.1.12" intl: dependency: "direct main" description: @@ -554,7 +547,7 @@ packages: name: matcher url: "https://pub.dartlang.org" source: hosted - version: "0.12.8" + version: "0.12.6" meta: dependency: transitive description: @@ -624,7 +617,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.6.4" path_drawing: dependency: transitive description: @@ -687,7 +680,7 @@ packages: name: petitparser url: "https://pub.dartlang.org" source: hosted - version: "3.0.4" + version: "2.4.0" platform: dependency: transitive description: @@ -874,7 +867,7 @@ packages: name: stack_trace url: "https://pub.dartlang.org" source: hosted - version: "1.9.5" + version: "1.9.3" stream_channel: dependency: transitive description: @@ -909,7 +902,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.17" + version: "0.2.15" time: dependency: transitive description: @@ -930,7 +923,7 @@ packages: name: typed_data url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.1.6" url_launcher: dependency: "direct main" description: @@ -1021,7 +1014,7 @@ packages: name: xml url: "https://pub.dartlang.org" source: hosted - version: "4.5.1" + version: "3.6.1" yaml: dependency: "direct main" description: @@ -1030,5 +1023,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.9.0-14.0.dev <3.0.0" + dart: ">=2.7.0 <3.0.0" flutter: ">=1.12.13+hotfix.5 <2.0.0"