mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-17 17:57:40 +00:00
9d6ec18057
Exchange -> Buy
24 lines
482 B
Dart
24 lines
482 B
Dart
enum BuyExceptionType { generic, serializeResponseError }
|
|
|
|
class BuyException implements Exception {
|
|
String errorMessage;
|
|
BuyExceptionType type;
|
|
BuyException(this.errorMessage, this.type);
|
|
|
|
@override
|
|
String toString() {
|
|
return errorMessage;
|
|
}
|
|
}
|
|
|
|
class BuyResponse<T> {
|
|
late final T? value;
|
|
late final BuyException? exception;
|
|
|
|
BuyResponse({this.value, this.exception});
|
|
|
|
@override
|
|
String toString() {
|
|
return "{error: $exception, value: $value}";
|
|
}
|
|
}
|