/**
 * Web唐明明
 * 匆匆数载恍如梦，岁月迢迢华发增。
 * 碌碌无为枉半生，一朝惊醒万事空。
 * moduleName: 钱包
 */

import { request } from '../index'

// 设置密码
const security = data => {
	return request({
		url: 'chain/safe/security',
		method: 'POST',
		data
	})
}

// 获取助记词
const seed = data => {
	return request({
		url: 'chain/safe/seed',
		data
	})
}

// 余额
const sum = () => {
	return request({
		url: 'chain/account/balance'
	})
}

// 账户记录
const logs = data => {
	return request({
		url: 'chain/account/logs',
		data
	})
}

// 验证密码
const securityCheck = (password) => {
	return request({
		url : "chain/safe/security/check",
		method: 'POST',
		data:{
			code : password,
		}
	})
}

// 钱包私钥
const privatekey = (code) => {
	return request({
		url : "chain/safe/private_key",
		data: {
			code
		} 
	})
}

// 私钥规则
const keyrules = () => {
	return request({
		url: 'cms/keyrules'
	})
}

// 修改密码
const securityReset = (data) => {
	return request({
		url : "chain/safe/security",
		method: 'PUT',
		data:data
	})
}

export {
	security,
	seed,
	sum,
	logs,
	securityCheck,
	privatekey,
	keyrules,
	securityReset
}
