2021-12-24 14:37:24 +02:00
|
|
|
import 'package:cw_core/enumerable_item.dart';
|
2020-01-04 21:31:52 +02:00
|
|
|
|
2023-02-06 21:20:43 +02:00
|
|
|
class ExchangeProviderDescription extends EnumerableItem<int> with Serializable<int> {
|
|
|
|
const ExchangeProviderDescription(
|
|
|
|
{required String title, required int raw, required this.image, this.horizontalLogo = false})
|
2020-01-08 14:26:34 +02:00
|
|
|
: super(title: title, raw: raw);
|
|
|
|
|
2022-09-01 16:12:38 +02:00
|
|
|
final bool horizontalLogo;
|
|
|
|
final String image;
|
|
|
|
|
2023-02-06 21:20:43 +02:00
|
|
|
static const xmrto =
|
|
|
|
ExchangeProviderDescription(title: 'XMR.TO', raw: 0, image: 'assets/images/xmrto.png');
|
2020-01-04 21:31:52 +02:00
|
|
|
static const changeNow =
|
2022-09-01 16:12:38 +02:00
|
|
|
ExchangeProviderDescription(title: 'ChangeNOW', raw: 1, image: 'assets/images/changenow.png');
|
2020-01-30 20:23:36 +02:00
|
|
|
static const morphToken =
|
2022-09-01 16:12:38 +02:00
|
|
|
ExchangeProviderDescription(title: 'MorphToken', raw: 2, image: 'assets/images/morph.png');
|
2023-02-06 21:20:43 +02:00
|
|
|
static const sideShift =
|
2022-09-01 16:12:38 +02:00
|
|
|
ExchangeProviderDescription(title: 'SideShift', raw: 3, image: 'assets/images/sideshift.png');
|
2023-02-06 21:20:43 +02:00
|
|
|
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');
|
2023-10-12 03:20:19 +03:00
|
|
|
static const exolix =
|
|
|
|
ExchangeProviderDescription(title: 'Exolix', raw: 6, image: 'assets/images/exolix.png');
|
2024-03-28 14:41:11 +02:00
|
|
|
static const thorChain =
|
|
|
|
ExchangeProviderDescription(title: 'ThorChain' , raw: 8, image: 'assets/images/thorchain.png');
|
2023-10-12 03:20:19 +03:00
|
|
|
|
|
|
|
static const all = ExchangeProviderDescription(title: 'All trades', raw: 7, image: '');
|
2022-11-10 13:25:03 +02:00
|
|
|
|
2022-10-12 13:09:57 -04:00
|
|
|
static ExchangeProviderDescription deserialize({required int raw}) {
|
2020-01-04 21:31:52 +02:00
|
|
|
switch (raw) {
|
|
|
|
case 0:
|
|
|
|
return xmrto;
|
|
|
|
case 1:
|
|
|
|
return changeNow;
|
2020-01-30 20:23:36 +02:00
|
|
|
case 2:
|
|
|
|
return morphToken;
|
2022-04-13 14:28:21 +01:00
|
|
|
case 3:
|
|
|
|
return sideShift;
|
2022-08-31 18:34:07 +03:00
|
|
|
case 4:
|
|
|
|
return simpleSwap;
|
2022-11-10 13:25:03 +02:00
|
|
|
case 5:
|
2023-02-06 21:20:43 +02:00
|
|
|
return trocador;
|
|
|
|
case 6:
|
2023-10-12 03:20:19 +03:00
|
|
|
return exolix;
|
2024-03-28 14:41:11 +02:00
|
|
|
case 8:
|
|
|
|
return thorChain;
|
2023-10-12 03:20:19 +03:00
|
|
|
case 7:
|
2022-11-10 13:25:03 +02:00
|
|
|
return all;
|
2020-01-04 21:31:52 +02:00
|
|
|
default:
|
2022-10-12 13:09:57 -04:00
|
|
|
throw Exception('Unexpected token: $raw for ExchangeProviderDescription deserialize');
|
2020-01-04 21:31:52 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|