Popup:
    title: "Electrum"
    confirmed: 0
    unconfirmed: 0
    unmatured: 0
    lightning: 0
    watching_only: app.wallet.is_watching_only()
    has_seed: app.wallet.has_seed()
    on_parent:
        self.confirmed, self.unconfirmed, self.unmatured = app.wallet.get_balance()
        self.lightning = int(app.wallet.lnworker.get_balance()) if app.wallet.lnworker else 0
    BoxLayout:
        orientation: 'vertical'
        ScrollView:
            GridLayout:
                cols: 1
                height: self.minimum_height
                size_hint_y: None
                padding: '10dp'
                spacing: '10dp'
                padding: '10dp'
                spacing: '10dp'
                GridLayout:
                    cols: 1
                    size_hint_y: None
                    height: self.minimum_height
                    spacing: '10dp'
                    BoxLabel:
                        text: _('Wallet Name')
                        value: app.wallet_name
                    BoxLabel:
                        text: _("Wallet type:")
                        value: app.wallet.wallet_type
                    BoxButton:
                        text: _("Lightning:")
                        value: app.lightning_status()
                        callback: lambda: app.on_lightning_status(root)
                    BoxLabel:
                        text: _("Balance") + ':'
                        value: app.format_amount_and_units(root.confirmed + root.unconfirmed + root.unmatured + root.lightning)
                    BoxLabel:
                        text: ' - ' + _("Onchain") + ':'
                        value: app.format_amount_and_units(root.confirmed + root.unconfirmed + root.unmatured)
                        opacity: 1 if root.lightning else 0
                    BoxLabel:
                        text: ' - ' + _("Lightning") + ':'
                        opacity: 1 if root.lightning else 0
                        value: app.format_amount_and_units(root.lightning)
                GridLayout:
                    cols: 1
                    height: self.minimum_height
                    size_hint_y: None
                    padding: '10dp'
                    spacing: '10dp'
                    id: master_public_keys
                    TopLabel:
                        text: _('Master Public Key')
                    RefLabel:
                        data: app.wallet.get_master_public_key() or 'None'
                        name: _('Master Public Key')
                    TopLabel:
                        text: _('This wallet is watching-only') if root.watching_only else (_('Seed') if root.has_seed else _('No seed stored for wallet'))
                    RefLabel:
                        id: seed_label
                        visible: root.has_seed
                        data: ''
                        name: _('Seed')
                        on_touched: if not self.data and root.has_seed: app.show_seed(seed_label)

        BoxLayout:
            size_hint: 1, None
            height: '48dp'
            Button:
                size_hint: 0.5, None
                height: '48dp'
                text: _('Delete')
                on_release:
                    root.dismiss()
                    app.delete_wallet()
            Button:
                size_hint: 0.5, None
                height: '48dp'
                text: _('Export Backup')
                on_release:
                    root.dismiss()
                    app.save_backup()
