text: import {getFills} from 'LoopringJS/relay/rpc/ring'
  import config from 'common/config'
  import storage from '../storage/'
  
  export async function fetchList(payload){
      let {page,filters,sort} = payload
      let filter = {}
      if(filters){
        filter = {...filters}
      }
      if(page){
        filter.pageIndex = page.current
        filter.pageSize = page.size
      }
      filter.delegateAddress = config.getDelegateAddress();
      filter.owner = storage.wallet.getUnlockedAddress()
      const host = window.config && window.config.rpc_host
      return getFills(host,filter).then(res=>{
        if(!res.error && res.result.data){
          // const orders = res.result.data.filter(order => config.getTokenBySymbol(order.originalOrder.tokenB) && config.getTokenBySymbol(order.originalOrder.tokenB).digits &&
          //   config.getTokenBySymbol(order.originalOrder.tokenS)&&  config.getTokenBySymbol(order.originalOrder.tokenS).digits &&
          //   config.getMarketBySymbol(order.originalOrder.tokenB,order.originalOrder.tokenS) && config.getMarketBySymbol(order.originalOrder.tokenB,order.originalOrder.tokenS).pricePrecision);
          return {
            items:res.result.data,
            page:{
              current:res.result.pageIndex,
              size:res.result.pageSize,
              total:res.result.total,
            }
          }
        }else{
          // tmp code because server has no error-code
          return {
            items:[],
            page:{
            }
          }
        }
      })
  }
  