Пример #1
0
 def updateAvailableBalance(self):
     moniker = str(self.cbMoniker.currentText())
     if moniker:
         asset = wallet.get_asset_definition(moniker)
         balance = wallet.get_available_balance(moniker)
         self.edtAmount.setMaximum(balance)
         self.lblAvailaleBalance.setText("%s %s" % (asset.format_value(balance), moniker))
Пример #2
0
    def cbMonikerIndexChanged(self):
        moniker = str(self.cbMoniker.currentText())
        if moniker == '':
            return

        asset = wallet.get_asset_definition('bitcoin')
        value = asset.format_value(wallet.get_available_balance(asset))
        text = '<b>Buy</b> {0} (Available: {1} bitcoin)'.format(moniker, value)
        self.lblBuy.setText(text)

        asset = wallet.get_asset_definition(moniker)
        value = asset.format_value(wallet.get_available_balance(asset))
        text = '<b>Sell</b> {0} (Available: {1} {0})'.format(moniker, value)
        self.lblSell.setText(text)

        self.update_offers()
Пример #3
0
    def update_balance(self):
        moniker = str(self.cbMoniker.currentText())
        if moniker == '':
            return

        asset = wallet.get_asset_definition('bitcoin')
        value = asset.format_value(wallet.get_available_balance(asset))
        self.lblBuy.setText('<b>Buy</b> %s' % moniker)
        self.lblBuyAvail.setText('(Available: %s bitcoin)' % value)

        asset = wallet.get_asset_definition(moniker)
        value = asset.format_value(wallet.get_available_balance(asset))
        self.lblSell.setText('<b>Sell</b> %s' % moniker)
        self.lblSellAvail.setText('(Available: %s %s)' % (value, moniker))

        self.update_offers()
Пример #4
0
 def btnSellClicked(self):
     valid = True
     if not self.edtSellQuantity.text().toDouble()[1]:
         self.edtSellQuantity.setStyleSheet('background:#FF8080')
         valid = False
     if not self.edtSellPrice.text().toDouble()[1]:
         self.edtSellPrice.setStyleSheet('background:#FF8080')
         valid = False
     if not valid:
         return
     moniker = str(self.cbMoniker.currentText())
     asset = wallet.get_asset_definition(moniker)
     value = self.edtSellQuantity.text().toDouble()[0]
     bitcoin = wallet.get_asset_definition('bitcoin')
     price = self.edtSellPrice.text().toDouble()[0]
     delta = wallet.get_available_balance(asset) - asset.parse_value(value)
     if delta < 0:
         message = 'The transaction amount exceeds available balance by %s %s' % \
             (asset.format_value(-delta), moniker)
         QtGui.QMessageBox.critical(self, '', message, QtGui.QMessageBox.Ok)
         return
     offer = wallet.p2ptrade_make_offer(True, {
         'moniker': moniker,
         'value': value,
         'price': price,
     })
     wallet.p2p_agent.register_my_offer(offer)
     self.update_offers()
     self.edtSellQuantity.setText('')
     self.edtSellPrice.setText('')
Пример #5
0
 def btnSellClicked(self):
     valid = True
     if not self.edtSellQuantity.text().toDouble()[1]:
         self.edtSellQuantity.setStyleSheet('background:#FF8080')
         valid = False
     if not self.edtSellPrice.text().toDouble()[1]:
         self.edtSellPrice.setStyleSheet('background:#FF8080')
         valid = False
     if not valid:
         return
     moniker = str(self.cbMoniker.currentText())
     asset = wallet.get_asset_definition(moniker)
     value = self.edtSellQuantity.text().toDouble()[0]
     bitcoin = wallet.get_asset_definition('bitcoin')
     price = self.edtSellPrice.text().toDouble()[0]
     delta = wallet.get_available_balance(asset) - asset.parse_value(value)
     if delta < 0:
         message = 'The transaction amount exceeds available balance by %s %s' % \
             (asset.format_value(-delta), moniker)
         QtGui.QMessageBox.critical(self, '', message, QtGui.QMessageBox.Ok)
         return
     offer = wallet.p2ptrade_make_offer(True, {
         'moniker': moniker,
         'value': value,
         'price': price,
     })
     wallet.p2p_agent.register_my_offer(offer)
     self.update_offers()
     self.edtSellQuantity.setText('')
     self.edtSellPrice.setText('')
