mirror of
https://git.wownero.com/wownero/wownero-funding-system.git
synced 2024-08-15 00:53:45 +00:00
aeonfunding update for wownero
a lot more generic; a lot more configurable; UI goodness with accounting; wallet account support for ezmode
This commit is contained in:
parent
f473a4234e
commit
955de2544e
19 changed files with 361 additions and 173 deletions
|
@ -2,11 +2,9 @@ from datetime import datetime
|
|||
from flask import request, redirect, Response, abort, render_template, url_for, flash, make_response, send_from_directory, jsonify
|
||||
from flask.ext.login import login_user , logout_user , current_user , login_required, current_user
|
||||
from flask_yoloapi import endpoint, parameter
|
||||
|
||||
import settings
|
||||
from wowfunding.factory import app, db_session
|
||||
from wowfunding.orm.orm import Proposal, User
|
||||
|
||||
from funding.factory import app, db_session
|
||||
from funding.orm.orm import Proposal, User
|
||||
|
||||
@app.route('/api/1/proposals')
|
||||
@endpoint.api(
|
||||
|
@ -21,15 +19,13 @@ def api_proposals_get(status, cat, limit, offset):
|
|||
except Exception as ex:
|
||||
print(ex)
|
||||
return 'error', 500
|
||||
|
||||
return [p.json for p in proposals]
|
||||
|
||||
|
||||
@app.route('/api/1/convert/wow-usd')
|
||||
@endpoint.api(
|
||||
parameter('wow', type=int, location='args', required=True)
|
||||
parameter('amount', type=int, location='args', required=True)
|
||||
)
|
||||
def api_wow_usd(wow):
|
||||
from wowfunding.bin.utils import Summary, wow_to_usd
|
||||
def api_coin_usd(amount):
|
||||
from funding.bin.utils import Summary, coin_to_usd
|
||||
prices = Summary.fetch_prices()
|
||||
return jsonify(usd=wow_to_usd(wows=wow, btc_per_wow=prices['wow-btc'], usd_per_btc=prices['btc-usd']))
|
||||
return jsonify(usd=coin_to_usd(amt=amount, btc_per_coin=prices['coin-btc'], usd_per_btc=prices['btc-usd']))
|
Loading…
Add table
Add a link
Reference in a new issue