feat: 社区模块
This commit is contained in:
@@ -9,6 +9,7 @@ const { deriveNewAccount } = require('../../utils/account');
|
||||
const actionFilter = 'id type amount detail op createdAt';
|
||||
const { inject } = require('../../common/Provider');
|
||||
const ETH = require('../../utils/erc20').ERC20;
|
||||
const { USDTAddr } = require('../../common/constant');
|
||||
|
||||
const depositCoinsList = [{
|
||||
id: 'usdtBTC',
|
||||
@@ -189,7 +190,14 @@ module.exports = {
|
||||
// 查询资金,直接拉数据库,区块链的查询交给定时任务
|
||||
async refreshFund (req, res) {
|
||||
// todo: 要求刷新程序去刷新
|
||||
|
||||
const { userId } = res.locals.user;
|
||||
const fund = await Fund.findOne({ userId }).exec();
|
||||
const tokenAddress = fund && fund.tokenAddress;
|
||||
if(!tokenAddress || !tokenAddress['usdtETH']) return res.json({
|
||||
code: 0,
|
||||
data: fund.fundList
|
||||
});
|
||||
const txActions = await ETH.getActions(tokenAddress['usdtETH'], USDTAddr);
|
||||
return this.getFundList(req, res);
|
||||
},
|
||||
async getFundList (req, res) {
|
||||
|
||||
Reference in New Issue
Block a user