import xFetch from './xFetch';
import {serialize} from '../utils';

export async function fetchList(query) {
    return xFetch('/api/trades' +'?' + serialize(query));
}
export async function fetchItem(id) {
    return xFetch('/api/trades/'+ id);
}

export async function createItem(data){
    return xFetch('/api/trades', {
        method:'POST',
        body: serialize(data)
    });
}

export async function settlementItem(id){
    return xFetch('/api/trade/commission/settlement/'+id);
}
