2021-12-24 14:37:24 +02:00
|
|
|
import 'package:cw_core/enumerable_item.dart';
|
2020-01-04 21:31:52 +02:00
|
|
|
|
|
|
|
class ExchangeProviderDescription extends EnumerableItem<int>
|
|
|
|
with Serializable<int> {
|
2020-01-08 14:26:34 +02:00
|
|
|
const ExchangeProviderDescription({String title, int raw})
|
|
|
|
: super(title: title, raw: raw);
|
|
|
|
|
2020-01-04 21:31:52 +02:00
|
|
|
static const xmrto = ExchangeProviderDescription(title: 'XMR.TO', raw: 0);
|
|
|
|
static const changeNow =
|
|
|
|
ExchangeProviderDescription(title: 'ChangeNOW', raw: 1);
|
2020-01-30 20:23:36 +02:00
|
|
|
static const morphToken =
|
|
|
|
ExchangeProviderDescription(title: 'MorphToken', raw: 2);
|
2020-01-04 21:31:52 +02:00
|
|
|
|
2022-04-13 14:28:21 +01:00
|
|
|
static const sideShift =
|
|
|
|
ExchangeProviderDescription(title: 'SideShift', raw: 3);
|
2022-08-31 18:34:07 +03:00
|
|
|
|
|
|
|
static const simpleSwap =
|
|
|
|
ExchangeProviderDescription(title: 'SimpleSwap', raw: 4);
|
2022-04-13 14:28:21 +01:00
|
|
|
|
2020-01-04 21:31:52 +02:00
|
|
|
static ExchangeProviderDescription deserialize({int raw}) {
|
|
|
|
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;
|
2020-01-04 21:31:52 +02:00
|
|
|
default:
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|