Skip to content

Commit

Permalink
Merge pull request #3405 from safe-global/GH-3404/update-trxn-type
Browse files Browse the repository at this point in the history
GH-3404 Updated transaction type
  • Loading branch information
DmitryBespalov authored Apr 26, 2024
2 parents 9caeaeb + 2cd3462 commit fd4ee26
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Multisig/Data/Services/Safe Client Gateway Service/SCGModels.swift
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ extension SCGModels {
case custom(Custom)
case rejection(Rejection)
case creation(Creation)
case swapOrder(SwapOrder)
case unknown

init(from decoder: Decoder) throws {
Expand All @@ -197,6 +198,8 @@ extension SCGModels {
}
case "Creation":
self = try .creation(Creation(from: decoder))
case "SwapOrder":
self = try .swapOrder(SwapOrder(from: decoder))
case "Unknown":
fallthrough
default:
Expand Down Expand Up @@ -373,6 +376,13 @@ extension SCGModels {
var implementation: AddressInfo?
var factory: AddressInfo?
}

struct SwapOrder: Decodable {
var uid: String
var status: String
var kind: String
var explorerUrl: URL
}
}

struct DataDecoded: Decodable {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,9 @@ class TransactionDetailCellBuilder {
} else {
rejectionHeader(nonce: nil, isQueued: tx.txStatus.isInQueue)
}
case .swapOrder(let orderInfo):
text("Swap order", title: "Contract Interaction", expandableTitle: nil, copyText: nil)
externalURL(text: "Order details", url: orderInfo.explorerUrl)
case .creation(_):
// ignore
fallthrough
Expand Down Expand Up @@ -656,6 +659,9 @@ class TransactionDetailCellBuilder {
case .creation(_):
type = "Safe Account created"
icon = UIImage(named: "ico-settings-tx")
case .swapOrder(_):
type = "Swap order"
icon = UIImage(named: "ico-custom-tx")
case .unknown:
type = "Unknown operation"
icon = UIImage(named: "ico-custom-tx")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,6 +365,9 @@ class TransactionListViewController: LoadableViewController, UITableViewDelegate
case .creation(_):
image = UIImage(named: "ico-settings-tx")
title = "Safe Account created"
case .swapOrder(_):
image = UIImage(named: "ico-custom-tx")
title = "Swap order"
case .unknown:
image = UIImage(named: "ico-custom-tx")
title = "Unknown operation"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ class WCIncomingTransactionRequestViewController: ReviewSafeTransactionViewContr
case .creation(_):
imageName = "ico-settings-tx"
name = "Safe Account created"
case .swapOrder(_):
imageName = "ico-custom-tx"
name = "Swap order"
case .unknown:
imageName = "ico-custom-tx"
name = "Unknown operation"
Expand Down

0 comments on commit fd4ee26

Please sign in to comment.