mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-24 04:29:28 +00:00
23 lines
No EOL
701 B
Dart
23 lines
No EOL
701 B
Dart
enum TransactionDirection { incoming, outgoing }
|
|
|
|
TransactionDirection parseTransactionDirectionFromInt(int raw) {
|
|
switch (raw) {
|
|
case 0:
|
|
return TransactionDirection.incoming;
|
|
case 1:
|
|
return TransactionDirection.outgoing;
|
|
default:
|
|
throw Exception('Unexpected token: raw for TransactionDirection parseTransactionDirectionFromInt');
|
|
}
|
|
}
|
|
|
|
TransactionDirection parseTransactionDirectionFromNumber(String raw) {
|
|
switch (raw) {
|
|
case "0":
|
|
return TransactionDirection.incoming;
|
|
case "1":
|
|
return TransactionDirection.outgoing;
|
|
default:
|
|
throw Exception('Unexpected token: raw for TransactionDirection parseTransactionDirectionFromNumber');
|
|
}
|
|
} |