Пример #6
0
    def tvSellDoubleClicked(self):
        selected = self.tvSell.selectedIndexes()
        if not selected:
            return
        index = self.proxyModelSell.index(selected[0].row(), 3)
        oid = str(self.proxyModelSell.data(index).toString())
        if oid in wallet.p2p_agent.their_offers:
            offer = wallet.p2p_agent.their_offers[oid]
            moniker = str(self.cbMoniker.currentText())
            asset = wallet.get_asset_definition(moniker)
            if wallet.get_available_balance(asset) < offer.get_data()['A']['value']:
                QtGui.QMessageBox.warning(self, '', "Not enough money...",
                    QtGui.QMessageBox.Cancel)
                return
            message = "Buy <b>{value}</b> {moniker} for <b>{course}</b> \
bitcoin (Total: <b>{total}</b> bitcoin)".format(**{
                'value': self.proxyModelSell.data(selected[1]).toString(),
                'moniker': moniker,
                'course': self.proxyModelSell.data(selected[0]).toString(),
                'total': self.proxyModelSell.data(selected[2]).toString(),
            })
            retval = QtGui.QMessageBox.question(
                self, "Confirm buy coins", message,
                QtGui.QMessageBox.Yes | QtGui.QMessageBox.Cancel,
                QtGui.QMessageBox.Cancel)
            if retval != QtGui.QMessageBox.Yes:
                return
            new_offer = wallet.p2ptrade_make_mirror_offer(offer)
            wallet.p2p_agent.register_my_offer(new_offer)
        else:
            offer = wallet.p2p_agent.my_offers[oid]
            wallet.p2p_agent.cancel_my_offer(offer)
        self.update_offers()
Пример #7
0
 def updateAvailableBalance(self):
     moniker = str(self.cbMoniker.currentText())
     if moniker:
         asset = wallet.get_asset_definition(moniker)
         balance = wallet.get_available_balance(moniker)
         self.edtAmount.setMaximum(balance)
         self.lblAvailaleBalance.setText(
             '%s %s' % (asset.format_value(balance), moniker))
Пример #8
0
    def update(self):
        allowTextSelection = (
            QtCore.Qt.LinksAccessibleByMouse |
            QtCore.Qt.TextSelectableByKeyboard |
            QtCore.Qt.TextSelectableByMouse)

        self.scrollAreaContents = QtGui.QWidget()
        self.scrollArea.setWidget(self.scrollAreaContents)
        self.scrollAreaLayout = QtGui.QVBoxLayout(self.scrollAreaContents)

        hbox = QtGui.QHBoxLayout()
        hbox.addItem(QtGui.QSpacerItem(20, 0))
        hbox.setStretch(0, 1)
        updateButton = QtGui.QPushButton('Update', self.scrollAreaContents)
        updateButton.clicked.connect(self.updateButtonClicked)
        hbox.addWidget(updateButton)
        self.scrollAreaLayout.addLayout(hbox)

        for moniker in wallet.get_all_monikers():
            asset = wallet.get_asset_definition(moniker)
            address = wallet.get_some_address(asset)
            total_balance = wallet.get_total_balance(asset)
            unconfirmed_balance = wallet.get_unconfirmed_balance(asset)

            groupBox = QtGui.QGroupBox(moniker, self.scrollAreaContents)
            layout = QtGui.QFormLayout(groupBox)

            label = QtGui.QLabel(groupBox)
            label.setText('Balance:')
            layout.setWidget(0, QtGui.QFormLayout.LabelRole, label)

            balance_text = asset.format_value(total_balance)
            if not (unconfirmed_balance == 0):
                balance_text += " (%s unconfirmed, %s available)" % \
                    (asset.format_value(unconfirmed_balance),
                     asset.format_value(wallet.get_available_balance(asset)))

            label = QtGui.QLabel(groupBox)
            label.setTextInteractionFlags(allowTextSelection)
            label.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))
            label.setText(balance_text)
            layout.setWidget(0, QtGui.QFormLayout.FieldRole, label)

            label = QtGui.QLabel(groupBox)
            label.setText('Address:')
            layout.setWidget(1, QtGui.QFormLayout.LabelRole, label)

            label = QtGui.QLabel(groupBox)
            label.setTextInteractionFlags(allowTextSelection)
            label.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))
            label.setText(address)
            layout.setWidget(1, QtGui.QFormLayout.FieldRole, label)

            self.scrollAreaLayout.addWidget(groupBox)

        self.scrollAreaLayout.addItem(QtGui.QSpacerItem(20, 0))
        self.scrollAreaLayout.setStretch(self.scrollAreaLayout.count()-1, 1)
