Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-3404 Updated transaction type #3405

Merged
merged 1 commit into from
Apr 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading