CAKE-53 | added dai to cryptocurrencies list; added dai to currency picker; added dai logo to contact list page; added address validator for dai
OleksandrSobol committed
Sep 24, 2020 at 21:58 UTC
360e04cc4ccaae197ba7e75c96d0ff1758dd7c1f
7 files changed
+43
-44
assets/images/dai.png
Binary files /dev/null and b/assets/images/dai.png differ
lib/core/address_validator.dart
+4
@@ -22,6 +22,8 @@ class AddressValidator extends TextValidator {
22
return '[0-9a-zA-Z]';
23
case CryptoCurrency.btc:
24
return '[0-9a-zA-Z]';
25
+ case CryptoCurrency.dai:
26
+ return '[0-9a-zA-Z]';
27
case CryptoCurrency.dash:
28
return '[0-9a-zA-Z]';
29
case CryptoCurrency.eos:
@@ -57,6 +59,8 @@ class AddressValidator extends TextValidator {
59
return [42];
60
case CryptoCurrency.btc:
61
return [34, 42];
62
+ case CryptoCurrency.dai:
63
+ return [42];
64
case CryptoCurrency.dash:
65
return [34];
66
case CryptoCurrency.eos:
lib/entities/crypto_currency.dart
+23
-17
@@ -14,6 +14,7 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
14
CryptoCurrency.bch,
15
CryptoCurrency.bnb,
16
CryptoCurrency.btc,
17
+ CryptoCurrency.dai,
18
CryptoCurrency.dash,
19
CryptoCurrency.eos,
20
CryptoCurrency.eth,
@@ -29,15 +30,16 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
30
static const bch = CryptoCurrency(title: 'BCH', raw: 2);
31
static const bnb = CryptoCurrency(title: 'BNB', raw: 3);
32
static const btc = CryptoCurrency(title: 'BTC', raw: 4);
32
- static const dash = CryptoCurrency(title: 'DASH', raw: 5);
33
- static const eos = CryptoCurrency(title: 'EOS', raw: 6);
34
- static const eth = CryptoCurrency(title: 'ETH', raw: 7);
35
- static const ltc = CryptoCurrency(title: 'LTC', raw: 8);
36
- static const nano = CryptoCurrency(title: 'NANO', raw: 9);
37
- static const trx = CryptoCurrency(title: 'TRX', raw: 10);
38
- static const usdt = CryptoCurrency(title: 'USDT', raw: 11);
39
- static const xlm = CryptoCurrency(title: 'XLM', raw: 12);
40
- static const xrp = CryptoCurrency(title: 'XRP', raw: 13);
33
+ static const dai = CryptoCurrency(title: 'DAI', raw: 5);
34
+ static const dash = CryptoCurrency(title: 'DASH', raw: 6);
35
+ static const eos = CryptoCurrency(title: 'EOS', raw: 7);
36
+ static const eth = CryptoCurrency(title: 'ETH', raw: 8);
37
+ static const ltc = CryptoCurrency(title: 'LTC', raw: 9);
38
+ static const nano = CryptoCurrency(title: 'NANO', raw: 10);
39
+ static const trx = CryptoCurrency(title: 'TRX', raw: 11);
40
+ static const usdt = CryptoCurrency(title: 'USDT', raw: 12);
41
+ static const xlm = CryptoCurrency(title: 'XLM', raw: 13);
42
+ static const xrp = CryptoCurrency(title: 'XRP', raw: 14);
43
44
static CryptoCurrency deserialize({int raw}) {
45
switch (raw) {
@@ -52,22 +54,24 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
54
case 4:
55
return CryptoCurrency.btc;
56
case 5:
55
- return CryptoCurrency.dash;
57
+ return CryptoCurrency.dai;
58
case 6:
57
- return CryptoCurrency.eos;
59
+ return CryptoCurrency.dash;
60
case 7:
59
- return CryptoCurrency.eth;
61
+ return CryptoCurrency.eos;
62
case 8:
61
- return CryptoCurrency.ltc;
63
+ return CryptoCurrency.eth;
64
case 9:
63
- return CryptoCurrency.nano;
65
+ return CryptoCurrency.ltc;
66
case 10:
65
- return CryptoCurrency.trx;
67
+ return CryptoCurrency.nano;
68
case 11:
67
- return CryptoCurrency.usdt;
69
+ return CryptoCurrency.trx;
70
case 12:
69
- return CryptoCurrency.xlm;
71
+ return CryptoCurrency.usdt;
72
case 13:
73
+ return CryptoCurrency.xlm;
74
+ case 14:
75
return CryptoCurrency.xrp;
76
default:
77
return null;
@@ -86,6 +90,8 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
90
return CryptoCurrency.bnb;
91
case 'btc':
92
return CryptoCurrency.btc;
93
+ case 'dai':
94
+ return CryptoCurrency.dai;
95
case 'dash':
96
return CryptoCurrency.dash;
97
case 'eos':
lib/exchange/morphtoken/morphtoken_exchange_provider.dart
-1
@@ -1,6 +1,5 @@
1
import 'dart:convert';
2
import 'package:cake_wallet/core/amount_converter.dart';
3
-import 'package:cake_wallet/monero/monero_amount_format.dart';
3
import 'package:hive/hive.dart';
4
import 'package:cake_wallet/exchange/trade_not_found_exeption.dart';
5
import 'package:flutter/foundation.dart';
lib/src/screens/contact/contact_list_page.dart
+3
@@ -211,6 +211,9 @@ class ContactListPage extends BasePage {
211
case CryptoCurrency.btc:
212
image = Image.asset('assets/images/bitcoin.png', height: 24, width: 24);
213
break;
214
+ case CryptoCurrency.dai:
215
+ image = Image.asset('assets/images/dai.png', height: 24, width: 24);
216
+ break;
217
case CryptoCurrency.dash:
218
image = Image.asset('assets/images/dash.png', height: 24, width: 24);
219
break;
lib/src/screens/exchange/widgets/currency_picker.dart
+1
-7
@@ -62,13 +62,7 @@ class CurrencyPicker extends StatelessWidget {
62
physics: const NeverScrollableScrollPhysics(),
63
crossAxisSpacing: 1,
64
mainAxisSpacing: 1,
65
- children: List.generate(15, (index) {
66
-
67
- if (index == 14) {
68
- return Container(
69
- color: Theme.of(context).accentTextTheme.title.color,
70
- );
71
- }
65
+ children: List.generate(items.length, (index) {
66
67
final item = items[index];
68
final isItemSelected = index == selectedAtIndex;
pubspec.lock
+12
-19
@@ -42,7 +42,7 @@ packages:
42
name: async
43
url: "https://pub.dartlang.org"
44
source: hosted
45
- version: "2.4.2"
45
+ version: "2.4.1"
46
auto_size_text:
47
dependency: "direct main"
48
description:
@@ -210,7 +210,7 @@ packages:
210
name: collection
211
url: "https://pub.dartlang.org"
212
source: hosted
213
- version: "1.14.13"
213
+ version: "1.14.12"
214
connectivity:
215
dependency: "direct main"
216
description:
@@ -252,7 +252,7 @@ packages:
252
name: crypto
253
url: "https://pub.dartlang.org"
254
source: hosted
255
- version: "2.1.5"
255
+ version: "2.1.4"
256
csslib:
257
dependency: transitive
258
description:
@@ -330,13 +330,6 @@ packages:
330
url: "https://pub.dartlang.org"
331
source: hosted
332
version: "1.0.2"
333
- fake_async:
334
- dependency: transitive
335
- description:
336
- name: fake_async
337
- url: "https://pub.dartlang.org"
338
- source: hosted
339
- version: "1.1.0"
333
ffi:
334
dependency: transitive
335
description:
@@ -505,7 +498,7 @@ packages:
498
name: image
499
url: "https://pub.dartlang.org"
500
source: hosted
508
- version: "2.1.17"
501
+ version: "2.1.12"
502
intl:
503
dependency: "direct main"
504
description:
@@ -554,7 +547,7 @@ packages:
547
name: matcher
548
url: "https://pub.dartlang.org"
549
source: hosted
557
- version: "0.12.8"
550
+ version: "0.12.6"
551
meta:
552
dependency: transitive
553
description:
@@ -624,7 +617,7 @@ packages:
617
name: path
618
url: "https://pub.dartlang.org"
619
source: hosted
627
- version: "1.7.0"
620
+ version: "1.6.4"
621
path_drawing:
622
dependency: transitive
623
description:
@@ -687,7 +680,7 @@ packages:
680
name: petitparser
681
url: "https://pub.dartlang.org"
682
source: hosted
690
- version: "3.0.4"
683
+ version: "2.4.0"
684
platform:
685
dependency: transitive
686
description:
@@ -874,7 +867,7 @@ packages:
867
name: stack_trace
868
url: "https://pub.dartlang.org"
869
source: hosted
877
- version: "1.9.5"
870
+ version: "1.9.3"
871
stream_channel:
872
dependency: transitive
873
description:
@@ -909,7 +902,7 @@ packages:
902
name: test_api
903
url: "https://pub.dartlang.org"
904
source: hosted
912
- version: "0.2.17"
905
+ version: "0.2.15"
906
time:
907
dependency: transitive
908
description:
@@ -930,7 +923,7 @@ packages:
923
name: typed_data
924
url: "https://pub.dartlang.org"
925
source: hosted
933
- version: "1.2.0"
926
+ version: "1.1.6"
927
url_launcher:
928
dependency: "direct main"
929
description:
@@ -1021,7 +1014,7 @@ packages:
1014
name: xml
1015
url: "https://pub.dartlang.org"
1016
source: hosted
1024
- version: "4.5.1"
1017
+ version: "3.6.1"
1018
yaml:
1019
dependency: "direct main"
1020
description:
@@ -1030,5 +1023,5 @@ packages:
1023
source: hosted
1024
version: "2.2.1"
1025
sdks:
1033
- dart: ">=2.9.0-14.0.dev <3.0.0"
1026
+ dart: ">=2.7.0 <3.0.0"
1027
flutter: ">=1.12.13+hotfix.5 <2.0.0"