Пример #9
0
    def update(self):
        allowTextSelection = (QtCore.Qt.LinksAccessibleByMouse
                              | QtCore.Qt.TextSelectableByKeyboard
                              | QtCore.Qt.TextSelectableByMouse)

        self.scrollAreaContents = QtGui.QWidget()
        self.scrollArea.setWidget(self.scrollAreaContents)
        self.scrollAreaLayout = QtGui.QVBoxLayout(self.scrollAreaContents)

        hbox = QtGui.QHBoxLayout()
        hbox.addItem(QtGui.QSpacerItem(20, 0))
        hbox.setStretch(0, 1)
        updateButton = QtGui.QPushButton('Update', self.scrollAreaContents)
        updateButton.clicked.connect(self.updateButtonClicked)
        hbox.addWidget(updateButton)
        self.scrollAreaLayout.addLayout(hbox)

        for moniker in wallet.get_all_monikers():
            asset = wallet.get_asset_definition(moniker)
            address = wallet.get_some_address(asset)
            total_balance = wallet.get_total_balance(asset)
            unconfirmed_balance = wallet.get_unconfirmed_balance(asset)

            groupBox = QtGui.QGroupBox(moniker, self.scrollAreaContents)
            layout = QtGui.QFormLayout(groupBox)

            label = QtGui.QLabel(groupBox)
            label.setText('Balance:')
            layout.setWidget(0, QtGui.QFormLayout.LabelRole, label)

            balance_text = asset.format_value(total_balance)
            if not (unconfirmed_balance == 0):
                balance_text += " (%s unconfirmed, %s available)" % \
                    (asset.format_value(unconfirmed_balance),
                     asset.format_value(wallet.get_available_balance(asset)))

            label = QtGui.QLabel(groupBox)
            label.setTextInteractionFlags(allowTextSelection)
            label.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))
            label.setText(balance_text)
            layout.setWidget(0, QtGui.QFormLayout.FieldRole, label)

            label = QtGui.QLabel(groupBox)
            label.setText('Address:')
            layout.setWidget(1, QtGui.QFormLayout.LabelRole, label)

            label = QtGui.QLabel(groupBox)
            label.setTextInteractionFlags(allowTextSelection)
            label.setCursor(QtGui.QCursor(QtCore.Qt.IBeamCursor))
            label.setText(address)
            layout.setWidget(1, QtGui.QFormLayout.FieldRole, label)

            self.scrollAreaLayout.addWidget(groupBox)

        self.scrollAreaLayout.addItem(QtGui.QSpacerItem(20, 0))
        self.scrollAreaLayout.setStretch(self.scrollAreaLayout.count() - 1, 1)
Пример #10
0
    def tvBuyDoubleClicked(self):
        """click on bids, colored coins will be sold"""
        selected = self.tvBuy.selectedIndexes()
        if not selected:
            return
        index = self.proxyModelBuy.index(selected[0].row(), 3)
        oid = str(self.proxyModelBuy.data(index).toString())
        if oid in wallet.p2p_agent.their_offers:
            offer = wallet.p2p_agent.their_offers[oid]
            moniker = str(self.cbMoniker.currentText())
            asset = wallet.get_asset_definition(moniker)
            if wallet.get_available_balance(asset) < offer.get_data()['B']['value']:
                self.logger.warn("%s avail <  %s required",
                                 wallet.get_available_balance(asset),
                                 offer.get_data()['A']['value'])
                msg = "Not enough coins: %s %s needed, %s available" % \
                    (str(self.proxyModelBuy.data(selected[2]).toString()),
                     moniker,
                     asset.format_value(wallet.get_available_balance(asset)))
                QtGui.QMessageBox.warning(self, '', msg,
                    QtGui.QMessageBox.Ok)
                return
            message = "About to <u>sell</u> <b>{value}</b> {moniker} @ <b>{course}</b> \
bitcoin each. <br> (Total: <b>{total}</b> bitcoin)".format(**{
                'value': self.proxyModelBuy.data(selected[1]).toString(),
                'moniker': str(self.cbMoniker.currentText()),
                'course': self.proxyModelBuy.data(selected[0]).toString(),
                'total': self.proxyModelBuy.data(selected[2]).toString(),
            })
            retval = QtGui.QMessageBox.question(
                self, "Confirm buying asset", message,
                QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel,
                QtGui.QMessageBox.Cancel)
            if retval != QtGui.QMessageBox.Ok:
                return
            new_offer = wallet.p2ptrade_make_mirror_offer(offer)
            wallet.p2p_agent.register_my_offer(new_offer)
        else:
            offer = wallet.p2p_agent.my_offers[oid]
            wallet.p2p_agent.cancel_my_offer(offer)
        self.update_offers()
Пример #11
0
    def tvSellDoubleClicked(self):
        """"Click on asks, colored coins are going to be bought"""
        selected = self.tvSell.selectedIndexes()
        if not selected:
            return
        index = self.proxyModelSell.index(selected[0].row(), 3)
        oid = str(self.proxyModelSell.data(index).toString())
        if oid in wallet.p2p_agent.their_offers:
            offer = wallet.p2p_agent.their_offers[oid]
            moniker = str(self.cbMoniker.currentText())
            bitcoin = wallet.get_asset_definition('bitcoin')
            if wallet.get_available_balance(bitcoin) < offer.get_data()['B']['value']:
                self.logger.warn("Not enough money: %s <  %s",
                                 wallet.get_available_balance(bitcoin),
                                 offer.get_data()['B']['value'])
                msg = "Not enough money: %s bitcoins needed, %s available" % \
                    (self.proxyModelSell.data(selected[2]).toString(),
                     bitcoin.format_value(wallet.get_available_balance(bitcoin)))
                QtGui.QMessageBox.warning(self, '', msg,
                                          QtGui.QMessageBox.Ok)
                return
            message = "About to <u>buy</u> <b>{value}</b> {moniker} @ <b>{course}</b> \
bitcoin each. <br> (Total: <b>{total}</b> bitcoin)".format(**{
                'value': self.proxyModelSell.data(selected[1]).toString(),
                'moniker': moniker,
                'course': self.proxyModelSell.data(selected[0]).toString(),
                'total': self.proxyModelSell.data(selected[2]).toString(),
            })
            retval = QtGui.QMessageBox.question(
                self, "Confirm buy coins", message,
                QtGui.QMessageBox.Ok | QtGui.QMessageBox.Cancel,
                QtGui.QMessageBox.Cancel)
            if retval != QtGui.QMessageBox.Ok:
                return
            new_offer = wallet.p2ptrade_make_mirror_offer(offer)
            wallet.p2p_agent.register_my_offer(new_offer)
        else:
            offer = wallet.p2p_agent.my_offers[oid]
            wallet.p2p_agent.cancel_my_offer(offer)
        self.update_offers()
Пример #12
0
    def validate_sell_input(self, quantity, price):
        moniker = str(self.cbMoniker.currentText())
        asset = wallet.get_asset_definition(moniker)
        bitcoin = wallet.get_asset_definition('bitcoin')

        # check if quantity was given
        if quantity <= Decimal("0"): # no quantity
            self.edtSellQuantity.setStyleSheet('background:#FF8080')
            return False

        # check if price was given
        if price <= Decimal("0"): # no price
            self.edtSellPrice.setStyleSheet('background:#FF8080')
            return False

        # quantity must be multiple of atom
        if not asset.validate_value(quantity):
            atom = asset.format_value(1)
            message = "Quantity must be a multiple of %s!" % atom
            QtGui.QMessageBox.critical(self, '', message, QtGui.QMessageBox.Ok)
            self.edtSellQuantity.setStyleSheet('background:#FF8080')
            return False

        # price must be multiple of atom
        if not bitcoin.validate_value(price):
            atom = bitcoin.format_value(1)
            message = "Price must be a multiple of %s!" % atom
            QtGui.QMessageBox.critical(self, '', message, QtGui.QMessageBox.Ok)
            self.edtSellPrice.setStyleSheet('background:#FF8080')
            return False

        # check if amount exceeds available balance
        needed = asset.parse_value(quantity)
        delta = wallet.get_available_balance(asset) - needed
        if delta < 0:
            args = (asset.format_value(-delta), moniker)
            msg_str = 'The amount exceeds available balance by %s %s'
            message = msg_str % args
            QtGui.QMessageBox.critical(self, '', message, QtGui.QMessageBox.Ok)
            self.edtSellQuantity.setStyleSheet('background:#FF8080')
            self.edtSellPrice.setStyleSheet('background:#FF8080')
            return False

        return True
