SPB Git

spb/os-vault Public

Self-custody, multi-chain crypto wallet for macOS. One recovery phrase, six chain families, zero API keys — nothing leaves your Mac.

Swift 96% Shell 3.4% Makefile 0.6%
1.6 KB · 50 lines swift
Raw Blame History
1//2//  ReceiveView.swift3//  OS Vault4//5//  Author: Simon-Pierre Boucher6//  Mail: contact@spboucher.ai7//89import SwiftUI1011struct ReceiveView: View {12    @EnvironmentObject var app: AppState13    @Environment(\.dismiss) private var dismiss1415    var body: some View {16        VStack(spacing: 16) {17            HStack {18                Text("Receive").font(.title2.bold())19                Spacer()20                NetworkBadge(network: app.network)21            }22            if let address = app.address {23                if let qr = QRCode.image(for: address) {24                    Image(nsImage: qr)25                        .interpolation(.none)26                        .resizable()27                        .frame(width: 220, height: 220)28                        .background(.white)29                        .clipShape(RoundedRectangle(cornerRadius: 8))30                }31                Text(address)32                    .font(.callout.monospaced())33                    .textSelection(.enabled)34                    .padding(10)35                    .background(.quaternary.opacity(0.4))36                    .clipShape(RoundedRectangle(cornerRadius: 8))37                CopyButton(text: address)38                Text("Send only assets on \(app.network.config.displayName) (chain ID \(String(app.network.config.chainID))) to this address.")39                    .font(.caption)40                    .foregroundStyle(.secondary)41                    .multilineTextAlignment(.center)42            }43            Button("Done") { dismiss() }44                .keyboardShortcut(.defaultAction)45        }46        .padding(24)47        .frame(width: 380)48    }49}50