Skip to content

Commit

Permalink
feat(ui): Format trade-related wallet history entries
Browse files Browse the repository at this point in the history
  • Loading branch information
luckysori committed Jun 29, 2023
1 parent 528ad6c commit 4a18708
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions mobile/lib/features/wallet/wallet_history_item.dart
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,16 @@ class WalletHistoryItem extends StatelessWidget {
case WalletHistoryItemDataType.onChain:
return data.txid ?? "";
case WalletHistoryItemDataType.trade:
return data.orderId ?? "";
final orderId = data.orderId!.substring(0, 8);
switch (data.flow) {
case PaymentFlow.inbound:
return "Closed position with order $orderId";
case PaymentFlow.outbound:
return "Opened position with order $orderId";
}
case WalletHistoryItemDataType.orderMatchingFee:
return data.orderId is String ? "Matching fee for ${data.orderId!.substring(0, 8)}" : "";
final orderId = data.orderId!.substring(0, 8);
return "Matching fee for $orderId";
}
}();

Expand Down

0 comments on commit 4a18708

Please sign in to comment.