Skip to content

Commit 70b7356

Browse files
committed
feat: display outputs
1 parent ecb2c26 commit 70b7356

File tree

1 file changed

+12
-14
lines changed

1 file changed

+12
-14
lines changed

Bitkit/Views/Wallets/Activity/ActivityExplorerView.swift

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ struct ActivityExplorerView: View {
99
@EnvironmentObject var currency: CurrencyViewModel
1010

1111
@State private var txDetails: TxDetails?
12-
@State private var isLoadingTransaction = false
1312

1413
private var onchain: OnchainActivity? {
1514
guard case let .onchain(activity) = item else { return nil }
@@ -44,12 +43,9 @@ struct ActivityExplorerView: View {
4443
let details = try await AddressChecker.getTransaction(txid: onchain.txId)
4544
await MainActor.run {
4645
txDetails = details
47-
isLoadingTransaction = false
4846
}
4947
} catch {
50-
await MainActor.run {
51-
isLoadingTransaction = false
52-
}
48+
await MainActor.run {}
5349
}
5450
}
5551

@@ -127,17 +123,19 @@ struct ActivityExplorerView: View {
127123
content: "\(onchain.txId):0",
128124
)
129125

130-
CaptionText("OUTPUTS (2)")
131-
.textCase(.uppercase)
132-
.padding(.bottom, 8)
133-
VStack(alignment: .leading, spacing: 4) {
134-
ForEach(0 ..< 2, id: \.self) { i in
135-
BodySSBText("bcrt1q...output\(i)")
136-
.lineLimit(1)
137-
.truncationMode(.middle)
126+
if let txDetails {
127+
CaptionText("OUTPUTS (\(txDetails.vout.count))")
128+
.textCase(.uppercase)
129+
.padding(.bottom, 8)
130+
VStack(alignment: .leading, spacing: 4) {
131+
ForEach(Array(txDetails.vout.enumerated()), id: \.offset) { _, output in
132+
BodySSBText(output.scriptpubkey_address ?? "")
133+
.lineLimit(1)
134+
.truncationMode(.middle)
135+
}
138136
}
137+
.padding(.bottom, 16)
139138
}
140-
.padding(.bottom, 16)
141139

142140
Divider()
143141
.padding(.bottom, 16)

0 commit comments

Comments
 (0)