コード例 #1
0
ファイル: wallet.py プロジェクト: CryptArc/flaskwallet
 def dispatch_request(self, id):
     super(WalletMoveView, self).dispatch_request(id)
     form = AccountMoveForm(request.form)
     choices = get_accounts(self.conn, getchoice=True)
     form.fromaccount.choices = choices
     form.toaccount.choices = choices
     accounts = get_accounts(self.conn, getbalance=True)
     fromaccount = urllib.unquote_plus(form.data['fromaccount'])
     toaccount = urllib.unquote_plus(form.data['toaccount'])
     fromaccount = real_format(fromaccount)
     toaccount = real_format(toaccount)
     if request.method == 'POST' and form.validate():
         amount = strtofloat(form.data['amount'])
         self.conn.move(
             fromaccount,
             toaccount,
             amount,
             int(get_setting('minconf', 6)),
             form.data['comment'],
         )
         flash(u"%f coins moved from %s to %s" % (amount,
               human_format(fromaccount), human_format(toaccount)),
               'success')
         return redirect(url_for('wallet.wallet_detail', id=id))
     return render_template("wallet/wallet/move.html", wallet=self.wallet,
                            form=form, accounts=accounts)
コード例 #2
0
ファイル: wallet.py プロジェクト: oditorium/flaskwallet
 def dispatch_request(self, id):
     super(WalletMoveView, self).dispatch_request(id)
     form = AccountMoveForm(request.form)
     choices = get_accounts(self.conn, getchoice=True)
     form.fromaccount.choices = choices
     form.toaccount.choices = choices
     accounts = get_accounts(self.conn, getbalance=True)
     fromaccount = urllib.unquote_plus(form.data['fromaccount'])
     toaccount = urllib.unquote_plus(form.data['toaccount'])
     fromaccount = real_format(fromaccount)
     toaccount = real_format(toaccount)
     if request.method == 'POST' and form.validate():
         amount = strtofloat(form.data['amount'])
         self.conn.move(
             fromaccount,
             toaccount,
             amount,
             int(get_setting('minconf', 6)),
             form.data['comment'],
         )
         flash(
             u"%f coins moved from %s to %s" %
             (amount, human_format(fromaccount), human_format(toaccount)),
             'success')
         return redirect(url_for('wallet.wallet_detail', id=id))
     return render_template("wallet/wallet/move.html",
                            wallet=self.wallet,
                            form=form,
                            accounts=accounts)
コード例 #3
0
ファイル: wallet.py プロジェクト: CryptArc/flaskwallet
 def dispatch_request(self, id):
     super(WalletDetailView, self).dispatch_request(id)
     data = {}
     data['info'] = self.conn.getinfo()
     data['accounts'] = get_accounts(self.conn, getbalance=True)
     data['global_send'] = int(get_setting('global_send', 1))
     data['forms'] = {}
     data['forms']['account'] = CreateAccountForm()
     data['forms']['txfee'] = SetTXFeeForm()
     form = CreateAccountForm(request.form)
     return render_template("wallet/wallet/detail.html", wallet=self.wallet,
                            data=data, form=form)
コード例 #4
0
ファイル: wallet.py プロジェクト: oditorium/flaskwallet
 def dispatch_request(self, id):
     super(WalletDetailView, self).dispatch_request(id)
     data = {}
     data['info'] = self.conn.getinfo()
     data['accounts'] = get_accounts(self.conn, getbalance=True)
     data['global_send'] = int(get_setting('global_send', 1))
     data['forms'] = {}
     data['forms']['account'] = CreateAccountForm()
     data['forms']['txfee'] = SetTXFeeForm()
     form = CreateAccountForm(request.form)
     return render_template("wallet/wallet/detail.html",
                            wallet=self.wallet,
                            data=data,
                            form=form)