Skip to content

Commit

Permalink
IOS-8202 Display addresses for tokens as well
Browse files Browse the repository at this point in the history
  • Loading branch information
amuraveinik committed Oct 16, 2024
1 parent aa7486a commit b8e972c
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions Tangem/App/Utilities/TransactionHistoryMapper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,12 +78,19 @@ struct TransactionHistoryMapper {
func mapSuggestedRecord(_ record: TransactionRecord) -> SendSuggestedDestinationTransactionRecord? {
guard
record.isOutgoing,
transactionType(from: record) == .transfer,
case .user(let address) = interactionAddress(from: record)
transactionType(from: record) == .transfer
else {
return nil
}

let address: String
switch interactionAddress(from: record) {
case .user(let value), .contract(let value):
address = value
default:
return nil
}

let amountFormatted = transferAmount(from: record)
let date = record.date ?? Date()
let dateFormatted = dateTimeFormatter.string(from: date)
Expand Down

0 comments on commit b8e972c

Please sign in to comment.