import { get,POST } from './http'

export default class API {
	//盈利地址数
	static getDownloadFile(ids) {
		return get(`/marketall/ticket/downloadFile?ids=${ids}`)
		
	}



		//盈利地址数
		static getProfitAddress(req, radius, start, end) {
			if (start) {
				return get(`/marketall/${radius}/v2/${req}?start=${start}`)
			} else {
				return get(`/marketall/${radius}/v2/${req}`)
			}
		}

		//
		static getHolder(req, radius, start, end) {
			if (start) {
				return get(`/marketall/${radius}/${req}?start=${start}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}

	//验证邮箱是否注册过
	static getcheckMail(email) {
		return get(`/system/user/checkMail/${email}`)

	}
	//请求个人中心资料
	static getpersonal() {
		return get(`/system/user/profile`)

	}
	//请求重置密码验证码
	static getpasswrodCode() {
		return get(`/auth/restPwdCode`)

	}
	//请求注册弹窗验证码图片
	static getCodeEmail(username, email) {
		return get(`/auth/emailcode?userName=${username}&email=${email}`)

	}
	//请求验证码图片
	static getVerification() {
		return get(`/code`)

	}
	//请求erc20 token大额交易 前50的token
	static getETHTokenAbbrs() {
		return get(`/marketall/eth/ETHTokenAbbrs`)

	}
	//BTC移动平均线
	static getEthSma(day, start, end,) {
		if (start) {
			return get(`/marketall/eth/sma/${day}?start=${start}&end=${end}`)
		} else {
			return get(`/marketall/eth/sma/${day}`)
		}


	}

	//BTC移动平均线
	static getSma(day, start, end,) {
		if (start) {
			return get(`/marketall/btc/sma/${day}?start=${start}&end=${end}`)
		} else {
			return get(`/marketall/btc/sma/${day}`)
		}


	}

	//新合约地址
	static getNewContract(req, radius, page, limit,total) {
		if (total) {
			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}&total=${total}`)
		}else{
			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
		}
		

	}
	//11月2号 更改dailyBuySell接口
	static getDailyBuySell(req, radius, start, end, page, limit) {
		if (start) {
			return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&page=${page}&limit=${limit}`)
		} else {
			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
		}


	}

	//大额交易搜索 分页 没有时间搜索 26修改接口
	static getBigDeals3(req, radius, search, page, limit) {

		if (search) {
			return get(`/marketall/${radius}/${req}?total=${search}&page=${page}&limit=${limit}`)
		} else if (!search) {
			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
		} else {

			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
		}


	}

	//新增csupply 流通供应量/ 累计币天销毁量(流通供应量）
	static getMvrv(req, radius, start, end) {
		if (radius !== "BTC" && start) {
			return get(`/marketall/list/interface?req=market&radius=${radius}&start=${start}&end=${end}`)
		} else if (radius == "BTC" && start && end) {
			return get(`/marketall/btc/mvrv?start=${start}&end=${end}`)
		} else if (radius == "BTC" && !start) {
			return get(`/marketall/btc/mvrv`)
		} else {
			console.log("走着空间看到就", `${req, radius}`);

			return get(`/marketall/list/interface?req=market&radius=${radius}`)
		}
	}

	//新增csupply 流通供应量/ 累计币天销毁量(流通供应量）
	static getCsupply(req, radius, start, end,sma) {

		if (sma) {
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}

		
	}
	//新增soag 币天销毁量年龄分布
	static getSoag(req, radius, start, end,sma) {
		if (sma) {
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}
		
	}
	//新增dormancy 已花费输出休眠平均天数
	static getDormancy(req, radius, start, end,sma) {
		if (sma) {
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}
		
	}
	//新增asol已花费输出平均寿命
	static getAsol(req, radius, start, end,sma) {
		if (sma) {
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}

		
	}
	//新增sopr 已花费输出盈利比
	static getSopr(req, radius, start, end,sma) {
		if (sma) {
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}
	
	}

	//新增Profitrate 已实现盈利交易占比
	static getProfitrate(req, radius, start, end,sma) {
		if (sma) {
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}

		
	}

	//纳斯达克日K  BTC 日K
	static getNDAQBTCPrice(req, start, end,sma) {
		if (sma) {
			if (start) {
				return get(`/marketall/market/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/market/${req}?sma=${sma}`)
			}
		}else{
			if (start) {
				return get(`/marketall/market/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/market/${req}`)
			}
		}
	
	}

	//合约主动买入量
	static getTakerlongshortRatio(symbol, period, start, end, limit) {
		// &limit=${limit}
		if (start) {
			return get(`/futures/data/takerlongshortRatio?symbol=${symbol}&period=${period}&startTime=${start}&endTime=${end}`)
		} else {
			return get(`/futures/data/takerlongshortRatio?symbol=${symbol}&period=${period}`)
		}



	}
	//未平仓合约数
	static getOpenInterest(symbol, start, end, limit) {

		// &limit=${limit}
		if (symbol && start) {
			return get(`/fapi/v1/openInterest?symbol=${symbol}&startTime=${start}&endTime=${end}`)
		} else if (!symbol && start) {
			return get(`/fapi/v1/openInterest?startTime=${start}&endTime=${end}`)
		} if (symbol && !start) {

			return get(`/fapi/v1/openInterest?symbol=${symbol}`)
		} else {
			return get(`/fapi/v1/openInterest`)
		}
	}

	//资金费率
	static getFundingRate(symbol, start, end, limit) {

		// &limit=${limit}
		if (symbol && start) {
			return get(`/fapi/v1/fundingRate?symbol=${symbol}&startTime=${start}&endTime=${end}`)
		} else if (!symbol && start) {
			return get(`/fapi/v1/fundingRate?startTime=${start}&endTime=${end}`)
		} if (symbol && !start) {

			return get(`/fapi/v1/fundingRate?symbol=${symbol}`)
		} else {
			return get(`/fapi/v1/fundingRate`)
		}
	}

	//每日交易量、交易费
	static getVolume(req, radius, start, end,sma) {
		if (sma) {
			if (start) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (start) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}
		
	}
	static getFees(req, radius, start, end,) {
		if (start) {
			return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
		} else {
			return get(`/marketall/${radius}/${req}`)
		}
	}

	//ma370
	static getMa370(req, radius, start, end,sma) {
		if (sma) {
			if (start) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (start) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}
		
	}
	//每日币价K线 新增capReal
	static getCapReal(start, end,) {
		if (start) {
			return get(`/marketall/btc/capReal?coin=BTC&start=${start}&end=${end}`)
		} else {
			return get(`/marketall/btc/capReal?coin=BTC`)
		}
	}
	//请求BTC price价格
	static getBtcPrice(start, end,) {
		if (start) {
			return get(`/marketall/list/interface?req=price&radius=btc&start=${start}&end=${end}`)
		} else {
			return get(`/marketall/list/interface?req=price&radius=btc`)
		}
	}
	//请求BTC/ETH price价格
	static getBtcPrice2(radius, start, end,) {
		if (start) {
			return get(`/marketall/list/interface?req=price&radius=${radius}&start=${start}&end=${end}`)
		} else {
			return get(`/marketall/list/interface?req=price&radius=${radius}`)
		}
	}

	//币安 条件查询
	static getPriceValueLine(start, end,) {
		return get(`/marketall/bian/list?symbol=BTCUSDT&start=${start}&end=${end}`)
		if (req && start && end) {
			return get(`/marketall/${radius}/${req}?symbol=${symbol}&timeInterval=${timeInterval}&start=${start}&end=${end}`)
		} else {
			return get(`/marketall/${radius}/${req}?symbol=${symbol}&timeInterval=${timeInterval}`)
		}

		// &start=${start}&end=${end}

	}
	//以太坊巨鲸地址余额列表	
	static getTopAddrList(type, page, limit) {
		if (type) {
			return get(`/marketall/eth/ethTopAddrList?total=${type}&page=${page}&limit=${limit}`)
		} else {
			return get(`/marketall/eth/ethTopAddrList?page=${page}&limit=${limit}`)
		}


		if (req && start && end && type) {
			return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&type=${type}`)
		} else if (req && start && end && !type) {
			return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
		} else {
			return get(`/marketall/${radius}/${req}`)
		}
	}
	//地址对应标记持有者名称关系列表	
	static getBtctags(req, radius, page, limit) {
		if (req && page && !limit) {
			return get(`/marketall/${radius}/${req}?page=${page}`)
		} else if (req && page && limit) {
			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
		} else if (req && !page && limit) {
			return get(`/marketall/${radius}/${req}?limit=${limit}`)
		}
		else {
			return get(`/marketall/${radius}/${req}`)
		}


	}
	//天针
	static getDaysNeedle(interval, limit) {
		return get(`https://13.214.133.132:7101/marketall/bian/tz?interval=${interval}&limit=${limit}`)

	}

	//8/29新增币价当前市值排名
	static getCoinmarketall() {

		return get(`/marketall/list/coinmarket/all`)
	}

	//8/29新增24小时币价
	static getCoinmarket(coin, start, end) {
		if (coin) {
			return get(`/marketall/list/coinmarket?coin=${coin}&start=${start}&end=${end}`)
		} else {
			return
		}

		if (start) {
			return get(`/marketall/list/coinmarket?coin=${coin}&start=${start}&end=${end}`)
		} else {
			return get(`/marketall/list/coinmarket?coin=${coin}`)
		}

	}

	//8/15新增币安价格
	static getPriceValue(interval, start, end) {
		return get(`/marketall/bian/priceValue?interval=${interval}&start=${start}&end=${end}`)
		// return get(`/marketall/bian/priceValue?symbol=BTCUSDT&start=${start}&end=${end}`)

	}
	//8月5号新增BalanceData
	static getBalanceData(req, radius, value, start, end) {
		if (req && !start && !end) {
			return get(`/marketall/${radius}/${req}/${value}`)
		} else {
			return get(`/marketall/${radius}/${req}/${value}?start=${start}&end=${end}`)
		}
	}
	//8月2号新增getTopList
	static getTopList(req, radius, type,) {
		if (req && type) {
			return get(`/marketall/${radius}/${req}?${type}`)
		} else {
			return get(`/marketall/${radius}/${req}`)
		}
	}
	//20号新增newAddress
	static getNewAddress(req, radius, start, end,sma) {
		if (sma) {
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (start && end) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/${radius}/${req}`)
			}
		}
		
	}
	//币安 条件查询
	static getBiAnController(req, radius, symbol, timeInterval, start, end, type,) {
		if (req && start && end) {
			return get(`/marketall/${radius}/${req}?symbol=${symbol}&timeInterval=${timeInterval}&start=${start}&end=${end}`)
		} else {
			return get(`/marketall/${radius}/${req}?symbol=${symbol}&timeInterval=${timeInterval}`)
		}

		// &start=${start}&end=${end}

	}
	//arh99请求格式不同
	static getArh(req, radius, start, end) {
		if (req && start && end) {
			return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
		} else {
			return get(`/marketall/${radius}/${req}`)
		}

	}
	//大额交易搜索 不分页
	static getBigDeals2(req, radius, search, start, end, page, limit) {
		if (search && start && end) {
			return get(`/marketall/${radius}/${req}?total=${search}&start=${start}&end=${end}&page=${page}&limit=${limit}`)
		} else if (req && search && !start) {
			return get(`/marketall/${radius}/${req}?total=${search}&page=${page}&limit=${limit}`)
		} else if (req && !search && !start) {
			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
		} else if (req && !search && start) {
			return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&page=${page}&limit=${limit}`)
		} else {
			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
		}

	}
	//大额交易搜索 带分页
	static getETHTokenBigtx(req, radius, search, start, end, page, limit, abbr) {
		if (abbr) {
			if (search && start && end) {
				return get(`/marketall/${radius}/${req}?total=${search}&start=${start}&end=${end}&page=${page}&limit=${limit}&abbr=${abbr}`)
			} else if (req && search && !start) {
				return get(`/marketall/${radius}/${req}?total=${search}&page=${page}&limit=${limit}&abbr=${abbr}`)
			} else if (req && !search && !start) {//默认渲染一天的数据 带时间
				return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}&abbr=${abbr}`)
			} else if (req && !search && start) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&page=${page}&limit=${limit}&abbr=${abbr}`)
			} else if (req && !search && start) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&page=${page}&limit=${limit}&abbr=${abbr}`)
			} else {
				return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}&abbr=${abbr}`)
			}
		} else {
			if (search && start && end) {
				return get(`/marketall/${radius}/${req}?total=${search}&start=${start}&end=${end}&page=${page}&limit=${limit}`)
			} else if (req && search && !start) {
				return get(`/marketall/${radius}/${req}?total=${search}&page=${page}&limit=${limit}`)
			} else if (req && !search && !start) {//默认渲染一天的数据 带时间
				return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
			} else if (req && !search && start) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&page=${page}&limit=${limit}`)
			} else if (req && !search && start) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&page=${page}&limit=${limit}`)
			} else {
				return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
			}
		}





	}
	//大额交易搜索 带分页
	static getBigDeals(req, radius, search, start, end, page, limit) {

		if (search && start && end) {
			return get(`/marketall/${radius}/${req}?total=${search}&start=${start}&end=${end}&page=${page}&limit=${limit}`)
		} else if (req && search && !start) {
			return get(`/marketall/${radius}/${req}?total=${search}&page=${page}&limit=${limit}`)
		} else if (req && !search && !start) {//默认渲染一天的数据 带时间
			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
		} else if (req && !search && start && page) {
			return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&page=${page}&limit=${limit}`)
		} else if (req && !search && start) {
			return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&page=${page}&limit=${limit}`)
		} else {
			return get(`/marketall/${radius}/${req}?page=${page}&limit=${limit}`)
		}



	}
	//大额tabel表格
	static getBigDealsTabel(req, radius, address, txId) {
		if (address) {
			return get(`/marketall/${radius}/${req}?address=${address}`)
		} else {
			return get(`/marketall/${radius}/${req}?txId=${txId}`)
		}


	}
	//大额交易数量查询
	static getBigDealsCount(req, radius, start, end, type,sma) {
		if (sma) {
			if (req && start && end && type) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&type=${type}&sma=${sma}`)
			} else if (req && start && end && !type) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
	
				return get(`/marketall/${radius}/${req}?sma=${sma}`)
			}
		}else{
			if (req && start && end && type) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}&type=${type}`)
			} else if (req && start && end && !type) {
				return get(`/marketall/${radius}/${req}?start=${start}&end=${end}`)
			} else {
	
				return get(`/marketall/${radius}/${req}`)
			}
		}
		
	}
	static getNdaqData(type, start, end) {//NAQA
		if (start && end) {
			return get(`${type}&start=${start}&end=${end}`)
		} else {
			return get(`${type}`)
		}
	}
	//通用请求
	static getActiveaddress(req, radius, start, end,sma) {//Activeaddress
		if (sma) {
			if (req && radius && start && end) {
				return get(`/marketall/list/interface?req=${req}&radius=${radius}&start=${start}&end=${end}&sma=${sma}`)
			} else if (req && radius && !start) {
				return get(`/marketall/list/interface?req=${req}&radius=${radius}&sma=${sma}`)
			} else if (req && !radius && start && end) {
				return get(`/marketall/list/interface?req=${req}&start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/list/interface?req=${req}&sma=${sma}`)
			}
		}else{
			if (req && radius && start && end) {
				return get(`/marketall/list/interface?req=${req}&radius=${radius}&start=${start}&end=${end}`)
			} else if (req && radius && !start) {
				return get(`/marketall/list/interface?req=${req}&radius=${radius}`)
			} else if (req && !radius && start && end) {
				return get(`/marketall/list/interface?req=${req}&start=${start}&end=${end}`)
			} else {
				return get(`/marketall/list/interface?req=${req}`)
			}
		}
		



	}
	//请求价格
	static getPriceOHLC(req, radius, start, end) {//Activeaddress
		if (start && end) {
			return get(`/marketall/list/interface?req=${req}&radius=${radius}&start=${start}&end=${end}`)
		}
		if (req && radius) {
			return get(`/marketall/list/interface?req=${req}&radius=${radius}`)
		} else if (req && !radius && start && end) {
			return get(`/marketall/list/interface?req=${req}&start=${start}&end=${end}`)
		} else {
			return get(`/marketall/list/interface?req=${req}`)
		}


	}
	//NDAQ
	static getPriceNDAQ(req, start, end,sma) {//Activeaddress
		if (sma) {
			if (start, end) {
				return get(`/marketall/market/${req}?start=${start}&end=${end}&sma=${sma}`)
			} else {
				return get(`/marketall/market/${req}?sma=${sma}`)
			}
		}else{
			if (start, end) {
				return get(`/marketall/market/${req}?start=${start}&end=${end}`)
			} else {
				return get(`/marketall/market/${req}`)
			}
		}
		


	}

}









