Show live swap status, explorer links, and full kyc.rip route details

This commit is contained in:
2026-10-26 21:31:41 +08:00
parent 2f70931cba
commit 3ff5385a9b
13 changed files with 759 additions and 150 deletions
+20
View File
@@ -11,6 +11,26 @@ enum Chain: String, Codable, CaseIterable {
}
}
/// Web block explorers used for "view on the web" links.
enum BlockExplorer {
static func transactionURL(chain: Chain, hash: String) -> URL? {
guard !hash.isEmpty else { return nil }
switch chain {
case .xmr: return URL(string: "https://xmrchain.net/tx/\(hash)")
case .xrp: return URL(string: "https://livenet.xrpl.org/transactions/\(hash)")
}
}
/// Same lookup for a raw ticker ("XMR"/"XRP"), as used by the swap API.
static func transactionURL(ticker: String, hash: String) -> URL? {
switch ticker.uppercased() {
case "XMR": return transactionURL(chain: .xmr, hash: hash)
case "XRP": return transactionURL(chain: .xrp, hash: hash)
default: return nil
}
}
}
struct WalletRecord: Codable, Identifiable, Equatable {
let id: String
var name: String