mirror of
https://github.com/Such-Software/hash-wallet.git
synced 2026-10-19 05:58:50 +02:00
Merge pull request #108 from cake-tech/CAKE-53-add-dai-for-changenow
CAKE-53 | added dai to cryptocurrencies list; added dai to currency p…
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -14,6 +14,7 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
|
||||
CryptoCurrency.bch,
|
||||
CryptoCurrency.bnb,
|
||||
CryptoCurrency.btc,
|
||||
CryptoCurrency.dai,
|
||||
CryptoCurrency.dash,
|
||||
CryptoCurrency.eos,
|
||||
CryptoCurrency.eth,
|
||||
@@ -29,15 +30,16 @@ class CryptoCurrency extends EnumerableItem<int> with Serializable<int> {
|
||||
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<int> with Serializable<int> {
|
||||
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<int> with Serializable<int> {
|
||||
return CryptoCurrency.bnb;
|
||||
case 'btc':
|
||||
return CryptoCurrency.btc;
|
||||
case 'dai':
|
||||
return CryptoCurrency.dai;
|
||||
case 'dash':
|
||||
return CryptoCurrency.dash;
|
||||
case 'eos':
|
||||
|
||||
@@ -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';
|
||||
|
||||
@@ -212,6 +212,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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user