mirror of
https://github.com/cypherstack/stack_wallet.git
synced 2024-11-18 02:07:43 +00:00
28 lines
503 B
Dart
28 lines
503 B
Dart
enum BuyExceptionType {
|
|
generic,
|
|
serializeResponseError,
|
|
cryptoAmountOutOfRange,
|
|
}
|
|
|
|
class BuyException implements Exception {
|
|
String errorMessage;
|
|
BuyExceptionType type;
|
|
BuyException(this.errorMessage, this.type);
|
|
|
|
@override
|
|
String toString() {
|
|
return errorMessage;
|
|
}
|
|
}
|
|
|
|
class BuyResponse<T> {
|
|
final T? value;
|
|
final BuyException? exception;
|
|
|
|
BuyResponse({this.value, this.exception});
|
|
|
|
@override
|
|
String toString() {
|
|
return "{error: $exception, value: $value}";
|
|
}
|
|
}
|