Skip to content

Commit f61ca8d

Browse files
authored
Merge pull request #205 from dom-jiang/main
Add gp token price
2 parents 519ff86 + 2a3bb9d commit f61ca8d

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

app.py

+19-2
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,26 @@ def handle_dcl_points():
704704

705705
@app.route('/get-fee-by-account', methods=['GET'])
706706
def handle_fee_by_account():
707-
ret_data = {}
708707
pool_id = request.args.get("pool_id")
709708
account_id = request.args.get("account_id")
709+
ret_data = handel_account_fee(pool_id, account_id)
710+
return compress_response_content(ret_data)
711+
712+
713+
@app.route('/batch-get-fee-by-account', methods=['GET'])
714+
def handle_batch_fee_by_account():
715+
ret_data = []
716+
pool_ids = request.args.get("pool_ids")
717+
account_id = request.args.get("account_id")
718+
pool_id_list = pool_ids.split(",")
719+
for pool_id in pool_id_list:
720+
ret = handel_account_fee(pool_id, account_id)
721+
ret_data.append(ret)
722+
return compress_response_content(ret_data)
723+
724+
725+
def handel_account_fee(pool_id, account_id):
726+
ret_data = {}
710727
if pool_id is None or account_id is None:
711728
return "null"
712729
# unclaimed_fee_data = query_dcl_user_unclaimed_fee(Cfg.NETWORK_ID, pool_id, account_id)
@@ -796,7 +813,7 @@ def handle_fee_by_account():
796813
"user_token": user_token,
797814
"change_log_data": ret_change_log_data
798815
}
799-
return compress_response_content(ret_data)
816+
return ret_data
800817

801818

802819
@app.route('/get-dcl-points-by-account', methods=['GET'])

config.py

+1
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,7 @@ class Cfg:
410410
"MD_ID": "v2.ref-finance.near|NA|17208628f84f5d6ad33f0da3bbbeb27ffcb398eac501a31bd6ad2011e36133a1",
411411
"DECIMAL": 6},
412412
{"SYMBOL": "KAT", "NEAR_ID": "kat.token0.near", "MD_ID": "v2.ref-finance.near|5391|wrap.near", "DECIMAL": 18},
413+
{"SYMBOL": "GP", "NEAR_ID": "gp.token0.near", "MD_ID": "v2.ref-finance.near|5422|wrap.near", "DECIMAL": 18},
413414
],
414415
"BASE_MAINNET": [
415416
],

0 commit comments

Comments
 (0)