Пример #13
0
    def validate_buy_input(self, quantity, price):
        moniker = str(self.cbMoniker.currentText())
        asset = wallet.get_asset_definition(moniker)
        bitcoin = wallet.get_asset_definition('bitcoin')

        # check if quantity was given
        if quantity <= Decimal("0"): # no quantity
            self.edtBuyQuantity.setStyleSheet('background:#FF8080')
            return False

        # check if price was given
        if price <= Decimal("0"): # no price
            self.edtBuyPrice.setStyleSheet('background:#FF8080')
            return False

        # quantity must be multiple of atom
        if not asset.validate_value(quantity):
            message = "Quantity must be a multiple of %s!" % asset.get_atom()
            QtGui.QMessageBox.critical(self, '', message, QtGui.QMessageBox.Ok)
            self.edtBuyQuantity.setStyleSheet('background:#FF8080')
            return False

        # price must be multiple of atom
        if not bitcoin.validate_value(price):
            message = "Price must be a multiple of %s!" % asset.get_atom()
            QtGui.QMessageBox.critical(self, '', message, QtGui.QMessageBox.Ok)
            self.edtBuyPrice.setStyleSheet('background:#FF8080')
            return False

        # check if amount exceeds available balance
        needed = quantity * bitcoin.parse_value(price)
        available = wallet.get_available_balance(bitcoin)
        delta = available - needed
        if delta < 0:
            neg_delta = bitcoin.format_value(-delta)
            msg_str = 'The amount exceeds available balance by %s bitcoin!'
            message = msg_str % neg_delta
            QtGui.QMessageBox.critical(self, '', message, QtGui.QMessageBox.Ok)
            self.edtBuyQuantity.setStyleSheet('background:#FF8080')
            self.edtBuyPrice.setStyleSheet('background:#FF8080')
            return False

        return True
Пример #14
0
    def __init__(self, parent):
        QtGui.QDialog.__init__(self, parent)
        uic.loadUi(uic.getUiPath('issuedialog.ui'), self)

        self.cbScheme.addItem('epobc')
        self.cbScheme.addItem('obc')

        for wname in ['edtMoniker', 'edtUnits', 'edtAtoms']:
            def clearBackground(event, wname=wname):
                getattr(self, wname).setStyleSheet('')
                QtGui.QLineEdit.focusInEvent(getattr(self, wname), event)
            getattr(self, wname).focusInEvent = clearBackground

        self.edtUnits.textChanged.connect(self.changeTotalBTC)
        self.edtAtoms.textChanged.connect(self.changeTotalBTC)

        self.availableBTC = wallet.get_available_balance('bitcoin')
        self.lblTotalBTC.setToolTip('Available: %s bitcoin' % \
            wallet.get_asset_definition('bitcoin').format_value(self.availableBTC))
Пример #15
0
 def btnSendClicked(self):
     entries = [self.entries.itemAt(i).widget() for i in xrange(self.entries.count())]
     if not all([entry.isValid() for entry in entries]):
         return
     data = [entry.getData() for entry in entries]
     message = "Are you sure you want to send"
     for recipient in data:
         asset = wallet.get_asset_definition(recipient["moniker"])
         value = asset.format_value(recipient["value"])
         message += "<br><b>{value} {moniker}</b> to {address}".format(
             **{
                 "value": value,
                 "moniker": "BTC" if recipient["moniker"] == "bitcoin" else recipient["moniker"],
                 "address": recipient["address"],
             }
         )
     message += "?"
     retval = QtGui.QMessageBox.question(
         self,
         "Confirm send coins",
         message,
         QtGui.QMessageBox.Yes | QtGui.QMessageBox.Cancel,
         QtGui.QMessageBox.Cancel,
     )
     if retval != QtGui.QMessageBox.Yes:
         return
     # check value exceeds balance
     currency = collections.defaultdict(Decimal)
     for recipient in data:
         currency[recipient["moniker"]] += recipient["value"]
     for moniker, value in currency.items():
         if value > wallet.get_available_balance(moniker):
             QtGui.QMessageBox.warning(
                 self,
                 "Send coins",
                 "The amount for <b>%s</b> exceeds your available balance." % moniker,
                 QtGui.QMessageBox.Ok,
             )
             return
     wallet.send_coins(data)
     self.parent().parent().parent().update()
