2021-12-24 12:52:08 +00:00
|
|
|
enum TransactionDirection { incoming, outgoing }
|
|
|
|
|
|
|
|
TransactionDirection parseTransactionDirectionFromInt(int raw) {
|
|
|
|
switch (raw) {
|
2022-10-12 17:09:57 +00:00
|
|
|
case 0:
|
|
|
|
return TransactionDirection.incoming;
|
|
|
|
case 1:
|
|
|
|
return TransactionDirection.outgoing;
|
|
|
|
default:
|
|
|
|
throw Exception('Unexpected token: raw for TransactionDirection parseTransactionDirectionFromInt');
|
2021-12-24 12:52:08 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
TransactionDirection parseTransactionDirectionFromNumber(String raw) {
|
|
|
|
switch (raw) {
|
2022-10-12 17:09:57 +00:00
|
|
|
case "0":
|
|
|
|
return TransactionDirection.incoming;
|
|
|
|
case "1":
|
|
|
|
return TransactionDirection.outgoing;
|
|
|
|
default:
|
|
|
|
throw Exception('Unexpected token: raw for TransactionDirection parseTransactionDirectionFromNumber');
|
2021-12-24 12:52:08 +00:00
|
|
|
}
|
|
|
|
}
|