2021-12-24 12:37:24 +00:00
|
|
|
import 'package:cw_core/enumerable_item.dart';
|
2021-04-12 18:22:22 +00:00
|
|
|
|
|
|
|
class BuyProviderDescription extends EnumerableItem<int>
|
|
|
|
with Serializable<int> {
|
2022-10-12 17:09:57 +00:00
|
|
|
const BuyProviderDescription({required String title, required int raw})
|
2021-04-12 18:22:22 +00:00
|
|
|
: super(title: title, raw: raw);
|
|
|
|
|
|
|
|
static const wyre = BuyProviderDescription(title: 'Wyre', raw: 0);
|
|
|
|
static const moonPay = BuyProviderDescription(title: 'MoonPay', raw: 1);
|
|
|
|
|
2022-10-12 17:09:57 +00:00
|
|
|
static BuyProviderDescription deserialize({required int raw}) {
|
2021-04-12 18:22:22 +00:00
|
|
|
switch (raw) {
|
|
|
|
case 0:
|
|
|
|
return wyre;
|
|
|
|
case 1:
|
|
|
|
return moonPay;
|
|
|
|
default:
|
2022-10-12 17:09:57 +00:00
|
|
|
throw Exception('Incorrect token $raw for BuyProviderDescription deserialize');
|
2021-04-12 18:22:22 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|