Пример #16
0
    def __init__(self, parent):
        QtGui.QDialog.__init__(self, parent)
        uic.loadUi(uic.getUiPath('issuedialog.ui'), self)

        self.cbScheme.addItem('epobc')
        self.cbScheme.addItem('obc')

        for wname in ['edtMoniker', 'edtUnits', 'edtAtoms']:

            def clearBackground(event, wname=wname):
                getattr(self, wname).setStyleSheet('')
                QtGui.QLineEdit.focusInEvent(getattr(self, wname), event)

            getattr(self, wname).focusInEvent = clearBackground

        self.edtUnits.textChanged.connect(self.changeTotalBTC)
        self.edtAtoms.textChanged.connect(self.changeTotalBTC)

        self.availableBTC = wallet.get_available_balance('bitcoin')
        self.lblTotalBTC.setToolTip('Available: %s bitcoin' % \
            wallet.get_asset_definition('bitcoin').format_value(self.availableBTC))
Пример #17
0
 def btnSendClicked(self):
     entries = [
         self.entries.itemAt(i).widget()
         for i in xrange(self.entries.count())
     ]
     if not all([entry.isValid() for entry in entries]):
         return
     data = [entry.getData() for entry in entries]
     message = 'Are you sure you want to send'
     for recipient in data:
         asset = wallet.get_asset_definition(recipient['moniker'])
         value = asset.format_value(recipient['value'])
         message += '<br><b>{value} {moniker}</b> to {address}'.format(**{
             'value': value,
             'moniker': 'BTC' if recipient['moniker'] == 'bitcoin' \
                 else recipient['moniker'],
             'address': recipient['address'],
         })
     message += '?'
     retval = QtGui.QMessageBox.question(
         self, 'Confirm send coins', message,
         QtGui.QMessageBox.Yes | QtGui.QMessageBox.Cancel,
         QtGui.QMessageBox.Cancel)
     if retval != QtGui.QMessageBox.Yes:
         return
     # check value exceeds balance
     currency = collections.defaultdict(Decimal)
     for recipient in data:
         currency[recipient['moniker']] += recipient['value']
     for moniker, value in currency.items():
         if value > wallet.get_available_balance(moniker):
             QtGui.QMessageBox.warning(
                 self, 'Send coins',
                 'The amount for <b>%s</b> exceeds your available balance.'
                 % moniker, QtGui.QMessageBox.Ok)
             return
     wallet.send_coins(data)
     self.parent().parent().parent().update()
Пример #18
0
 def btnSendClicked(self):
     entries = [self.entries.itemAt(i).widget()
                 for i in xrange(self.entries.count())]
     if not all([entry.isValid() for entry in entries]):
         return
     data = [entry.getData() for entry in entries]
     message = 'Are you sure you want to send'
     for recipient in data:
         asset = wallet.get_asset_definition(recipient['moniker'])
         value = asset.format_value(recipient['value'])
         message += '<br><b>{value} {moniker}</b> to {address}'.format(**{
             'value': value,
             'moniker': 'BTC' if recipient['moniker'] == 'bitcoin' \
                 else recipient['moniker'],
             'address': recipient['address'],
         })
     message += '?'
     retval = QtGui.QMessageBox.question(
         self, 'Confirm send coins',
         message,
         QtGui.QMessageBox.Yes | QtGui.QMessageBox.Cancel,
         QtGui.QMessageBox.Cancel)
     if retval != QtGui.QMessageBox.Yes:
         return
     # check value exceeds balance
     currency = collections.defaultdict(float)
     for recipient in data:
         currency[recipient['moniker']] += recipient['value']
     for moniker, value in currency.items():
         if value > wallet.get_available_balance(moniker):
             QtGui.QMessageBox.warning(
                 self, 'Send coins',
                 'The amount for <b>%s</b> exceeds your available balance.' % moniker,
                 QtGui.QMessageBox.Ok)
             return
     wallet.send_coins(data)
     self.parent().parent().parent().update()