mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-11-01 01:47:41 +00:00
e5408a388e
* New versions
* update the new version text after macos [skip ci]
* add cake-wallet headers
* add nano/banano to getAddressFromStringPattern
* Revert "Exolix integration (#1080)"
This reverts commit 9eb6867ab9
.
* fix: Bug in conditions check and clean up of repeated code in switch cases (#1117)
* update build numbers [skip ci]
---------
Co-authored-by: fosse <matt.cfosse@gmail.com>
Co-authored-by: Adegoke David <64401859+Blazebrain@users.noreply.github.com>
49 lines
1.7 KiB
Dart
49 lines
1.7 KiB
Dart
import 'package:cw_core/enumerable_item.dart';
|
|
|
|
class ExchangeProviderDescription extends EnumerableItem<int> with Serializable<int> {
|
|
const ExchangeProviderDescription(
|
|
{required String title, required int raw, required this.image, this.horizontalLogo = false})
|
|
: super(title: title, raw: raw);
|
|
|
|
final bool horizontalLogo;
|
|
final String image;
|
|
|
|
static const xmrto =
|
|
ExchangeProviderDescription(title: 'XMR.TO', raw: 0, image: 'assets/images/xmrto.png');
|
|
static const changeNow =
|
|
ExchangeProviderDescription(title: 'ChangeNOW', raw: 1, image: 'assets/images/changenow.png');
|
|
static const morphToken =
|
|
ExchangeProviderDescription(title: 'MorphToken', raw: 2, image: 'assets/images/morph.png');
|
|
|
|
static const sideShift =
|
|
ExchangeProviderDescription(title: 'SideShift', raw: 3, image: 'assets/images/sideshift.png');
|
|
|
|
static const simpleSwap = ExchangeProviderDescription(
|
|
title: 'SimpleSwap', raw: 4, image: 'assets/images/simpleSwap.png');
|
|
|
|
static const trocador =
|
|
ExchangeProviderDescription(title: 'Trocador', raw: 5, image: 'assets/images/trocador.png');
|
|
|
|
static const all = ExchangeProviderDescription(title: 'All trades', raw: 6, image: '');
|
|
|
|
static ExchangeProviderDescription deserialize({required int raw}) {
|
|
switch (raw) {
|
|
case 0:
|
|
return xmrto;
|
|
case 1:
|
|
return changeNow;
|
|
case 2:
|
|
return morphToken;
|
|
case 3:
|
|
return sideShift;
|
|
case 4:
|
|
return simpleSwap;
|
|
case 5:
|
|
return trocador;
|
|
case 6:
|
|
return all;
|
|
default:
|
|
throw Exception('Unexpected token: $raw for ExchangeProviderDescription deserialize');
|
|
}
|
|
}
|
|
}
|