import http from '../../utils/http'

export default class History {
  static async findByHashOrBlockOrDataVague(block: String, hashCode: String, dataVague: String,
                                            limit1: Number, limit2: Number) {
    let url = '/ethmev/findByHashOrBlockOrDataVague'
    const rst = await http.post(url, {
      block: block,
      hash: hashCode,
      dataVague: dataVague,
      limit1: limit1,
      limit2: limit2
    })
    return rst.data
  }

  static async appendOrUpdate(block: String, hashCode: String, data: any) {
    let url = '/ethmev/appendOrUpdate'
    const rst = await http.post(url, {
      'block': block,
      'hash': hashCode,
      'data': JSON.stringify(data)
    })
    return rst.data
  }
}
